View Source Samly.State.Store behaviour (samly v1.4.0)

Specification for Samly state stores.

Summary

Types

The name_id should not be used independent of the idp_id. It is within the scope of idp_id. Together these form the assertion key.

IdP identifier associated with the assertion.

SAML nameid returned by IdP.

Options passed during the store initialization.

Callbacks

Removes the given SAML assertion from the store.

Returns a Samly assertion if present in the store.

Initializes the store.

Saves the given SAML assertion in the store.

Types

@type assertion_key() :: {idp_id(), name_id()}

The name_id should not be used independent of the idp_id. It is within the scope of idp_id. Together these form the assertion key.

@type idp_id() :: binary()

IdP identifier associated with the assertion.

@type name_id() :: binary()

SAML nameid returned by IdP.

@type opts() :: Plug.opts()

Options passed during the store initialization.

Callbacks

Link to this callback

delete_assertion(t, assertion_key, opts)

View Source
@callback delete_assertion(Plug.Conn.t(), assertion_key(), opts()) ::
  Plug.Conn.t() | no_return()

Removes the given SAML assertion from the store.

May raise an error if there is a failure. An authenticated session must be terminated after calling this.

Link to this callback

get_assertion(t, assertion_key, opts)

View Source
@callback get_assertion(Plug.Conn.t(), assertion_key(), opts()) ::
  Samly.Assertion.t() | nil

Returns a Samly assertion if present in the store.

Returns nil if the assertion for the given key is not present in the store.

@callback init(opts()) :: opts() | no_return()

Initializes the store.

The options returned from this function will be given to get_assertion/3, put_assertion/4 and delete_assertion/3.

Link to this callback

put_assertion(t, assertion_key, t, opts)

View Source
@callback put_assertion(Plug.Conn.t(), assertion_key(), Samly.Assertion.t(), opts()) ::
  Plug.Conn.t() | no_return()

Saves the given SAML assertion in the store.

May raise an error if there is a failure. An authenticated session should not be established in that case.