Atex.OAuth.Cache (atex v0.7.1)
View SourceTTL cache for OAuth authorization server information.
This module manages two separate ConCache instances:
- Authorization server cache (stores PDS -> authz server mappings)
- Authorization metadata cache (stores authz server -> metadata mappings)
Both caches use a 1-hour TTL to reduce load on third-party PDSs.
Summary
Functions
Returns a specification to start this module under a supervisor.
Get authorization server from cache.
Get authorization server metadata from cache.
Store authorization server in cache.
Store authorization server metadata in cache.
Starts the OAuth cache supervisor.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Get authorization server from cache.
Parameters
pds_host- Base URL of the PDS (e.g., "https://bsky.social")
Returns
{:ok, authorization_server}- Successfully retrieved from cache{:error, :not_found}- Not present in cache
@spec get_authorization_server_metadata(String.t()) :: {:ok, Atex.OAuth.authorization_metadata()} | {:error, :not_found}
Get authorization server metadata from cache.
Parameters
issuer- Authorization server issuer URL
Returns
{:ok, metadata}- Successfully retrieved from cache{:error, :not_found}- Not present in cache
Store authorization server in cache.
Parameters
pds_host- Base URL of the PDSauthorization_server- Authorization server URL to cache
Returns
:ok
@spec set_authorization_server_metadata( String.t(), Atex.OAuth.authorization_metadata() ) :: :ok
Store authorization server metadata in cache.
Parameters
issuer- Authorization server issuer URLmetadata- Authorization server metadata to cache
Returns
:ok
Starts the OAuth cache supervisor.