-type(age_resource_inheritance() :: auto | single | none).
-record(age_resource, {
id = undefined :: integer(),
parent = undefined :: integer(),
inheritance = auto :: age_resource_inheritance(),
includes = [] :: list(atom()),
excludes = [] :: list(atom()),
reference = undefined :: any()
}).
-record(age_auth_api, {
id :: string(), % Acts as API Key, or OAuth 2 client_id
name :: string(),
fields = #{} :: map()
}).
-define(AGE_AUTH_PROCESSOR, auth_processor).
-type age_auth_token_type() :: bearer | oauth_code.
-record(app_auth_token, {
id :: string(),
type = bearer :: age_auth_token_type(),
life = -1 :: integer(), % Calcualted future time in seconds. Defaults to -1 = forever
timestamp = age_tools:now_to_unix() :: integer(),
refresh :: string() | undefined,
fields = #{} :: map()
}).
-record(app_auth_user, {
id :: string(),
password :: binary(), % crypto:hash(sha, <<"password">>))
timestamp = age_tools:now_to_unix() :: integer(),
fields = #{} :: map()
}).
|