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§
- authenticate
- Performs the GitHub OAuth device flow authentication.
- create_
client - Creates an authenticated Octocrab client using the token priority chain.
- create_
client_ with_ token - Creates an authenticated Octocrab client using a provided token.
- delete_
token - Deletes the stored GitHub token from the keyring.
- get_
stored_ token - Retrieves the stored GitHub token from the keyring.
- has_
keyring_ token - Checks if a GitHub token is stored in the keyring specifically.
- is_
authenticated - Checks if a GitHub token is available from any source.
- resolve_
token - Resolves a GitHub token using the priority chain.
- store_
token - Stores a GitHub token in the system keyring.