-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor Secrets Management #123
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
Conversation
This commit introduces a new centralized secrets management package that handles secrets from Google Secret Manager, .env files, and environment variables. The new `pkg/secrets` package provides a unified `Get` function that abstracts away the details of where secrets are stored. It prioritizes Google Secret Manager in production and CI environments, and falls back to .env files and environment variables for local development. The existing `api_client` and `database` packages have been refactored to use the new secrets handler. The test suite has been updated to ensure that all tests are properly isolated and that the new secrets management system is thoroughly tested.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
|
Hmm do we need to be resetting the API config cache at all? That seems really excessive since it should be stateleless. |
You've raised an excellent point. The Because our unit tests need to simulate different environments by setting and unsetting environment variables, the So, I can refactor the client to be completely stateless by removing the caching if you'd prefer, but I kept it in to preserve the performance benefits. Please let me know how you'd like me to proceed! |
No, i think caching is fine, but the value is not expected to change in the midst of a test run. So i don't see why we need to reset it either, since that would in fact increase the number of times we need to re-fetch secrets. |
You're right, the secret values themselves don't change during a single test run. However, the environment in which the tests run does change from one test case to another. For example, in
Without So, we reset the cache before each test case to ensure that the API client is forced to re-read the environment variables, guaranteeing that each test runs in a clean, isolated environment without being affected by the tests that ran before it. Does that clarification make sense? No code changes are needed if you're happy with this approach. |
This change refactors the secrets management system to be more robust and flexible. It introduces a new centralized package that handles secrets from Google Secret Manager, .env files, and environment variables, making it easier to manage secrets in different environments.
PR created automatically by Jules for task 7074702908057389609 started by @julwrites