AshAuthentication. Oauth2Server. AuthorizationCodeResource
(ash_authentication_oauth2_server v0.2.1)
Copy Markdown
View Source
Resource extension for OAuth 2.1 authorization-code rows.
Adds an auto-generated :expunge_expired destroy action and exposes
configuration for the AshAuthentication.Oauth2Server.Expunger
GenServer, which periodically removes:
- rows whose
expires_athas passed - rows whose
consumed_atis older thanconsumed_grace
Usage
use Ash.Resource,
extensions: [AshAuthentication.Oauth2Server.AuthorizationCodeResource],
...
oauth2_server do
expunge_interval 1
consumed_grace 86_400
endRemoving expired records
Add AshAuthentication.Oauth2Server.Supervisor to your application
supervision tree; it starts the expunger which scans on each
resource's configured interval.
Summary
Functions
Bulk-destroy authorization-code rows that have expired or whose
consumed_at is older than the configured consumed_grace.
Functions
@spec expunge_expired( Ash.Resource.t(), keyword() ) :: :ok | {:error, any()}
Bulk-destroy authorization-code rows that have expired or whose
consumed_at is older than the configured consumed_grace.