Auctoritas v0.2.3 Auctoritas.DataStorage behaviour View Source

DataStorage module

  • Specifies DataStorage behaviour

Link to this section Summary

Types

Token expiration in seconds

Name from config (Auctoritas supervisor name)

Authentication token

Callbacks

Delete token from data_storage, used when deauthenticating (logging out)

Return tokens with specified start and amount value

Insert token with expiration and supplied data map

Starts data_storage when returned {:ok, worker_map_or_equals} Return {:no_worker} if data_storage startup isn't required

Return token expiration time in seconds

Link to this section Types

Token expiration in seconds

Name from config (Auctoritas supervisor name)

Authentication token

Link to this section Callbacks

Link to this callback

delete_token(name, token) View Source
delete_token(name(), token()) ::
  {atom(), any()} :: {:ok, boolean()} | {:error, error :: any()}

Delete token from data_storage, used when deauthenticating (logging out)

Link to this callback

get_token_data(name, token) View Source
get_token_data(name(), token()) :: {:ok, map()} | {:error, error :: any()}

Link to this callback

get_tokens(name, start, amount) View Source
get_tokens(name(), start :: non_neg_integer(), amount :: non_neg_integer()) ::
  {:ok, list()} | {:error, error :: any()}

Return tokens with specified start and amount value

Link to this callback

insert_token(name, expiration, token, map, map) View Source
insert_token(name(), expiration(), token(), map(), map()) ::
  {:ok, token()} | {:error, error :: any()}

Insert token with expiration and supplied data map.

Link to this callback

start_link(map) View Source
start_link(map()) :: {:ok, any()} | {:no_worker}

Starts data_storage when returned {:ok, worker_map_or_equals} Return {:no_worker} if data_storage startup isn't required

Link to this callback

token_expires?(name, token) View Source
token_expires?(name(), token()) ::
  {:ok, expiration()} | {:error, error :: any()}

Return token expiration time in seconds

Link to this callback

update_metadata(name, token, map) View Source
update_metadata(name(), token(), map()) :: {atom(), any()}

Link to this callback

update_token(name, token, any) View Source
update_token(name(), token(), any()) :: {atom(), any()}