AshAuthentication.Phoenix.Plug (ash_authentication_phoenix v2.10.1)

View Source

Helper plugs mixed in to your router.

When you use AshAuthentication.Phoenix.Router this module is included, so that you can use these plugs in your pipelines.

Summary

Functions

Attempt to retrieve actors from the Authorization header(s).

Attempt to retrieve all actors from the connections' session.

Revoke all token(s) in the Authorization header(s).

Revoke all token(s) in the session.

Store the actor in the connections' session.

Functions

load_from_bearer(conn, opts)

@spec load_from_bearer(
  Plug.Conn.t(),
  keyword()
) :: Plug.Conn.t()

Attempt to retrieve actors from the Authorization header(s).

A wrapper around AshAuthentication.Plug.Helpers.retrieve_from_bearer/2 with the otp_app as extracted from the endpoint.

load_from_session(conn, opts)

@spec load_from_session(
  Plug.Conn.t(),
  keyword()
) :: Plug.Conn.t()

Attempt to retrieve all actors from the connections' session.

A wrapper around AshAuthentication.Plug.Helpers.retrieve_from_session/2 with the otp_app as extracted from the endpoint.

revoke_bearer_tokens(conn, opts)

@spec revoke_bearer_tokens(Plug.Conn.t(), any()) :: Plug.Conn.t()

Revoke all token(s) in the Authorization header(s).

A wrapper around AshAuthentication.Plug.Helpers.revoke_bearer_tokens/2 with the otp_app as extracted from the endpoint.

revoke_session_tokens(conn, opts)

@spec revoke_session_tokens(Plug.Conn.t(), any()) :: Plug.Conn.t()

Revoke all token(s) in the session.

A wrapper around AshAuthentication.Plug.Helpers.revoke_session_tokens/2 with the otp_app as extracted from the endpoint.

store_in_session(conn, actor)

@spec store_in_session(Plug.Conn.t(), Ash.Resource.record()) :: Plug.Conn.t()

Store the actor in the connections' session.