-
Notifications
You must be signed in to change notification settings - Fork 2
Add Google Cloud Secret Manager and HashiCorp Vault integration #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: roonglit <1104347+roonglit@users.noreply.github.com>
… and Vault Co-authored-by: roonglit <1104347+roonglit@users.noreply.github.com>
Co-authored-by: roonglit <1104347+roonglit@users.noreply.github.com>
Co-authored-by: roonglit <1104347+roonglit@users.noreply.github.com>
|
@copilot I explained to you wrong. We are not reading every key when there is GOOGLE prefix. But if we have a set that we need for accessing Google Secret Manager, we will be using Google Secret Manager for all keys. For example, if google secret manager requires password to access, when there is environment variable GOOGLE_SECRET set, we will be query all value from there. For the value which is not in Google Secret Manager, even we have it set in credentials or environment variable, we will return blank value. Simply speaking, entire set in Google Secret Manager will be override all. But if there is no GOOGLE_SECRET is set, we will read variable base on the current behavior, by reading from credentials file and then allow overriding with environment variable. |
Co-authored-by: roonglit <1104347+roonglit@users.noreply.github.com>
I've fixed the secret manager integration to work correctly based on your feedback. The changes include:
The implementation is now in commit aecaf92 and includes updated tests, documentation, and examples that demonstrate the corrected behavior. |
This PR adds support for Google Cloud Secret Manager and HashiCorp Vault to the credentials library, allowing users to securely store and retrieve sensitive configuration values from external secret management systems.
Features Added
Secret Manager Integration
SecretManagerinterface for future secret management systemsConfiguration Priority System
The library now follows this priority order when loading configuration values:
GOOGLE_DB_PASSWORD), retrieve from secret managerDB_PASSWORD)Usage Examples
Google Cloud Secret Manager
HashiCorp Vault
Application Code
Implementation Details
Key Files Added
pkg/credentials/secret_manager.go- Core interfaces and registrypkg/credentials/google_secret_manager.go- Google Cloud Secret Manager implementationpkg/credentials/vault_secret_manager.go- HashiCorp Vault implementationpkg/credentials/secret_manager_test.go- Comprehensive test suitecmd/example/main.go- Example application demonstrating integrationBackward Compatibility
Dependencies Added
cloud.google.com/go/secretmanager- Google Cloud Secret Manager clientgithub.com/hashicorp/vault/api- HashiCorp Vault clientTesting
Documentation
This implementation provides a secure, scalable way to manage sensitive configuration values while maintaining the simplicity and flexibility of the existing credentials library.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.