View Source AshAuthentication.TokenResource.Actions (ash_authentication v4.0.4)

The code interface for interacting with the token resource.

Summary

Functions

Remove all expired records.

Retrieve a token by token or JTI optionally filtering by purpose.

Has the token been revoked?

Has the token been revoked?

Functions

Link to this function

expunge_expired(resource, opts \\ [])

View Source
@spec expunge_expired(
  Ash.Resource.t(),
  keyword()
) :: :ok | {:error, any()}

Remove all expired records.

Link to this function

get_token(resource, params, opts \\ [])

View Source
@spec get_token(Ash.Resource.t(), map(), keyword()) ::
  {:ok, [Ash.Resource.record()]} | {:error, any()}

Retrieve a token by token or JTI optionally filtering by purpose.

Link to this function

jti_revoked?(resource, jti, opts \\ [])

View Source
@spec jti_revoked?(Ash.Resource.t(), String.t(), keyword()) :: boolean()

Has the token been revoked?

Similar to token-revoked?/2..3 except that rather than extracting the JTI from the token, assumes that it's being passed in directly.

Link to this function

revoke(resource, token, opts \\ [])

View Source
@spec revoke(Ash.Resource.t(), String.t(), keyword()) :: :ok | {:error, any()}

Revoke a token.

Extracts the JTI from the provided token and uses it to generate a revocation record.

Link to this function

store_token(resource, params, opts \\ [])

View Source
@spec store_token(Ash.Resource.t(), map(), keyword()) :: :ok | {:error, any()}

Store a token.

Stores a token for any purpose.

Link to this function

token_revoked?(resource, token, opts \\ [])

View Source
@spec token_revoked?(Ash.Resource.t(), String.t(), keyword()) :: boolean()

Has the token been revoked?

Similar to jti_revoked?/2..3 except that it extracts the JTI from the token, rather than relying on it to be passed in.