Skip to main content

Module flows

Module flows 

Source
Expand description

Protocol pieces behind the client: the device flow poll loop (RFC 8628), token exchange constants (RFC 8693) and the pushed authorization request body and answer (RFC 9126).

Nothing here puts a secret in an error: a device code, a token or a pushed request body is never echoed, and a malformed answer is reported by its kind only.

Structs§

CancelToken
Stops a device flow: clone it, hand one copy to the poll and call cancel on the other.
DeviceAuthorization
The answer to a device authorization request: show user_code and verification_uri to the person.
DevicePollOptions
Test hooks and cancellation for the device poll.
PushedAuthorization
The answer to a pushed authorization request.

Constants§

DEFAULT_DEVICE_INTERVAL_SECONDS
DEVICE_CODE_GRANT
SLOW_DOWN_STEP_SECONDS
TOKEN_EXCHANGE_GRANT
TOKEN_TYPE_ACCESS_TOKEN
The only token type the service exchanges (subject_token_type, actor_token_type and requested_token_type).

Functions§

build_authorization_url_from_request_uri
The authorize URL for a pushed request: only client_id and request_uri (RFC 9126 section 4).
parse_device_authorization
Validate the service’s device authorization answer; the error never echoes it.
parse_pushed_authorization
poll_for_device_token
Poll until the person decides (RFC 8628 section 3.5).
pushed_request_params
The authorize parameters of a pushed request, in order. client_id is set again by client authentication.

Type Aliases§

ClockFn
A monotonic clock: time since any fixed origin. Replace it in tests.
SleepFn
Waits for a duration. Replace it in tests so no real time passes.