Skip to content
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

Make BaseSecretsBackend.build_path generic #7948

Merged
merged 1 commit into from
Mar 28, 2020

Conversation

kaxil
Copy link
Member

@kaxil kaxil commented Mar 28, 2020

Currently the arguments required for it are connections_prefix and conn_id . Changing this to path_prefix and secret_id allows using that method for retrieving variables too


Issue link: WILL BE INSERTED BY boring-cyborg

Make sure to mark the boxes below before creating PR: [x]


In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.

Currently the arguments required for it are `connections_prefix` and `conn_id` . Changing this to `path_prefix` and `secret_id` allows using that method for retrieving variables too
@kaxil kaxil requested a review from potiuk March 28, 2020 11:11
@boring-cyborg boring-cyborg bot added area:secrets provider:amazon-aws AWS/Amazon - related issues provider:google Google (including GCP) related issues labels Mar 28, 2020
@kaxil kaxil requested a review from ashb March 28, 2020 11:13
@@ -150,7 +150,7 @@ def get_conn_uri(self, conn_id: str) -> Optional[str]:
:param conn_id: connection id
:type conn_id: str
"""
secret_path = self.build_path(connections_prefix=self.connections_path, conn_id=conn_id)
secret_path = self.build_path(self.connections_path, conn_id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
secret_path = self.build_path(self.connections_path, conn_id)
secret_path = "/".join([self.connections_path, conn_id])

Do we need this method at all? This can be expressed with one line of code and will be more generic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a separate method for SecretsBackend Meta class so that each Backend can implement it as they all have a separate and all have a prefix and a path.

@kaxil kaxil merged commit eb4af4f into apache:master Mar 28, 2020
@kaxil kaxil deleted the make-build-path-generic branch March 28, 2020 11:58
@kaxil kaxil added this to the Airflow 1.10.10 milestone Mar 28, 2020
kaxil added a commit that referenced this pull request Mar 28, 2020
Currently the arguments required for it are `connections_prefix` and `conn_id` . Changing this to `path_prefix` and `secret_id` allows using that method for retrieving variables too

(cherry picked from commit eb4af4f)
kaxil added a commit to astronomer/airflow that referenced this pull request Mar 30, 2020
Currently the arguments required for it are `connections_prefix` and `conn_id` . Changing this to `path_prefix` and `secret_id` allows using that method for retrieving variables too

(cherry picked from commit eb4af4f)
kaxil added a commit that referenced this pull request Mar 30, 2020
Currently the arguments required for it are `connections_prefix` and `conn_id` . Changing this to `path_prefix` and `secret_id` allows using that method for retrieving variables too

(cherry picked from commit eb4af4f)
kaxil added a commit that referenced this pull request Apr 1, 2020
Currently the arguments required for it are `connections_prefix` and `conn_id` . Changing this to `path_prefix` and `secret_id` allows using that method for retrieving variables too

(cherry picked from commit eb4af4f)
kaxil added a commit to astronomer/airflow that referenced this pull request Apr 28, 2020
Currently the arguments required for it are `connections_prefix` and `conn_id` . Changing this to `path_prefix` and `secret_id` allows using that method for retrieving variables too

(cherry picked from commit eb4af4f)
(cherry picked from commit ad095b8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:secrets provider:amazon-aws AWS/Amazon - related issues provider:google Google (including GCP) related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants