What a backend gives the conformance kit.
Summary
Callbacks
Deletes a user from the backend's store, as an administrator would, after they signed in: the kit then asks for a session for them.
Disables a user.
Enrolls user in the backend's second factor, the way a user would
(begin, then confirm with a valid code), and returns a function that
gives a code the backend accepts at the moment it is called and has
not yet accepted: a fresh device's current code. (A fixture that
confirmed with the current step's code should have confirmed with the
previous step's, so the current one is still unspent.)
How long a session may idle before it expires, in seconds.
Resets the backend's store before each test.
Every value the backend stores for sessions (to prove no token is stored as is).
Makes a user; attrs may set :second_factor (:none | :enrolled | :required). Returns the user and credentials that sign it in.
Callbacks
@callback delete!(Macaw.Auth.User.t()) :: :ok
Deletes a user from the backend's store, as an administrator would, after they signed in: the kit then asks for a session for them.
@callback disable!(Macaw.Auth.User.t()) :: :ok
Disables a user.
@callback enroll_second_factor!(Macaw.Auth.User.t()) :: (-> String.t())
Enrolls user in the backend's second factor, the way a user would
(begin, then confirm with a valid code), and returns a function that
gives a code the backend accepts at the moment it is called and has
not yet accepted: a fresh device's current code. (A fixture that
confirmed with the current step's code should have confirmed with the
previous step's, so the current one is still unspent.)
@callback idle_seconds() :: pos_integer()
How long a session may idle before it expires, in seconds.
@callback reset!() :: :ok
Resets the backend's store before each test.
@callback stored_session_values() :: [binary()]
Every value the backend stores for sessions (to prove no token is stored as is).
@callback user!(map()) :: {Macaw.Auth.User.t(), map()}
Makes a user; attrs may set :second_factor (:none | :enrolled | :required). Returns the user and credentials that sign it in.