Expand description
Authentication storage for API keys, OAuth tokens, and session tokens.
§Storage model (F-1, code audit 2026-07-25)
Credentials are stored as a plaintext JSON file at ~/.oxicode/auth.json
with Unix 0600 permissions — not encrypted at rest. This matches
the convention used by aws-cli, gh, kubectl, and npm, all of
which store secrets as mode-0600 plaintext on the local disk.
Secret fields are masked in std::fmt::Debug output (see the manual
Debug impl on AuthCredential) so tracing::debug!/dbg!/panic
backtraces never echo raw keys. An OS-keyring backend is the planned
hardening upgrade; the #[cfg(feature = "keyring")] helpers below are
its scaffolding.
Modules§
- keyring_
support Deprecated - OS-keyring credential helpers. Currently stubbed because the
keyringcargo feature is not enabled (see F-4 audit note above).
Structs§
- Auth
Status - Authentication status
- Auth
Storage - Main auth storage struct.
- EnvVar
Fallback Resolver - Environment variable fallback resolver.
- File
Auth Storage - File-based auth storage backend
- FnFallback
Resolver - A simple closure-based fallback resolver
- Memory
Auth Storage - Memory-based auth storage (for testing)
Enums§
- Auth
Credential - Authentication credential
- Auth
Error - Authentication errors
- Credential
Validation Error - Credential validation error
Traits§
- Auth
Storage Backend - Storage backend trait
- Fallback
Resolver - Trait for fallback API key resolution (e.g., from models.json config)
Functions§
- shared_
auth_ storage - Get a shared singleton
Arc<AuthStorage>instance.
Type Aliases§
- Auth
Result - Result of an auth operation