-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Add regional support for google secret manager hook #52124
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 regional support for google secret manager hook #52124
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
providers/google/src/airflow/providers/google/cloud/hooks/secret_manager.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Could I ask you to provide a screenshot of this regional secret created successfully on Google Cloud?
providers/google/src/airflow/providers/google/cloud/hooks/secret_manager.py
Outdated
Show resolved
Hide resolved
I have removed the comment as suggested. I have attached snippet that I used for testing and screen shot from google secret manager. Regional secret testcasesI have created regional secret with this below code in dag file.
Created regional secret version
Listing regional secrets
Checking regional secret exists
Accessing regional secret
I deleted the created regional secret with this below code
Normal secret testcasesI created normal secrets via this below code
Create normal secret version
Listing normal secrets
Checking normal secret exists
Access normal secret
Delete normal secret
|
df4f10c
to
ecebf7c
Compare
static checks failing |
ecebf7c
to
ff82321
Compare
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Added support for regional secrets in google secret manager
Google secret provider was lacking support for storing regional secrets which was supported by Google Cloud Secrets, changes were made to add this functionality.
Changes :
location_id
optional property.client
getter to initializeSecretManagerServiceClient
based on whetherlocation_id
is provided or not._get_parent
,_get_secret_path
and_get_secret_version_path
as helper methods to build the path with or withoutlocation_id
based on parameters.location_id
parameter to methodscreate_secret
,add_secret_version
,list_secrets
,secret_exists
,access_secret
anddelete_secret
for handling regional secrets.closes: #49709
This is my first commit, so I am unsure if my approaches for the changes are correct. So, I haven't changes the tests completely. Please review my approach once, and I will make required changes to the provider and tests.