Expand description
GitHub OAuth device flow authentication.
Implements the OAuth device flow for CLI authentication:
- Request device code from GitHub
- Display verification URL and user code to user
- Poll for access token after user authorizes
- Store token securely in system keychain
Also provides a token resolution priority chain:
- Environment variable (
GH_TOKENorGITHUB_TOKEN) - GitHub CLI (
gh auth token) - System keyring (native aptu auth)
Enums§
- Token
Source - Source of the GitHub authentication token.
Functions§
- clear_
token_ cache - Clears the session-level token cache.
- create_
client - Creates an authenticated Octocrab client using the token priority chain.
- create_
client_ from_ provider - Creates a GitHub client from a
TokenProvider. - create_
client_ with_ token - Creates an authenticated Octocrab client using a provided token.
- is_
authenticated - Checks if a GitHub token is available from any source.
- resolve_
token - Resolves a GitHub token using the priority chain with session-level caching.