Skip to main content

Crate codewhale_secrets

Crate codewhale_secrets 

Source
Expand description

Secret storage for CodeWhale API keys.

Provides a small abstraction (KeyringStore) plus a default file-based implementation (FileKeyringStore), an opt-in OS keyring implementation (DefaultKeyringStore), and an in-memory store for tests (InMemoryKeyringStore).

Higher-level lookup through Secrets::resolve checks the secret store first and falls back to environment variables. Config-file precedence lives in the config crate so user-facing commands can keep config -> secret store -> env explicit at the call site.

Structs§

DefaultKeyringStore
OS-native keyring backend.
FileKeyringStore
JSON-on-disk secret store for headless environments.
InMemoryKeyringStore
In-memory keyring store for tests.
Secrets
High-level facade combining a KeyringStore with environment variable fallbacks.

Enums§

SecretSource
Identifies which layer in the resolution chain supplied a secret.
SecretsError
Errors that may arise from a KeyringStore backend.

Constants§

DEFAULT_SERVICE
Default OS keychain service name. Kept as deepseek for compatibility with credentials saved before the CodeWhale rename. macOS users can verify entries with security find-generic-password -s deepseek -a <provider>.
LEGACY_SECRET_BACKEND_ENV
Legacy alias for SECRET_BACKEND_ENV.
SECRET_BACKEND_ENV
Select the secret storage backend. Supported values are file (default) and system/keyring for the OS credential store.

Traits§

KeyringStore
Abstract secret store trait.

Functions§

env_for
Map a canonical provider name to its environment variable(s), returning the first non-empty value found.