Skip to main content

Module normalize

Module normalize 

Source
Expand description

Product-neutral normalization helpers for external authentication settings.

These helpers cover small validation rules that recur in Aster services: provider keys, scopes, claim names, provider URLs, allow-listed email domains, flow tokens, return paths, and hashed login-flow secrets. Product crates still own callback URL construction, local email validation, persisted provider rows, API error codes, and account-linking policy.

Constants§

DEFAULT_EXTERNAL_AUTH_IDENTITY_NAMESPACE_MAX_LEN
Default maximum length for provider identity namespace values such as issuer URLs.
DEFAULT_EXTERNAL_AUTH_URL_MAX_LEN
Default maximum length for external-auth provider URLs.
DEFAULT_SCOPES
Default scopes used when a provider or request does not specify its own scope list.

Functions§

email_domain_allowed
Returns whether an email address is allowed by a stored allow-list JSON string.
normalize_allowed_domains
Normalizes an allow-list of email domains into a stable JSON string.
normalize_flow_token
Normalizes an external-auth flow token supplied by a client.
normalize_icon_url_input
Normalizes an icon URL that may be a root-relative path or HTTPS URL.
normalize_issuer_url_input
Normalizes an issuer URL.
normalize_manual_endpoint_input
Normalizes a manually configured provider endpoint.
normalize_optional_claim
Normalizes an optional provider claim name.
normalize_provider_key
Normalizes an application-owned provider key.
normalize_required_field
Normalizes a required string field with a byte-length limit.
normalize_return_path
Normalizes a post-login return path.
normalize_scopes
Normalizes scopes with Forge’s default openid email profile value.
normalize_scopes_with_default
Normalizes scopes with a caller-provided default.
parse_allowed_domains
Parses a stored allow-list JSON string into domain entries.
state_hash
Hashes an OAuth/OIDC state value before persistence.
token_hash
Hashes an external-auth flow token before persistence.