nhuantho commented on code in PR #59873:
URL: https://github.com/apache/airflow/pull/59873#discussion_r2659214806


##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/connections.py:
##########
@@ -123,6 +123,14 @@ class ConnectionHookMetaData(BaseModel):
     standard_fields: StandardHookFields | None
     extra_fields: Mapping | None
 
+    @field_validator("extra_fields", mode="after")
+    @classmethod
+    def redact_extra_fields(cls, v: Mapping | None):
+        if v is None:
+            return None
+
+        return redact(v)

Review Comment:
   @jason810496, extra_fields is a mapping, I think it will include both 
sensitive fields and normal fields, so I will add a new test with a dict that 
includes sensitive fields and normal fields:
   ```
               (
                   {
                       "secret_key": "test-secret_key",
                       "extra_fields": "test-extra_fields",
                       "password": "test-password",
                   },
                   {"secret_key": "***", "extra_fields": "test-extra_fields", 
"password": "***"},
               )
   ```



-- 
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