Releases: vihaan-g/AuthLM
Releases · vihaan-g/AuthLM
Release list
v0.1.0
Added
authlm doctorcommand for diagnosing Python environment, store selection, metadata file permissions, and credential fingerprint integrity.authlm listnow supports--jsonand--format jsonflags to output credentials in structured JSON format.authlm.apinow re-exportsvalidate.authlm envPOSIX shell output format (_format_shell) now includes theexportkeyword (e.g.export OPENAI_API_KEY='...').validate()now accepts an optionalmetadata_storeparameter and persistslast_validated_atupon a successful probe.authlm connect google --method oauth_browsernow prints a pre-flight warning
when the default Google OAuth client ID is in use, explaining that Google
requires a user-created Cloud project with the Generative Language API enabled
and thegenerative-language.retrieverscope registered. Points to
AUTHLM_GOOGLE_CLIENT_IDand Google's OAuth quickstart docs.OAuthConfignow exposesdevice_code_content_type(default
application/x-www-form-urlencoded, set toapplication/jsonfor OpenAI)
to support providers that expect JSON device-code requests.is_default_client_id(provider_id, client_id)helper in_auth_table
returns whether a client ID matches the hardcoded default for a provider.- Project scaffolding:
pyproject.tomlwith hatchling build, ruff, mypy (strict),
and pytest configuration. authlmpackage skeleton withpy.typedmarker and dynamic version sourced from
src/authlm/_version.py.- Core exception hierarchy in
authlm.errors(AuthLMErrorand seven subclasses). - Core credential types in
authlm.credentials(Pydantic models:ApiKeyCredential,
OAuthCredential) with a discriminatedCredentialUnionover the v0.1.0 types. parse_credential()deserialization helper inauthlm.credentials(uses the
discriminated union to restore the correct subclass from JSON).compute_fingerprint(secret)inauthlm.credentialsreturning a truncated
SHA-256 digest for non-secret change detection.
(Additional typesAwsCredentialandAzureAdCredentialare defined in the spec
for v0.2.0 but are not implemented in this release.)- Test infrastructure:
tests/conftest.pywith environment isolation fixtures and a
smoke test. MemoryStoreinauthlm.stores.memory_store: in-process credential store for
tests, cleared on process exit.EnvStoreinauthlm.stores.env_store: read-only store that reads API keys
from environment variables (module-level_ENV_VAR_MAPcovers v0.1.0
providers:openai,anthropic,google,openrouter).KeyringStoreinauthlm.stores.keyring_store: OS keychain-backed credential store
via thekeyringlibrary, with a JSON index file for enumeration (keyring has no
enumeration API).EncryptedFileStoreinauthlm.stores.encrypted_file_store: Fernet-encrypted
credential file store, with PBKDF2-HMAC key derivation from a passphrase.get_default_storeinauthlm.stores: auto-selects aCredentialStorefrom the
AUTHLM_STOREenv var (one ofkeyring,encrypted_file,env,memory),
otherwise picksKeyringStorewhen a real keyring backend is available, and
falls back toEnvStorewith a warning when no keyring is present. Honors the
AUTHLM_USER_PATHenv var for the keyring index and encrypted file locations.ProviderandConnectionMethodProtocols inauthlm.providers.base, plus the
OAuthGrantStrEnumenumerating supported OAuth flow types
(authorization_code_pkce,device_code). Both Protocols are
@runtime_checkableforisinstance()tests; no implementations are included
in v0.1.0 yet.authlm._auth_tablewith v0.1.0 provider auth metadata:OAuthConfigand
AuthTableEntryPydantic models, anAUTH_TABLEcoveringopenai,
anthropic,google, andopenrouter(with public OAuth client IDs and
PKCE/device endpoints for the three OAuth-capable providers), and
get_auth_entry/get_oauth_configlookups. Client IDs are overridable
per provider viaAUTHLM_{OPENAI,ANTHROPIC,GOOGLE}_CLIENT_IDenv vars.authlm.validation.validate()async probe that GETs each provider's
validation_urlfrom_auth_table(OpenAI/v1/models, Anthropic
/v1/modelswithx-api-key+anthropic-versionheaders, etc.) and
returnsTrueon 2xx,Falseon 401/404, raisesAccessDeniedon 403
entitlement denial, andTokenEndpointErroron other 4xx. Refuses warned
subscription methods (claude_pro_oauth_browser,
claude_pro_oauth_device) unlessforce=Trueis passed, and is
no-op-detectable for providers without avalidation_url.- Connection methods:
APIKeyMethod,OAuthPKCEMethod(with loopback HTTP
server),OAuthDeviceCodeMethod(with polling). All implement the
ConnectionMethodProtocol. - 4 built-in providers:
OpenAIProvider,AnthropicProvider(with
warned Claude Pro browser/headless methods),
GoogleProvider,OpenRouterProvider. providers.registrywithlist_providers,get_provider,get_method.- Public async API in
authlm.api:get_credential,
get_valid_credential,refresh(handles refresh-token rotation
and classifies errors per spec §5.3),should_refresh,connect
(orchestrates method + store + metadata), andvalidate. - 5-command CLI in
authlm.cli(Click group, entry pointauthlm.cli:cli):
connect(interactive method picker with[y/N]warning confirmation for
warned methods, refuses non-TTY without--method),list(ASCII table of
stored credentials with backend and last-validated columns),status
(per-credential metadata block;--validateprobes the credential,--force
allows probing warned methods,--alliterates aliases),disconnect
(confirmation prompt;--yesto skip),env(exports credential as shell
env vars inshell/docker/githubformats;eval "$(authlm env openai)"
for shell). The CLI is a thin sync wrapper: each command bridges to the
asyncauthlm.apifunctions viaasyncio.run()per spec §2.3. - Per-subcommand
--storeoption mirrors theAUTHLM_STOREenv
var (one ofkeyring,encrypted_file,env,memory);--metadata-path
mirrorsAUTHLM_METADATA_PATH. Tests use--store=memoryfor isolation;
users can use it to override the store on a per-invocation basis. The
options live on each subcommand rather than the group, to avoid Click
option-precedence ambiguity. authlm.api.connect()now accepts optionalon_promptandopen_browser
keyword-only parameters. When passed, they are propagated to the
OAuthDeviceCodeMethod/OAuthPKCEMethodvia newwith_on_prompt()and
with_open_browser()methods (mirroring the existing
APIKeyMethod.with_secret_prompt()). Backward compatible: existing
callers that omit these params see no change.authlm.cliis a subpackage (mirrorsconnection_methods/and
providers/);authlm.cli._contextprovidesget_metadata_path()
(metadata path resolution with chain: explicit →AUTHLM_METADATA_PATH
→AUTHLM_USER_PATH→get_user_data_path());authlm.cli._formatters
providesformat_list_table()andformat_status_table().- Dependabot bumps:
anthropic0.112.0 → 0.113.0 (PR #6),astral-sh/setup-uv
SHA pin updated (PR #5).
Changed
OAuthPKCEMethodandOAuthDeviceCodeMethodnow log initial prompt/browser URLs atDEBUGlevel instead ofINFO.- README now documents that OpenAI OAuth methods produce Codex-scoped tokens targeting
the Codex backend, not the standard OpenAI API. - Expanded README with status/build/license badges, a "Why AuthLM?" motivation
section, a feature comparison table (vsllm keys, LiteLLM, provider SDKs),
installation instructions (from source, since not yet on PyPI), CLI usage
examples, a credential-stores reference table, and a security section
linking to SECURITY.md. Corrected the brokenuv sync --extra test --all-extrasdev command touv sync --all-extras. connect(CLI) refuses to run with no--methodon a non-TTY stdin and
prints a clear error message; this avoids hangs in CI / scripts and matches
the spec's "explicit over implicit" principle.- The CLI sets
logging.getLogger("authlm").setLevel(logging.WARNING)at
startup so INFO-level logs from the OAuth methods (e.g. PKCE "Opening
browser" info) do not polluteeval $(authlm env ...)stdout. The
device-code URL and user code are routed to stderr via a customon_prompt
callback. cligroup now usesinvoke_without_command=Truesoauthlm(no
subcommand) prints help text and exits 0 instead of Click's default
MissingCommand(exit 2). Implemented in commiteab5f1f.- Updated v0.1.0 design spec (
.agents/specs/v0.1.0-authlm.md) to reflect
v0.1.0 reality: plugin system and models.dev integration removed from
v0.1.0 scope (deferred to v0.2.0),authlm status --backendand
authlm.set_store()added to v0.1.0 scope,compute_fingerprintwired
intoMetadataEntryfor change detection,Field(repr=False)on all
secret fields,ProviderNotAvailable/AliasCollisionErrordeferred to
v0.2.0,ConnectionMethod.validate()removed from Protocol (validation
goes throughvalidation.validate()directly), roadmap replaced with
4-version plan (v0.2.0 → v1.0.0). - Created version spec outlines:
.agents/specs/v0.2.0-authlm.md
(Extensibility & Ecosystem),.agents/specs/v0.3.0-authlm.md
(Robustness & More Stores),.agents/specs/v1.0.0-authlm.md
(Stable Release). - Updated
AGENTS.mdto reflect v0.1.0 reality (first-party providers
only, no plugin system,set_store()in stores,--backendin status
command,Field(repr=False)on secrets, version spec references). - Updated
README.mdwith honest v0.1.0 scope, roadmap section, and
removed plugin system / models.dev from the features list.
Fixed
authlm status --validatenow passesmetadata_storetovalidate(), ensuring metadata is...