Skip to main content

Module auth

Module auth 

Source
Expand description

How credentials go on a request. Fizzy takes a bearer token (Authorization: Bearer) for API access tokens, or a session cookie (Cookie: session_token=) for a session signed in through a magic link. There is no OAuth and no refresh: a 401 is final.

Structs§

BearerAuth
Authorization: Bearer <token>, for API access tokens.
CookieAuth
Cookie: session_token=<token>, for a session signed in through a magic link.
NoAuth
No credentials at all, for the calls that come before there are any: creating a session and redeeming its magic link.
StaticTokenProvider
A fixed token, from an environment variable say. It prints as [REDACTED], so a {:?} of the provider — or of anything holding one — cannot put the token in a log.

Constants§

SESSION_COOKIE
The cookie a signed-in session is carried in.

Traits§

AuthStrategy
Puts credentials on a request. BearerAuth and CookieAuth are the two Fizzy takes; anything else can plug in here.
TokenProvider
Supplies the token each request goes out with.