feat/secrets #111
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/secrets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request introduces a comprehensive and ergonomic secret management system via a new
harmony-secretcrate.What's Done
New
harmony-secretCrate:SecretManager::get::<MySecret>()andSecretManager::set(&my_secret).#[derive(Secret)]procedural macro that automatically uses the struct's name as the secret key, simplifying usage.async SecretStoretrait to support various backend implementations.Two Secret Store Implementations:
LocalFileSecretStore: A simple file-based store that saves secrets as JSON in the user's data directory. Ideal for local development and testing.InfisicalSecretStore: A production-ready implementation that integrates with Infisical for centralized, secure secret management.Configuration via Environment Variables:
HARMONY_SECRET_STOREenvironment variable (fileorinfisical).HARMONY_SECRET_INFISICAL_*variables.What's Not Done (Future Work)
test_harmony_secret_infisical.shscript serves as a clear example of the required variables.This new secrets module provides a solid and secure foundation for managing credentials for components like OPNsense, Kubernetes, and other infrastructure services going forward. Even with the manual first-time setup for Infisical, this architecture is robust enough to serve our needs for the foreseeable future.
a1e4154da3to9c5d1bd27f9c5d1bd27fto26e8e386b9