TamaOAuth.ClientMetadata (tama_oauth v0.1.0)

Copy Markdown View Source

Validates OAuth Client ID Metadata Documents and returns normalized metadata.

The caller decides which client IDs may be fetched and owns caching and persistence. This module guarantees that successful metadata is bound to the exact client ID URL and contains no symmetric client credentials.

Summary

Types

t()

@type t() :: %TamaOAuth.ClientMetadata{
  cache_ttl: term(),
  client_id: term(),
  client_name: term(),
  client_uri: term(),
  grant_types: term(),
  jwks_uri: term(),
  metadata_digest: term(),
  redirect_uris: term(),
  registration_type: term(),
  response_types: term(),
  token_endpoint_auth_methods_supported: term(),
  token_endpoint_auth_signing_algorithms: term(),
  validated_url: term(),
  verified_client_metadata?: term()
}

Functions

fetch(client_id, opts \\ [])

@spec fetch(
  String.t(),
  keyword()
) :: {:ok, t()} | {:error, atom()}

redirect_allowed?(redirect_uri, uris)

@spec redirect_allowed?(String.t(), t() | [String.t()]) :: boolean()

valid_client_id_url?(client_id, opts \\ [])

@spec valid_client_id_url?(
  term(),
  keyword()
) :: boolean()

validate(document, client_id, opts \\ [])

@spec validate(map(), String.t(), keyword()) :: {:ok, t()} | {:error, atom()}