Skip to main content

Module auth

Module auth 

Source
Expand description

Bounded browser authentication for the ChatGPT Codex subscription API.

This module deliberately owns only the OAuth and credential-store boundary. It does not decide which provider a session uses.

Structs§

AuthError
AuthStore
A private, symlink-safe JSON credential store.
CodexCredentials
OAuth material persisted by Lucy. The JSON names are intentionally short because this file is user-managed state, while aliases let a future migration read conventional token names.
OAuthEndpoints
PkceChallenge

Constants§

CALLBACK_HOST
CALLBACK_PATH
CALLBACK_PORT
CALLBACK_REDIRECT_HOST
DEFAULT_AUTH_ISSUER
DEFAULT_CLIENT_ID
DEFAULT_TOKEN_ENDPOINT
REFRESH_WINDOW_SECONDS

Functions§

credential_path
Resolve Lucy’s credential path without assuming that either XDG variable is set.
credential_path_from_xdg
generate_pkce
login
Perform the browser authorization-code flow and persist the returned credentials.
login_with_endpoints
refresh_credentials
Refresh a credential set, retaining a rotated refresh token when the authority returns one.