View Source Guardian.DB.Adapter behaviour (Guardian.DB v3.0.0)
The Guardian DB Adapter.
This behaviour allows to use any storage system for Guardian Tokens.
Summary
Callbacks
Deletes JWT token
Used in Guardian.DB.Token.destroy_token/3
Purges all JWT tokens for a given subject.
Persists JWT token
Used in Guardian.DB.Token.create/2
Retrieves JWT token
Used in Guardian.DB.Token.find_by_claims/1
Purges all expired JWT tokens.
Callbacks
@callback delete(schema_or_changeset(), opts()) :: {:ok, schema()} | {:error, changeset()}
Deletes JWT token
Used in Guardian.DB.Token.destroy_token/3
Purges all JWT tokens for a given subject.
Returns a tuple containing the number of entries and any returned result as second element.
@callback insert(schema_or_changeset(), opts()) :: {:ok, schema()} | {:error, changeset()}
Persists JWT token
Used in Guardian.DB.Token.create/2
@callback one(claims(), opts()) :: schema() | nil
Retrieves JWT token
Used in Guardian.DB.Token.find_by_claims/1
Purges all expired JWT tokens.
Returns a tuple containing the number of entries and any returned result as second element.