Module auth

Module auth 

Source
Expand description

GitHub OAuth device flow authentication.

Implements the OAuth device flow for CLI authentication:

  1. Request device code from GitHub
  2. Display verification URL and user code to user
  3. Poll for access token after user authorizes
  4. Store token securely in system keychain

Also provides a token resolution priority chain:

  1. Environment variable (GH_TOKEN or GITHUB_TOKEN)
  2. GitHub CLI (gh auth token)
  3. System keyring (native aptu auth)

Enums§

TokenSource
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.