synos-vault-client — Vault client integration
tags: [general]
synos-vault-client — Vault client integration
Section titled “synos-vault-client — Vault client integration”Classification: PUBLIC
Crate: fruit/crates/synos-vault-client/
Milestone: v1+
License: MIT OR Apache-2.0
Version: v111.0.0 “Last Light”
What It Is
Section titled “What It Is”synos-vault-client is a production-ready HashiCorp Vault integration for Syn_OS secret management, providing multiple authentication methods (Token, AppRole, Kubernetes), KV v2 secrets engine support with versioning, dynamic secret generation, automatic token renewal, and secret rotation capabilities. It uses secrecy for in-memory secret protection and zeroize for secure key material cleanup, with a caching layer built on DashMap for high-concurrency read paths.
Architecture
Section titled “Architecture”Modules
Section titled “Modules”| Module | Purpose |
|---|---|
auth | Authentication framework with TokenManager, AuthMethod (Token, AppRole, Kubernetes), and automatic renewal |
secrets | KV v2 secret manager with versioning, metadata, and SecretVersion tracking |
dynamic | Dynamic secret manager for database credentials, AWS keys, and other lease-based secrets |
error | Vault-specific error types (VaultError) with retry-able classification |
http | HTTP transport layer (private) with TLS verification, CA cert support, and request signing |
How It’s Wired
Section titled “How It’s Wired”- Auth methods —
AuthMethodenum supports Token, AppRole, and Kubernetes auth, each gated by a feature flag (auth-token,auth-approle,auth-kubernetes). Default build enables all three. - Secret lifecycle —
SecretManagerwraps KV v2 operations with version awareness;DynamicSecretManagerhandles lease renewal and revocation for time-bound credentials. - Concurrency —
DashMapprovides lock-free read caching for frequently accessed secrets;tokio::RwLockguards mutable Vault client state. - Security primitives —
secrecy::SecretStringprevents accidental secret logging;zeroizeensures key material is scrubbed from stack memory on drop. - TLS —
VaultConfigsupports custom CA certs, client certificates, and optional TLS verification toggle for development environments.
Future Ideas
Section titled “Future Ideas”- Add a
synos-vault-client-transitmodule for Vault Transit Secrets Engine (encryption-as-a-service) integration. - Implement a
synos-vault-client-agentsidecar that caches and renews secrets locally, reducing Vault server round-trips. - Wire
synos-vault-clientintosyn-securityso thatencryptionmodule keys are sourced from Vault with automatic rotation.