View Source KratosPlug (kratos_plug v0.1.0)

Functions for working with kratos sessions. This functionality expects that a kratos session has been previously fetched and stored in Plug.Conn.assigns.

Link to this section Summary

Functions

Returns true when the sessions authenticator assurance level is 0.

Returns true when the sessions authenticator assurance level is 1.

Returns true when the sessions authenticator assurance level is 2.

Returns true when the sessions authenticator assurance level is 3.

Tests the sessions authenticator assurance level.

Returns a conn Plug.Conn with a kratos session attached.

Returns true when the conn has an active Kratos session.

Returns true when the conn has a valid Kratos session.

Link to this section Functions

Link to this function

aal0?(conn)

View Source (since 0.1.0)
@spec aal0?(Plug.Conn.t()) :: boolean()

Returns true when the sessions authenticator assurance level is 0.

Link to this function

aal1?(conn)

View Source (since 0.1.0)
@spec aal1?(Plug.Conn.t()) :: boolean()

Returns true when the sessions authenticator assurance level is 1.

Link to this function

aal2?(conn)

View Source (since 0.1.0)
@spec aal2?(Plug.Conn.t()) :: boolean()

Returns true when the sessions authenticator assurance level is 2.

Link to this function

aal3?(conn)

View Source (since 0.1.0)
@spec aal3?(Plug.Conn.t()) :: boolean()

Returns true when the sessions authenticator assurance level is 3.

Link to this function

aal?(conn, i)

View Source (since 0.1.0)
@spec aal?(Plug.Conn.t(), integer()) :: boolean()

Tests the sessions authenticator assurance level.

Link to this function

assign_session(conn, session)

View Source (since 0.1.0)
@spec assign_session(Plug.Conn.t(), any()) :: Plug.Conn.t()

Returns a conn Plug.Conn with a kratos session attached.

Link to this function

session_active?(conn)

View Source (since 0.1.0)
@spec session_active?(Plug.Conn.t()) :: boolean()

Returns true when the conn has an active Kratos session.

Link to this function

session_valid?(conn)

View Source (since 0.1.0)
@spec session_valid?(Plug.Conn.t()) :: boolean()

Returns true when the conn has a valid Kratos session.

At some point we may wish to add additional checks to this function. Those future changes will set it apart from KratosPlug.Plug.Api.session_active?/1.