llm-orchestrator-secrets
Comprehensive secret management for the LLM Orchestrator, providing secure storage and retrieval of sensitive configuration data.
Features
- Multiple Backends: HashiCorp Vault, AWS Secrets Manager, or environment variables
- Caching: Optional TTL-based in-memory caching to reduce backend calls
- Secret Rotation: Support for rotating secrets without downtime
- Version Management: Access historical versions of secrets (where supported)
- Security: Zero secrets in logs, secure token handling
- Async/Await: Full async support with tokio
- Type Safe: Strongly typed error handling with comprehensive error types
Installation
Add to your Cargo.toml:
[]
= "0.1"
Quick Start
Environment Variables (Development)
use ;
async
HashiCorp Vault
use ;
async
AWS Secrets Manager
use ;
use Region;
async
With Caching
use ;
use Duration;
async
Supported Backends
| Backend | Production Ready | Versioning | Rotation | Caching |
|---|---|---|---|---|
| Environment Variables | Development only | ❌ | ❌ | ✅ |
| HashiCorp Vault | ✅ | ✅ | ✅ | ✅ |
| AWS Secrets Manager | ✅ | ✅ | ✅ | ✅ |
API Overview
SecretStore Trait
All backends implement the SecretStore trait:
Secret Model
Performance
Cache Performance
- Cache hit: < 1ms
- Cache miss (env): ~1ms
- Cache miss (Vault): 50-100ms
- Cache miss (AWS): 50-150ms
Recommended Cache TTL
- Development: 5-10 minutes
- Production: 2-5 minutes for API keys, 1 minute for credentials
Security Best Practices
- Never log secret values
- Use Vault or AWS in production (not environment variables)
- Enable caching cautiously (balance performance vs. freshness)
- Rotate secrets regularly
- Use least-privilege access (IAM roles, Vault policies)
- Monitor secret access (audit logs)
Testing
The crate includes comprehensive unit and integration tests:
Tests cover:
- All secret store implementations
- Cache functionality with TTL
- Secret versioning
- Error handling
- Concurrent access
Examples
See the main documentation for complete examples:
- Environment variable usage
- HashiCorp Vault integration with namespaces
- AWS Secrets Manager with rotation
- Caching strategies
- Integration with LLM providers
Documentation
License
MIT OR Apache-2.0