Skip to content

feat: added regional secret support for secret-manager #3746

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abheda-crest
Copy link
Contributor

Issue: #3331

Description:

Added the support for regional secret creation/updation, deletion and fetch for secret manager service.

  • Updated the autoconfigure/secretmanager to create the regional client and secretmanager module to support the regional secret operation.
  • Added the optional property location in GcpSecretManagerProperties.java which will take region from application.properties file. Whenever the location is available, it will use to perform the operation on regional secret. If not provided the global stack will be served.
  • Updated the documentation for this additional property in the docs/src/main/asciidoc/secretmanager.adoc
  • Added the sample application for regional secret operations.
  • Added/Updated the unit and integration tests.

Note: Fixed the integration test testUpdateSecrets in the file secretmanager/it/SecretManagerTemplateIntegrationTests.java

Performed the below mentioned manual unit tests to validate the working of the global and regional secret operations.

  • Create secret with only secretId and payload
  • Create secret with existing secretId and payload
  • Create secret with secretId, payload and valid projectID
  • Create secret with secretId, payload and invalid projectID (project on which user doesn't have access)
  • Read an existing secret with secretId
  • Read a non-existing secret with secretId
  • Read a secret with secretId and existing version
  • Read a secret with secretId and disabled version
  • Read a secret with secretId and destroyed version
  • Read a secret with secretId and non-existing version
  • Read a secret with secretId and valid project
  • Read a secret with secretId and invalid project (project on which user doesn't have access)
  • Read a secret with secretId and existing version and valid project
  • Read a secret with secretId and existing version and invalid project
  • Read a secret with secretId and non-existing version and valid project
  • Read a secret with secretId and non-existing version and invalid project
  • Update an existing secret with only secretId and payload
  • Update an existing secret with secretId, payload and valid projectID
  • Update an existing secret with secretId, payload and invalid projectID (project on which user doesn't have access)
  • Delete an existing secret with secretId
  • Delete a non-existing secret with secretId
  • Delete a secret with secretId and valid projectId
  • Delete a secret with secretId and invalid projectId
  • Enable an existing secret and valid version
  • Enable an existing secret without version
  • Enable an existing secret and invalid version
  • Enable a non-existing secret
  • Disable an existing secret and valid version
  • Disable an existing secret without version
  • Disable an existing secret and invalid version
  • Disable a non-existing secret
  • Check if secret exists for existing secret
  • Check if secret exists for non-existing secret
  • Check if secret exists for existing secret & valid projectId
  • Check if secret exists for existing secret & invalid projectId
  • Read secret with secretId and other project using service account
  • Inject secret with the @Value annotation

More information about regional secrets: https://cloud.google.com/secret-manager/regional-secrets/data-residency

note: The PR is recreated after resolving the issue of the PR

@abheda-crest
Copy link
Contributor Author

This PR is recreated in place of #3365

@jinseopkim0 jinseopkim0 self-requested a review May 2, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant