AshAuthentication. Oauth2Server. CIMD. Fetcher behaviour
(ash_authentication_oauth2_server v0.3.0)
Copy Markdown
View Source
Behaviour for fetching OAuth Client ID Metadata Documents.
A Client ID Metadata Document (CIMD) client identifies itself with an
HTTPS URL as its client_id; the authorization server fetches the JSON
metadata document from that URL. This behaviour is the extension point
for how that fetch happens — the default implementation is
AshAuthentication.Oauth2Server.CIMD.ReqFetcher, which applies an
SSRF-safe outbound policy.
Swap in your own module via the :cimd_fetcher option on your
Oauth2Server module when you need a different outbound policy (an
egress proxy, an allowlist of client hosts, a stub for tests, etc.).
Summary
Callbacks
Fetch and JSON-decode the metadata document at url.
Types
@type result() :: %{document: map(), cache_ttl: non_neg_integer() | nil}
A successful fetch.
:document— the decoded JSON object (a map with string keys). Validation of its contents happens inAshAuthentication.Oauth2Server.CIMD— the fetcher only guarantees it retrieved and decoded a JSON object.:cache_ttl— seconds the document may be cached for, derived from the response'sCache-Controlheader.nilmeans the response carried no caching directives (the caller applies its default);0means the response asked not to be cached.