You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/06/10 15:12:28 UTC

[GitHub] [airflow] yupbank opened a new issue #16373: Pass triggering user information to DAG

yupbank opened a new issue #16373:
URL: https://github.com/apache/airflow/issues/16373


   <!--
   
   Welcome to Apache Airflow!  For a smooth issue process, try to answer the following questions.
   Don't worry if they're not all applicable; just try to include what you can :-)
   
   If you need to include code snippets or logs, please put them in fenced code
   blocks.  If they're super-long, please use the details tag like
   <details><summary>super-long log</summary> lots of stuff </details>
   
   Please delete these comment blocks before submitting the issue.
   
   -->
   
   **Description**
   
   It would be very useful if we can pass triggering user information to DAG. So that we can bring over the info to the downstream system for security auditing purpose 
   **Use case / motivation**
   
   <!-- What do you want to happen?
   
   Rather than telling us how you might implement this solution, try to take a
   step back and describe what you are trying to achieve.
   
   -->
   Expose some macro in the DAG, so user can use the trigger user info at will
   
   **Are you willing to submit a PR?**
   
   If someone can point me in the right direction 
   **Related Issues**
   
   No


-- 
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:
users@infra.apache.org



[GitHub] [airflow] santosh-d3vpl3x commented on issue #16373: Pass triggering user information to DAG

Posted by GitBox <gi...@apache.org>.
santosh-d3vpl3x commented on issue #16373:
URL: https://github.com/apache/airflow/issues/16373#issuecomment-859595983


   `airflow.models.log.Log` should already contain the information about trigger. Here the owner field indicates user performing actions.
   
   You can listen on `after_insert` in sql alchemy to route this info via a simple airflow plugin.


-- 
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:
users@infra.apache.org



[GitHub] [airflow] eladkal commented on issue #16373: Pass triggering user information to DAG

Posted by GitBox <gi...@apache.org>.
eladkal commented on issue #16373:
URL: https://github.com/apache/airflow/issues/16373#issuecomment-858742689


   In manual jobs there is a specific user who triggered it - that doesn't exist for scheduled jobs.
   What value are you expecting to have for scheduled jobs?
   


-- 
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:
users@infra.apache.org



[GitHub] [airflow] yupbank edited a comment on issue #16373: Pass triggering user information to DAG

Posted by GitBox <gi...@apache.org>.
yupbank edited a comment on issue #16373:
URL: https://github.com/apache/airflow/issues/16373#issuecomment-859595350


   maybe let me re-state the feature: allow the user to customize the default `DAG.default_conf` in the web console? 


-- 
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:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on issue #16373: Pass triggering user information to DAG

Posted by GitBox <gi...@apache.org>.
uranusjr commented on issue #16373:
URL: https://github.com/apache/airflow/issues/16373#issuecomment-859552227


   Not commenting on whether this is a good idea or not, IMO a scheduled job could be categorised under either the DAG owner (since they scheduled the DAG) or `None`.


-- 
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:
users@infra.apache.org



[GitHub] [airflow] yupbank commented on issue #16373: Pass triggering user information to DAG

Posted by GitBox <gi...@apache.org>.
yupbank commented on issue #16373:
URL: https://github.com/apache/airflow/issues/16373#issuecomment-858760350


   e.g., i could define a BashOperator that login to a web server, in which all the credentials are managed by connections for sure. but it would also be nice to tell the web server that who triggered the job manually if that happened 


-- 
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:
users@infra.apache.org



[GitHub] [airflow] yupbank commented on issue #16373: Pass triggering user information to DAG

Posted by GitBox <gi...@apache.org>.
yupbank commented on issue #16373:
URL: https://github.com/apache/airflow/issues/16373#issuecomment-858756411


   I'm looking for the manual jobs actually, currently, we can pass the info through the `dag_run.conf` in `cli` use case. 
   but the web UI `dag_run.conf` is a bit complicated. I'm wondering if it makes sense to add some `current_user` field in the default conf https://github.com/apache/airflow/blob/main/airflow/www/views.py#L1490 here
   something like `default_conf=json.dumps(dict(current_user=current_user.user.username))` 
   
   it would be amazing if a default default_conf can be configured for all CLI and web UI submissions. Since airflow would perform checks on the triggering user anyway. why not pass it in to the DAG so default_conf actually have some default info 


-- 
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:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #16373: Pass triggering user information to DAG

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #16373:
URL: https://github.com/apache/airflow/issues/16373#issuecomment-858707731


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
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:
users@infra.apache.org



[GitHub] [airflow] MinusYuan commented on issue #16373: Pass triggering user information to DAG

Posted by GitBox <gi...@apache.org>.
MinusYuan commented on issue #16373:
URL: https://github.com/apache/airflow/issues/16373#issuecomment-979337428


   > In manual jobs there is a specific user who triggered it - that doesn't exist for scheduled jobs. What value are you expecting to have for scheduled jobs?
   
   Hi, I want to ask which variable/what kind of method can I use to get this specific user when manual trigger happens?
   Now, I also need this to know which user trigger.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] yupbank commented on issue #16373: Pass triggering user information to DAG

Posted by GitBox <gi...@apache.org>.
yupbank commented on issue #16373:
URL: https://github.com/apache/airflow/issues/16373#issuecomment-859595350






-- 
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:
users@infra.apache.org