yuqian90 commented on a change in pull request #6064: [AIRFLOW-5444] Fix 
action_logging so that request.form for POST is logged
URL: https://github.com/apache/airflow/pull/6064#discussion_r325690143
 
 

 ##########
 File path: airflow/www/decorators.py
 ##########
 @@ -39,17 +39,19 @@ def wrapper(*args, **kwargs):
             else:
                 user = g.user.username
 
+            params = request.form if request.method == 'POST' else request.args
+
             log = Log(
                 event=f.__name__,
                 task_instance=None,
                 owner=user,
-                extra=str(list(request.args.items())),
-                task_id=request.args.get('task_id'),
-                dag_id=request.args.get('dag_id'))
+                extra=str(list(params.items())),
 
 Review comment:
   Thanks for the suggestion. I updated the code.
   
   Regarding your other concern: `this will capture passwords and other 
sensitive info`
   I don't have a great way of addressing that. So I did this unscientific 
search in the code base. @action_logging decorator is not used on the 
ConnectionModelView. So sensitive things put in the form is not logged.
   
   `$ grep -A5 action_logging airflow/www/views.py`
   
   I also started a test server and entered some info in ConnectionModelView 
and checked nothing is logged. 
   That said, pls do let me know if you have better ways to address or verify 
this.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to