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§

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.