dkranchii commented on code in PR #70640:
URL: https://github.com/apache/airflow/pull/70640#discussion_r3696447987


##########
shared/secrets_masker/src/airflow_shared/secrets_masker/secrets_masker.py:
##########
@@ -223,8 +223,8 @@ def __init_subclass__(cls, **kwargs):
                 f = cls._redact
 
                 @functools.wraps(f)
-                def _redact(*args, replacement: str = "***", **kwargs):
-                    return f(*args, **kwargs)
+                def _redact(*args, replacement: str = "***", _f=f, **kwargs):

Review Comment:
   @potiuk  Good catch on the signature leak. The bit that pushed it over the 
edge for me was your `**kwargs` collision point - `_redact` recurses through 
arbitrary user data (dicts, lists, tuples, sets), and any of those paths that 
route kwargs through would let a caller sneak `_f` in and substitute a 
different function *inside* the redaction walk. Not a place I want a sharp edge.
   Switched to the factory form you suggested. Kept a short comment at the site 
so the next person doesn't try to "simplify" it back to a default-arg binding.



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