justinpakzad commented on code in PR #65703:
URL: https://github.com/apache/airflow/pull/65703#discussion_r3150414602
##########
providers/amazon/src/airflow/providers/amazon/aws/secrets/secrets_manager.py:
##########
@@ -316,3 +302,32 @@ def _get_secret(
exc_info=True,
)
return None
+
+ def _get_secret(
+ self, path_prefix, secret_id: str, lookup_pattern: str | None,
team_name: str | None = None
+ ) -> str | None:
+ """
+ Get secret value from Secrets Manager.
+
+ :param path_prefix: Prefix for the Path to get Secret
+ :param secret_id: Secret Key
+ :param lookup_pattern: If provided, `secret_id` must match this
pattern to look up the secret in
+ Secrets Manager
+ :param team_name: Team name associated to the task trying to access
the variable (if any)
+ """
+ if lookup_pattern and not re.match(lookup_pattern, secret_id,
re.IGNORECASE):
+ return None
+ if team_name is None and re.fullmatch(r"[^-]+--.+", secret_id):
+ return None
Review Comment:
Good shout. It is explicitly mentioned in the docs that the pattern is
reserved for team-scoped look ups but maybe logging a warning might be useful?
Happy to add that in.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]