You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "tirkarthi (via GitHub)" <gi...@apache.org> on 2026/02/12 16:37:09 UTC
[I] Make user id visible in UI to make it easier to be used in HITL operator assigned_users [airflow]
tirkarthi opened a new issue, #61817:
URL: https://github.com/apache/airflow/issues/61817
### Description
HITL operator provides an option where `assigned_users` could be set and only the users selected can update the HITL action. The assigned_users should be a list of id and name. The username is visible in sidebar but in the auth manager it just looks for the current_user.id to be one of `id` values in assigned users. Since `id` is not visible in the UI and it's mandatory in the datamodel it becomes harder for the users to use this feature.
The `http://localhost:8000/ui/auth/me` endpoints the id info in the response `{"id":"1","username":"admin"}`. This can be displayed along with the signed in username in the sidebar. This can help user in letting others know their id to be used in the dags. A workaround would be fetching id stored in jwt token but it would involve user copying the token and decrypting it which is not user friendly.
```python
from __future__ import annotations
import pendulum
from airflow.providers.standard.operators.hitl import (
HITLOperator,
)
from airflow.sdk import DAG
with DAG(
dag_id="example_hitl_operator_with_assignee",
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
catchup=False,
tags=["example", "HITL"],
):
wait_for_default_option = HITLOperator(
task_id="wait_for_default_option",
subject="Please choose option to proceed: ",
options=["option 7", "option 8", "option 9"],
defaults=["option 7"],
assigned_users=[{"id": "1", "name": "airflow"}, {"id": "admin", "name": "admin"}],
)
```
### Use case/motivation
user.id being visible in the UI helps in using the id value in assigned_users.
### Related issues
_No response_
### Are you willing to submit a PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Make user id visible in UI to make it easier to be used in HITL operator assigned_users [airflow]
Posted by "guan404ming (via GitHub)" <gi...@apache.org>.
guan404ming closed issue #61817: Make user id visible in UI to make it easier to be used in HITL operator assigned_users
URL: https://github.com/apache/airflow/issues/61817
--
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
Re: [I] Make user id visible in UI to make it easier to be used in HITL operator assigned_users [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on issue #61817:
URL: https://github.com/apache/airflow/issues/61817#issuecomment-3908558010
Good idea.
--
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
Re: [I] Make user id visible in UI to make it easier to be used in HITL operator assigned_users [airflow]
Posted by "tirkarthi (via GitHub)" <gi...@apache.org>.
tirkarthi commented on issue #61817:
URL: https://github.com/apache/airflow/issues/61817#issuecomment-3892022217
Something like below where id is 1 and displayed in the UI with username of the format `{user.id} - {user.username}`
<img width="460" height="354" alt="Image" src="https://github.com/user-attachments/assets/2977e95e-1ca1-433f-8cac-4356549d69fa" />
cc: @Lee-W @bbovenzi @pierrejeambrun for thoughts.
--
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