Skip to main content

Module auth

Module auth 

Source
Expand description

Auth/BasicAuth/ApiKeyAuth: crate::Request::auth’s shape, resolved to a header or query parameter by crate::Request::resolve_auth.

Also reused verbatim as crate::environment::Environment::auth — an environment-level default applied to a request that sets no auth: of its own — so the validation this module owns (mutual exclusivity, header/query collision) is written here once and called from both crate::Request::validate and crate::environment, never duplicated.

Structs§

ApiKeyAuth
Auth::api_key: a static value sent as either a header or a query parameter.
Auth
crate::Request::auth: exactly one of bearer, basic, api_key or oauth, enforced by Auth::validate_exclusivity.
BasicAuth
Auth::basic’s credentials, base64-encoded as user:pass by crate::Request::resolve_auth.
OAuthAuth
Auth::oauth: acquire a bearer token from an OAuth token endpoint before the request is sent, under one of three grants.

Enums§

ApiKeyLocation
Where ApiKeyAuth places its name/value pair.
OAuthGrantType
OAuthAuth::grant_type: which of the three supported OAuth grants to use. See crate::oauth’s module docs for how authorization_code differs from the other two.