authex v0.2.1 Authex.Blacklist behaviour View Source

Link to this section Summary

Functions

Takes an Authex.Token struct or binary jti and deletes it from the blacklist using the provided module

Takes an Authex.Token struct or binary jti and checks whether it has been blacklisted using the provided module

Takes an Authex.Token struct or binary jti and sets it as being blacklisted using the provided module

Callbacks

Removes the provided binary jti from the blacklist

Checks whether the blacklist contains the provided binary jti

Puts the provided binary jti into the blacklist

Link to this section Types

Link to this type jti() View Source
jti() :: binary()
Link to this type token_or_jti() View Source
token_or_jti() :: Authex.Token.t() | jti()

Link to this section Functions

Link to this function del(blacklist, jti) View Source
del(blacklist :: Authex.Blacklist.t(), token_or_jti()) :: :ok | :error

Takes an Authex.Token struct or binary jti and deletes it from the blacklist using the provided module.

Returns :ok if the operation was successful.

Returns :error if an error occured.

Parameters

  • blacklist: A blacklist module.
  • token_or_jti: An Authex.Token struct or binary or integer jti.
Link to this function get(blacklist, jti) View Source
get(blacklist :: Authex.Blacklist.t(), token_or_jti()) ::
  boolean() |
  :error

Takes an Authex.Token struct or binary jti and checks whether it has been blacklisted using the provided module.

Returns false if the jti is not blacklisted.

Returns true if the jti is blacklisted.

Otherwise, returns :error.

Parameters

  • blacklist: A blacklist module.
  • token_or_jti: An Authex.Token struct or binary or integer jti.
Link to this function set(blacklist, jti) View Source
set(blacklist :: Authex.Blacklist.t(), token_or_jti()) :: :ok | :error

Takes an Authex.Token struct or binary jti and sets it as being blacklisted using the provided module.

Returns :ok if the operation was successful.

Returns :error if an error occured.

Parameters

  • blacklist: A blacklist module.
  • token_or_jti: An Authex.Token struct or binary or integer jti.

Link to this section Callbacks

Link to this callback handle_del(jti) View Source
handle_del(jti()) :: :ok | :error

Removes the provided binary jti from the blacklist.

Returning :ok signals the operation was successful.

Returning :error signals an error occured.

Parameters

  • jti: A binary jti.
Link to this callback handle_get(jti) View Source
handle_get(jti()) :: boolean() | :error

Checks whether the blacklist contains the provided binary jti.

Returning true signals that the jti is blacklisted.

Returning false signals that the jti is not blacklisted.

Returning :error signals an error occured.

Parameters

  • jti: A binary jti.
Link to this callback handle_set(jti) View Source
handle_set(jti()) :: :ok | :error

Puts the provided binary jti into the blacklist.

Returning :ok signals the operation was successful.

Returning :error signals an error occured.

Parameters

  • jti: A binary jti.