[DEV-140033] Extract function to fetch secrets to prepare for new .env source#51
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors AWS Secrets Manager integration by extracting the secret retrieval logic into a reusable connector module. This prepares the codebase for introducing a new .env source that will also need to fetch secrets from AWS Secrets Manager.
Changes:
- Created a new
aws_sm_connector.gofile containing the extracted AWS Secrets Manager connection and secret retrieval logic - Refactored
secretsmanager.goto use the new connector for recursive secret resolution - Refactored
manifest.goto use the new connector instead of its own worker implementation - Added comprehensive unit tests for the new connector functionality
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 14 comments.
| File | Description |
|---|---|
| pkg/resolvers/aws_sm_connector.go | New connector module providing NewSecretsManager client factory, smWorker for concurrent secret retrieval, and getSecrets function for batch secret fetching |
| pkg/resolvers/aws_sm_connector_test.go | Comprehensive test suite with mocks for testing the connector's worker, concurrency handling, error cases, and configuration |
| pkg/resolvers/secretsmanager.go | Removed duplicate worker code and refactored resolveRecursive to use new connector's NewSecretsManager and getSecrets functions |
| pkg/resolvers/manifest.go | Removed manifestWorker implementation and refactored resolveManifestItems to use new connector, updated function signature to accept source parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@tonitienda-rovtech I've opened a new pull request, #52, to work on those changes. Once the pull request is ready, I'll request review from you. |
Preparing the codebase for the introduction of a new source that will require to fetch secrets from AWS SM.
Changes
Overview
Tests