authex v0.1.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 default blacklist. See del/2 for further details

Takes an Authex.Token struct or binary jti and deletes it from the blacklist using the default blacklist. Returns :ok if the action was successful. Otherwise, :error

Takes an Authex.Token struct or binary jti and checks whether it has been blacklisted or not using the default blacklist. See get/2 for further details

Takes an Authex.Token struct or binary jti and checks whether it has been blacklisted or not using the provided blacklist. Returns false if the jti is not blacklisted. Returns true if it has been blacklisted. Otherwise, returns :error

Takes an Authex.Token struct or binary jti and sets it as being blacklisted using the default blacklist. See set/2 for further details

Takes an Authex.Token struct or binary jti and sets it as being blacklisted using the default blacklist. Returns :ok if the action was successful. Otherwise, :error

Link to this section Types

Link to this type blacklist() View Source
blacklist() :: atom()

Link to this section Functions

Link to this function del(token_or_jti) View Source
del(Authex.Token.t() | binary()) :: :ok | :error

Takes an Authex.Token struct or binary jti and deletes it from the blacklist using the default blacklist. 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 default blacklist. Returns :ok if the action was successful. Otherwise, :error.

Parameters

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

Takes an Authex.Token struct or binary jti and checks whether it has been blacklisted or not using the default blacklist. 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(), Authex.Token.t() | binary()) :: boolean() | :error

Takes an Authex.Token struct or binary jti and checks whether it has been blacklisted or not using the provided blacklist. 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. 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(), Authex.Token.t() | binary()) :: :ok | :error
set(blacklist(), Authex.Token.t() | binary()) :: :ok | :error

Takes an Authex.Token struct or binary jti and sets it as being blacklisted using the default blacklist. Returns :ok if the action was successful. Otherwise, :error.

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(binary) View Source
handle_del(binary()) :: :ok | :error
Link to this callback handle_get(binary) View Source
handle_get(binary()) :: boolean() | :error
Link to this callback handle_set(binary) View Source
handle_set(binary()) :: :ok | :error