A AsyncCacheApi that will be used to cache session data.
A random token generator.
Finds the user ID that is associated with an AuthenticityToken.
Finds the user ID that is associated with an AuthenticityToken. If Some[Id]
is returned, that is sufficient to
show that a user's session is valid.
The AuthenticityToken to verify.
The user ID associated with the AuthenticityToken within the IdContainer
, if there is one.
Otherwise, None
.
Delays the expiration of a session by a given duration.
Delays the expiration of a session by a given duration.
The AuthenticityToken of the session to prolong.
The new duration of the session. e.g. if there is 30 minutes left in a session, and a timeout of one hour is passed, the session will expire in one hour.
A successful Future
if the session was prolonged, or a failed Future
if the session isn't valid, or
some other error occurred.
Destroys the session identified by a given token.
Destroys the session identified by a given token.
The AuthenticityToken that is paired with the session to be destroyed.
A successful Future
if the session was destroyed, or a failed Future
if an error occurred.
Opens a new session for a user, and generates an AuthenticityToken that is paired with that user's ID.
Opens a new session for a user, and generates an AuthenticityToken that is paired with that user's ID.
The ID of the session the session will be created for.
How long the session will be valid before expiring in a stateful IdContainer
.
An AuthenticityToken to be given to the user to later verify their session is valid.
An IdContainer implementation that stores session data in a cache with AsyncCacheApi. For each session, two values are stored in the cache. One has a key that is an AuthenticityToken with a value of the user ID that has been issued that token (in order to verify the validity of a session by a token). And the other has a key that is a user ID and value of the AuthenticityToken that user has been granted (in order to destroy sessions by user ID).
The type of user's ID in an application.