Expand description
OAuth Client ID Metadata Documents (draft-ietf-oauth-client-id-metadata-document): a client
whose client_id is an https URL is registered by fetching the JSON document at that URL.
The URL comes from whoever starts an authorization request, so fetching it must not reach internal services: the host must resolve only to public addresses, the connection is pinned to the checked addresses, redirects are not followed and the response size and time are capped.
StructsΒ§
ConstantsΒ§
- CACHE_
LIFETIME π - The registration is re-fetched when the cached copy is older than this.
- FETCH_
TIMEOUT π - MAX_
DOCUMENT_ πBYTES - NEW_
DOCUMENTS_ πPER_ USER_ PER_ HOUR - Per server process; an agent registers one document, so this only bounds abuse.
- REFETCHES_
PER_ πDOCUMENT_ PER_ HOUR - Per server process; a documentβs host is fetched again at most this often, however many authorize requests name it.
- STALE_
CACHE_ πLIFETIME - A cached copy this old is still used when the document cannot be fetched.
StaticsΒ§
- DOCUMENT_
REFETCHES π - NEW_
DOCUMENT_ πFETCHES
FunctionsΒ§
- fetch_
and_ πstore - fetch_
and_ πvalidate - find_
cached_ client - The stored registration for a metadata document
client_id, as last fetched, without fetching;Noneif the document was never fetched. - is_
metadata_ document_ client_ id - Whether the client id names a metadata document rather than a registered client.
- is_
public_ πaddress - is_
public_ πipv4 - is_
public_ πipv6 - resolve_
client - The client registration for a metadata document
client_id, fetched and cached as needed.user_idis the signed-in user the fetch is made for: fetching a document that was never fetched before counts against their hourly quota. - validate_
client_ πid_ url - Checks the
client_idURL as the draft requires: https, a host, a path, no fragment, no credentials and no dot segments. Returns the URL and its host. - validate_
document π - Redirect URIs are left to the databaseβs
is_valid_oauth_uri, the one rule for every client.