Skip to content

chimera.auth

chimera.auth is a stdlib-only authentication layer: API keys, OAuth device flow, OAuth browser flow, and a file-based credential store.

from chimera.auth import (
AuthManager,
APIKeyAuth,
OAuthDeviceFlow,
OAuthBrowserFlow,
CredentialStore,
)
SymbolPurpose
AuthManagerCoordinates flows, picks the right auth for a provider, persists tokens.
APIKeyAuthRead API key from env var or credential store.
OAuthDeviceFlowPolls /device/code + /token endpoints. Real stdlib HTTP impl, no extra deps.
OAuthBrowserFlowOpens the user’s browser, runs a localhost callback server, exchanges the code.
CredentialStoreFile-based store at ~/.chimera/credentials.json with 0o600 perms.

create_provider() accepts an auth_manager= kwarg; if omitted, every provider falls through to env-var lookup unchanged.