authex v0.1.2 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 default blacklist

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 if its blacklisted using the default blacklist

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 default blacklist

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 blacklist() View Source
blacklist() :: atom()
Link to this type jti() View Source
jti() :: binary()
Link to this type token_or_jti() View Source
token_or_jti() :: Authex.Token.t() | binary()

Link to this section Functions

Link to this function del(token_or_jti) View Source
del(token_or_jti()) :: :ok | :error

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

The default blacklist is set through the :blacklist config option.

See del/2 for further details.

Parameters

  • token_or_jti: An Authex.Token struct or binary jti.
Link to this function del(module, token_or_jti) View Source

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

  • token_or_jti: An Authex.Token struct or binary jti.
Link to this function get(token_or_jti) View Source
get(token_or_jti()) :: :ok | :error

Takes an Authex.Token struct or binary jti and checks if its blacklisted using the default blacklist.

The default blacklist is set through the :blacklist config option.

See get/2 for further details.

Parameters

  • token_or_jti: An Authex.Token struct or binary jti.
Link to this function get(module, token_or_jti) View Source
get(blacklist(), 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 it has been blacklisted.

Otherwise, returns :error.

Parameters

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

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

The default blacklist is set through the :blacklist config option.

See set/2 for further details.

Parameters

  • token_or_jti: An Authex.Token struct or binary jti.
Link to this function set(module, token_or_jti) View Source
set(blacklist(), token_or_jti()) :: :ok | :error
set(blacklist(), 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 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.