This is an automated email from the ASF dual-hosted git repository.
vincbeck 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 647017278b6 Fix GET /auth/login missing 400 in OpenAPI spec and use
status constant (#67571)
647017278b6 is described below
commit 647017278b6605ad6aab5def772353b6c87c928b
Author: Colten <[email protected]>
AuthorDate: Wed May 27 21:44:48 2026 +0800
Fix GET /auth/login missing 400 in OpenAPI spec and use status constant
(#67571)
---
.../airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml | 6 ++++++
airflow-core/src/airflow/api_fastapi/core_api/routes/public/auth.py | 6 ++++--
airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts | 1 +
airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts | 4 ++++
4 files changed, 15 insertions(+), 2 deletions(-)
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 49a6b734ffb..618356a1ce7 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
@@ -11068,6 +11068,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:
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 6cf7529982c..2237a68c055 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 = AirflowRouter(tags=["Login"], prefix="/auth")
@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})}"
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 54e1ef86ea1..e65f313e1d9 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
@@ -4442,6 +4442,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 d2294539b59..77380eec738 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
@@ -7760,6 +7760,10 @@ export type $OpenApiTs = {
* Temporary Redirect
*/
307: HTTPExceptionResponse;
+ /**
+ * Bad Request
+ */
+ 400: HTTPExceptionResponse;
/**
* Validation Error
*/