This is an automated email from the ASF dual-hosted git repository.
gopidesu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 3a40a9420fe Fix JWTBearerTIPathDep import errors in HITL routes
(#63277)
3a40a9420fe is described below
commit 3a40a9420fe215e8d86e1f4291f199b6f2666092
Author: GPK <[email protected]>
AuthorDate: Tue Mar 10 15:59:49 2026 +0000
Fix JWTBearerTIPathDep import errors in HITL routes (#63277)
---
.../src/airflow/api_fastapi/execution_api/routes/hitl.py | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/airflow-core/src/airflow/api_fastapi/execution_api/routes/hitl.py
b/airflow-core/src/airflow/api_fastapi/execution_api/routes/hitl.py
index 92e973a3d00..802b09502e0 100644
--- a/airflow-core/src/airflow/api_fastapi/execution_api/routes/hitl.py
+++ b/airflow-core/src/airflow/api_fastapi/execution_api/routes/hitl.py
@@ -19,7 +19,8 @@ from __future__ import annotations
from uuid import UUID
import structlog
-from fastapi import APIRouter, HTTPException, status
+from cadwyn import VersionedAPIRouter
+from fastapi import HTTPException, Security, status
from sqlalchemy import select
from airflow._shared.timezones import timezone
@@ -29,14 +30,15 @@ from airflow.api_fastapi.execution_api.datamodels.hitl
import (
HITLDetailResponse,
UpdateHITLDetailPayload,
)
-from airflow.api_fastapi.execution_api.deps import JWTBearerTIPathDep
+from airflow.api_fastapi.execution_api.security import ExecutionAPIRoute,
require_auth
from airflow.models.hitl import HITLDetail
-router = APIRouter(
+router = VersionedAPIRouter(
+ route_class=ExecutionAPIRoute,
dependencies=[
- # This checks that the UUID in the url matches the one in the token
for us.
- JWTBearerTIPathDep
- ]
+ # Validates that the JWT sub matches the task_instance_id path
parameter.
+ Security(require_auth, scopes=["ti:self"]),
+ ],
)
log = structlog.get_logger(__name__)