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
expiration()
View Source
expiration() :: non_neg_integer()
expiration() :: non_neg_integer()
Token expiration in seconds
name()
View Source
name() :: String.t()
name() :: String.t()
Name from config (Auctoritas supervisor name)
token()
View Source
token() :: String.t()
token() :: String.t()
Authentication token
Link to this section Callbacks
delete_token(name, token) View Source
Delete token from data_storage, used when deauthenticating (logging out)
get_token_data(name, token) View Source
get_tokens(name, start, amount)
View Source
get_tokens(name(), start :: non_neg_integer(), amount :: non_neg_integer()) ::
{:ok, list()} | {:error, error :: any()}
get_tokens(name(), start :: non_neg_integer(), amount :: non_neg_integer()) :: {:ok, list()} | {:error, error :: any()}
Return tokens with specified start and amount value
insert_token(name, expiration, token, map, map) View Source
Insert token with expiration and supplied data map.
start_link(map) View Source
Starts data_storage when returned {:ok, worker_map_or_equals}
Return {:no_worker}
if data_storage startup isn't required
token_expires?(name, token)
View Source
token_expires?(name(), token()) ::
{:ok, expiration()} | {:error, error :: any()}
token_expires?(name(), token()) :: {:ok, expiration()} | {:error, error :: any()}
Return token expiration time in seconds