Skip to main content

Module auth

Module auth 

Source
Expand description

Authentication storage and API key resolution.

Auth file: ~/.pi/agent/auth.json

Structs§

AuthFile
AuthStorage
Auth storage wrapper with file locking.
CopilotOAuthConfig
OAuth settings for GitHub Copilot.
DeviceCodeResponse
Response from the device authorization endpoint (RFC 8628 section 3.2).
GitLabOAuthConfig
OAuth settings for GitLab.
OAuthStartInfo
SapResolvedCredentials
Resolved SAP AI Core credentials ready for client-credentials token exchange.

Enums§

AuthCredential
Credentials stored in auth.json.
AwsResolvedCredentials
Resolved AWS credentials ready for Sigv4 signing or bearer auth.
CredentialStatus
Canonical credential status for a provider in auth.json.
DeviceFlowPollResult
Result of polling the device flow token endpoint.

Functions§

complete_anthropic_oauth
Complete Anthropic OAuth by exchanging an authorization code for access/refresh tokens.
complete_copilot_browser_oauth
Complete the GitHub Copilot browser OAuth flow by exchanging the authorization code.
complete_extension_oauth
Complete OAuth for an extension-registered provider by exchanging an authorization code.
complete_gitlab_oauth
Complete GitLab OAuth by exchanging the authorization code for tokens.
complete_google_antigravity_oauth
Complete Google Antigravity OAuth by exchanging an authorization code for tokens.
complete_google_gemini_cli_oauth
Complete Google Gemini CLI OAuth by exchanging an authorization code for tokens.
complete_openai_codex_oauth
Complete OpenAI Codex OAuth by exchanging an authorization code for access/refresh tokens.
exchange_sap_access_token
Exchange SAP AI Core service-key credentials for an access token.
external_setup_source
Return a stable human-readable label when we can auto-detect local credentials from another coding agent installation.
load_default_auth
Convenience to load auth from default path.
poll_copilot_device_flow
Poll the GitHub device flow token endpoint.
poll_kimi_code_device_flow
Poll Kimi Code OAuth device flow.
resolve_aws_credentials
Resolve AWS credentials following the standard precedence chain.
resolve_sap_credentials
Resolve SAP AI Core credentials from env vars or stored service key.
start_anthropic_oauth
Start Anthropic OAuth by generating an authorization URL and PKCE verifier.
start_copilot_browser_oauth
Start GitHub Copilot OAuth using the browser-based authorization code flow.
start_copilot_device_flow
Start the GitHub device flow (RFC 8628) for Copilot.
start_extension_oauth
Start OAuth for an extension-registered provider using its OAuthConfig.
start_gitlab_oauth
Start GitLab OAuth using the authorization code flow with PKCE.
start_google_antigravity_oauth
Start Google Antigravity OAuth by generating an authorization URL and PKCE verifier.
start_google_gemini_cli_oauth
Start Google Gemini CLI OAuth by generating an authorization URL and PKCE verifier.
start_kimi_code_device_flow
Start Kimi Code OAuth device flow.
start_openai_codex_oauth
Start OpenAI Codex OAuth by generating an authorization URL and PKCE verifier.