View Source Boruta.Oauth.Codes behaviour (Boruta core v2.3.4)

Code context

Summary

Callbacks

Persists a token according to given params.

Returns a Boruta.Oauth.Token by value and redirect_uri.

Revokes the given Boruta.Oauth.Token code.

Revokes the the previouly issued token given Boruta.Oauth.Token code.

Callbacks

@callback create(
  params :: %{
    client: Boruta.Oauth.Client.t(),
    sub: String.t(),
    redirect_uri: String.t(),
    scope: String.t(),
    state: String.t(),
    code_challenge: String.t(),
    code_challenge_method: String.t(),
    resource_owner: Boruta.Oauth.ResourceOwner.t()
  }
) :: code :: Boruta.Oauth.Token.t() | {:error, reason :: term()}

Persists a token according to given params.

@callback get_by(params :: [value: String.t(), redirect_uri: String.t()]) ::
  token :: Boruta.Oauth.Token | nil

Returns a Boruta.Oauth.Token by value and redirect_uri.

@callback revoke(token :: Boruta.Oauth.Token.t()) ::
  {:ok, Boruta.Oauth.Token.t()} | {:error, reason :: term()}

Revokes the given Boruta.Oauth.Token code.

Link to this callback

revoke_previous_token(token)

View Source
@callback revoke_previous_token(token :: Boruta.Oauth.Token.t()) ::
  {:ok, Boruta.Oauth.Token.t()} | {:error, reason :: term()}

Revokes the the previouly issued token given Boruta.Oauth.Token code.