Expand description
Fleet-wide, tenant-agnostic provider API key & config storage.
Stores encrypted-at-rest provider overrides in PostgreSQL (loaded by
ares-store::fleet_provider_secrets), decrypts into an in-memory
Arc<ArcSwap<FleetSecrets>> map for lock-free hot-swap reads.
Encryption: AES-256-GCM (RustCrypto aes-gcm) with a 96-bit nonce from
OsRng per encryption. Master key is SHA-256 of FLEET_SECRETS_KEY env
var, wrapped in Zeroizing so it is zeroed on drop.
If FLEET_SECRETS_KEY is unset the module logs a single warning and
treats all getters as returning None — the service does NOT refuse to
start (OSS deployments without UI never set the master key).
Structs§
- Encrypted
Payload - AES-256-GCM ciphertext with its 96-bit nonce. Stored side-by-side so the loader does not have to track nonces separately.
- Fleet
Secrets - Decrypted, in-memory fleet secrets state. Cheap to clone (it’s an
Arc<ArcSwap<...>>under the hood), so callers can hand the wrapper directly to handlers. - Master
Key - Master-key wrapper that zeroes itself on drop. Cheap to clone via Arc.
- Provider
Override - In-memory decrypted view of a single provider override row.
Enums§
- Fleet
Secrets Error - Fixed-length error type for the fleet-secrets module.
Functions§
- decrypt_
api_ key - Decrypt a previously-encrypted payload back to the plaintext API key.
- encrypt_
api_ key - Encrypt a UTF-8 plaintext API key. Returns the ciphertext + nonce.
- last_
n_ visible - Return the last
nchars of a key, prefixed with…, for safe display. ReturnsNonefor empty input.