From c3508234ac63c819356754a71fcbe0e90c6964ab Mon Sep 17 00:00:00 2001 From: ColtenOuO Date: Tue, 26 May 2026 17:56:49 +0000 Subject: [PATCH 1/3] Fix GET /auth/login missing 400 in OpenAPI spec and use status constant --- .../src/airflow/api_fastapi/core_api/routes/public/auth.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/auth.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/auth.py index f85bcec3a6123..30e22c51b671d 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/auth.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/auth.py @@ -36,14 +36,16 @@ @auth_router.get( "/login", - responses=create_openapi_http_exception_doc([status.HTTP_307_TEMPORARY_REDIRECT]), + responses=create_openapi_http_exception_doc( + [status.HTTP_307_TEMPORARY_REDIRECT, status.HTTP_400_BAD_REQUEST] + ), ) def login(request: Request, auth_manager: AuthManagerDep, next: None | str = None) -> RedirectResponse: """Redirect to the login URL depending on the AuthManager configured.""" login_url = auth_manager.get_url_login() if next and not is_safe_url(next, request=request): - raise HTTPException(status_code=400, detail="Invalid or unsafe next URL") + raise HTTPException(status.HTTP_400_BAD_REQUEST, detail="Invalid or unsafe next URL") if next: login_url += f"?{urlencode({'next': next})}" From 20a60f4826fa1a622a4cb1a5966934e9d288224b Mon Sep 17 00:00:00 2001 From: ColtenOuO Date: Tue, 26 May 2026 19:08:12 +0000 Subject: [PATCH 2/3] Regenerate OpenAPI spec: add missing 400 to GET /auth/login --- .../api_fastapi/core_api/openapi/v2-rest-api-generated.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml b/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml index 5ed96855c24ac..fa2e13c699898 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml +++ b/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml @@ -10294,6 +10294,12 @@ paths: schema: $ref: '#/components/schemas/HTTPExceptionResponse' description: Temporary Redirect + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPExceptionResponse' + description: Bad Request '422': description: Validation Error content: From 8f0a0afe34503d7204425a8e2093cbca63771f5f Mon Sep 17 00:00:00 2001 From: ColtenOuO Date: Wed, 27 May 2026 07:18:20 +0000 Subject: [PATCH 3/3] Regenerate UI TypeScript client after adding 400 to GET /auth/login OpenAPI spec --- .../src/airflow/ui/openapi-gen/requests/services.gen.ts | 1 + airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts index ec044ac30856d..c5de12f7a2969 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts @@ -4086,6 +4086,7 @@ export class LoginService { }, errors: { 307: 'Temporary Redirect', + 400: 'Bad Request', 422: 'Validation Error' } }); diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts index 4d401bfc1a496..c71cf1c9d86b2 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts @@ -7264,6 +7264,10 @@ export type $OpenApiTs = { * Temporary Redirect */ 307: HTTPExceptionResponse; + /** + * Bad Request + */ + 400: HTTPExceptionResponse; /** * Validation Error */