amoghrajesh commented on code in PR #71078:
URL: https://github.com/apache/airflow/pull/71078#discussion_r3713597888
##########
providers/google/src/airflow/providers/google/cloud/secrets/secret_manager.py:
##########
@@ -248,7 +248,12 @@ def _names_a_team_namespace(self, secret_id: str) -> bool:
backend does, is wrong here: the inherited implementation prepends a
separator to an
empty prefix (``'' -> '-smtp_default'``) and normalizes nothing, so
the guard would
both mis-anchor and miss ids whose separator only appears after
normalization.
+
+ Only checked in multi-team mode: ``team_name`` is never non-``None``
otherwise, so no
+ team scoped secret can exist to collide with.
"""
+ if not conf.getboolean("core", "multi_team", fallback=False):
Review Comment:
Thanks, here you go: https://github.com/apache/airflow/pull/71106
##########
providers/microsoft/azure/tests/unit/microsoft/azure/secrets/test_key_vault.py:
##########
@@ -215,6 +224,17 @@ def test_refusing_an_ambiguous_id_is_logged(self,
mock_client, caplog):
assert sum(refused_id in r.getMessage() for r in refusals) == 1
mock_client.get_secret.assert_not_called()
+ @mock.patch(f"{KEY_VAULT_MODULE}.AzureKeyVaultBackend.client")
+ def test_ambiguous_id_resolves_when_multi_team_is_disabled(self,
mock_client):
+ """No team scoped secret can exist without multi-team mode, so there
is no ambiguity
+ to refuse -- an ordinary id containing the separator must resolve
normally."""
+ mock_client.get_secret.return_value = mock.Mock(value="world")
+ backend = AzureKeyVaultBackend()
+
+ assert backend.get_conn_value("prod--my_db") == "world"
Review Comment:
Handled in https://github.com/apache/airflow/pull/71106
##########
providers/amazon/tests/unit/amazon/aws/secrets/test_systems_manager.py:
##########
@@ -116,6 +116,7 @@ def test_get_conn_value_with_team_name(self):
returned_uri = ssm_backend.get_conn_value(conn_id="test_postgres",
team_name="my_team")
assert returned_uri == "postgresql://airflow:airflow@host:5432/airflow"
+ @conf_vars({("core", "multi_team"): "True"})
Review Comment:
Handled in https://github.com/apache/airflow/pull/71106
--
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]