#[non_exhaustive]pub enum ProblemKind {
Show 17 variants
MissingRequired,
InvalidUrl,
InsecureHttp,
BlankRequiredScope,
MultiWordScope,
InvalidScopeToken,
EmptyListEntry,
NoRequiredScope,
EmptyScopeClaims,
BadAlgorithm,
NoAlgorithms,
LeewayTooLarge,
TokenAgeOutOfRange,
InvalidRequiredClaim,
EnvLoad,
EnvParse,
Other,
}Expand description
What kind of problem a ConfigProblem is, so a caller can react to it —
or write its own sentence for it — without matching the crate’s prose.
#[non_exhaustive]: a new kind is an additive change, so match with a
wildcard arm. Every problem OAuthConfig::resolve and the
env loader find has a specific kind; Other
is what a problem built from a plain String (an application loader’s own)
gets.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingRequired
A required setting is empty: issuer, resource, or both audience
and audiences.
InvalidUrl
A URL setting (issuer, resource, jwks_uri) failed a check_url
check: not an absolute http(s) URL, a query or fragment in an
identifier (issuer, resource), leading or trailing whitespace, or a
control or non-ASCII character.
InsecureHttp
A plain-http URL on a non-loopback host without
allow_insecure_http.
BlankRequiredScope
required_scope, or an entry of required_scopes, is blank.
MultiWordScope
required_scope, or an entry of required_scopes, holds more than one
scope (whitespace inside it).
InvalidScopeToken
A required or advertised scope is not an RFC 6749 §3.3 scope-token.
EmptyListEntry
A list setting (audiences, scopes_supported, principal_claims,
allowed_client_ids) has a blank entry.
NoRequiredScope
No required scope is configured, require_at_jwt is off and
allow_unscoped_tokens is not set.
EmptyScopeClaims
scope_claims is empty or has a blank entry.
BadAlgorithm
algorithms has an entry that is unknown or refused (HMAC, none).
NoAlgorithms
algorithms is empty.
LeewayTooLarge
leeway_secs is over MAX_LEEWAY_SECS.
TokenAgeOutOfRange
max_token_age_secs is 0 or over MAX_TOKEN_AGE_SECS.
InvalidRequiredClaim
A required_claims entry has a blank name, names a claim this crate
already checks (iss, aud, exp, nbf, iat, cnf), or requires
a value other than a string, number or boolean — or, from the env
loader, the REQUIRED_CLAIMS JSON names one claim twice.
EnvLoad
The env loader could not read a variable or its _FILE (both set, an
unreadable, empty, oversized or not-a-regular file).
EnvParse
The env loader read a value it could not parse (a bool other than
"true"/"false", a non-integer leeway_secs or
max_token_age_secs, a REQUIRED_CLAIMS that is not valid JSON or not
a JSON object).
Other
Anything else, including every problem converted from a String.