Skip to main content

Module oauth

Module oauth 

Source
Expand description

OAuth device-code broker (RFC-041 Phase 3).

Implements the device-authorization grant (RFC 8628). Per H1, the device_code is a polling bearer secret and never leaves the daemon — the client receives only { handle, user_code, verification_url, expires_in } and polls an opaque handle. The daemon owns the device_code in a transient, auto-expiring in-memory map.

Provider HTTP clients are Rust impls of OAuthProvider (D9): TOML selects which provider + scopes, Rust implements how. The first impl is GitHub. GitHub device-flow tokens do not expire by default, so refresh is a no-op for GitHub — the trait still supports expiring providers.

Structs§

DeviceCode
Device-authorization response from start().
DeviceCodeResponse
What the client receives from /oauth/start (no device_code).
GitHubProvider
GitHub OAuth device-code provider.
OAuthBroker
The OAuth broker. Holds in-flight device-code flows in a transient, auto-expiring map keyed by opaque handles. device_code never leaves here.
PollResponse
What /oauth/poll returns — a simple client-facing status. The token data never leaves the daemon (it’s persisted internally by the broker).

Enums§

PollOutcome
Outcome of polling a provider’s token endpoint.

Traits§

OAuthProvider
A Rust implementation of one OAuth provider’s device-code flow.