JelyFishhhhhh commented on code in PR #73797:
URL: https://github.com/apache/airflow/pull/73797#discussion_r4265839246


##########
airflow-core/tests/unit/always/test_providers_manager.py:
##########
@@ -263,6 +263,42 @@ def test_connection_form_widgets(self, 
yaml_ui_metadata_counts):
             # widgets loaded from YAML metadata only
             assert len(connections_form_widgets) == yaml_widgets
 
+    def test_sensitive_connection_fields_are_redactable(self):
+        """
+        Every connection field a provider declares as sensitive must be in the 
redaction allowlist.
+
+        Providers already state which fields are secret; this asserts 
``DEFAULT_SENSITIVE_FIELDS``
+        never drifts apart from them.
+        """
+        pytest.importorskip("flask_appbuilder", reason="connection form 
widgets need flask_appbuilder")
+
+        from airflow._shared.secrets_masker import DEFAULT_SENSITIVE_FIELDS
+        from airflow._shared.secrets_masker.secrets_masker import SecretsMasker
+
+        # Check the shipped defaults rather than the process-wide masker, whose
+        # sensitive_variables_fields is only populated once settings have been 
configured.
+        masker = SecretsMasker()
+        masker.sensitive_variables_fields = list(DEFAULT_SENSITIVE_FIELDS)
+
+        # "config" is too generic a field name to add to the allowlist; 
apprise's
+        # "config" field is handled separately.

Review Comment:
   Agreed that apprise `config` isn't covered by this PR. That's intentional: 
it's being handled as a separate change, so I've left the wording here as it is 
and will update it if needed once that change is 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]

Reply via email to