Guardsix.Core.UserDefinedListBySession (guardsix v1.2.2)

Copy Markdown View Source

Session-based operations for user-defined lists in Guardsix.

These functions use session-based authentication by mimicking browser requests against internal LogPoint UI endpoints. They are unstable and may break if LogPoint changes its login flow, CSRF handling, or internal form fields.

For stable JWT-based operations, use Guardsix.Core.UserDefinedList.

Summary

Functions

Delete a user-defined list by ID.

Delete a user-defined list by name.

Extract the contents of a user-defined list by ID.

Update a static list by ID.

Update a static list by name.

Functions

delete(session, id)

@spec delete(Guardsix.Data.Session.t(), String.t()) :: {:ok, map()} | {:error, term()}

Delete a user-defined list by ID.

Examples

{:ok, session} = Guardsix.session("https://guardsix.example.com", "admin", "password")
UserDefinedListSession.delete(session, "69c1119e549c866b966d0959")

delete_by_name(session, name)

@spec delete_by_name(Guardsix.Data.Session.t(), String.t()) ::
  {:ok, map()} | {:error, term()}

Delete a user-defined list by name.

Looks up the list ID by name (case-insensitive, since LogPoint uppercases names), then delegates to delete/2.

Examples

{:ok, session} = Guardsix.session("https://guardsix.example.com", "admin", "password")
UserDefinedListSession.delete_by_name(session, "MY_LIST")

extract(session, id)

@spec extract(Guardsix.Data.Session.t(), String.t()) ::
  {:ok, map()} | {:error, term()}

Extract the contents of a user-defined list by ID.

Examples

{:ok, session} = Guardsix.session("https://guardsix.example.com", "admin", "password")
UserDefinedListSession.extract(session, "69c1119e549c866b966d0959")

update_static(session, id, values)

@spec update_static(Guardsix.Data.Session.t(), String.t(), [String.t()]) ::
  {:ok, map()} | {:error, term()}

Update a static list by ID.

Fetches the current list state, replaces the values, and saves.

Examples

{:ok, session} = Guardsix.session("https://guardsix.example.com", "admin", "password")
UserDefinedListSession.update_static(session, "69c1...", ["val1", "val2"])

update_static_by_name(session, name, values)

@spec update_static_by_name(Guardsix.Data.Session.t(), String.t(), [String.t()]) ::
  {:ok, map()} | {:error, term()}

Update a static list by name.

Looks up the list ID by name (case-insensitive, since LogPoint uppercases names), then delegates to update_static/3.

Examples

{:ok, session} = Guardsix.session("https://guardsix.example.com", "admin", "password")
UserDefinedListSession.update_static_by_name(session, "MY_LIST", ["val1", "val2"])