-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add support for regional secrets #300
Add support for regional secrets #300
Conversation
Hi @abheda-crest - I think I'd prefer to allow users to override the endpoint instead of all this extra string interpolation. You can try this out with the undocumented environment variable |
If we just override endpoint for regional secrets, it won't work out of the box as resource path for regional secret is in following format I thought it would be better to not hamper current validation logic as including location in validation was becoming quite complex. As Current validation allows shorter resource path (i.e let me know if we can address it any other way. |
I see. Regional secrets embed the resource location inside the resource name. Do I understand that correctly? |
Yes, resource path for regional secret includes location/region in it. Following is format for full resource path for regional secret expected at regional secret endpoint If we allow shorter form as we are doing currently including location, we have following possibilities (for both global and regional secrets) So due to this I think it would be cleaner approach to have separate region input for handling both regional endpoint and resource path, so that validation on resource path can work more effectively. Regional API Document for your Reference: https://cloud.google.com/secret-manager/docs/reference/rest/v1/projects.locations.secrets.versions/access |
Hey @abheda-crest - I pulled your changes into #301 and made some tweaks. I don't want to accept a new input. Instead we can parse the location from the secret reference and then use that to control the endpoint. |
This adds support for regional secrets, but it's intentionally undocumented. It also adds support for universes, which is documented. Closes #300 --------- Co-authored-by: abheda-crest <alfatah.bheda@crestdata.ai>
The additional input for region has been added for fetching the regional secret.
It has been tested to verify the functionality, and the secret should be successfully retrieved for both global and regional. Secrets can be referenced using the following formats:
Note: Whenever the region input field is provided, the secret will reference to the regional secret, else the global secret will be referred.
More information about regional secrets: https://cloud.google.com/secret-manager/regional-secrets/data-residency