vatsrahul1001 commented on code in PR #45609:
URL: https://github.com/apache/airflow/pull/45609#discussion_r1923130347
##########
airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -329,7 +329,11 @@ def get_dag_runs(
),
)
def trigger_dag_run(
- dag_id, body: TriggerDAGRunPostBody, request: Request, session: SessionDep
+ dag_id,
+ body: TriggerDAGRunPostBody,
+ request: Request,
+ session: SessionDep,
+ _: None = Depends(action_logging("trigger_dag_run")),
Review Comment:
Done
##########
airflow/api_fastapi/core_api/security.py:
##########
@@ -53,6 +53,18 @@ def get_user(token_str: Annotated[str,
Depends(oauth2_scheme)]) -> BaseUser:
raise HTTPException(403, "Forbidden")
+async def get_user_with_exception_handling(request: Request) -> BaseUser |
None:
+ # Currently UI does not support JWT token this method handles if no token
is provided by UI
+ # we can remove this method after issue
https://github.com/apache/airflow/issues/44884 is dome
+ try:
+ token_str = await oauth2_scheme(request)
+ if not token_str: # Handle None or empty token
+ return None
+ return get_user(token_str)
+ except HTTPException:
Review Comment:
Done
--
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]