baptistegh commented on code in PR #75913:
URL: https://github.com/apache/airflow/pull/75913#discussion_r4632563954
##########
providers/keycloak/src/airflow/providers/keycloak/auth_manager/routes/token.py:
##########
@@ -37,7 +37,9 @@
@token_router.post(
"/token",
status_code=status.HTTP_201_CREATED,
- responses=create_openapi_http_exception_doc([status.HTTP_400_BAD_REQUEST,
status.HTTP_403_FORBIDDEN]),
+ responses=create_openapi_http_exception_doc(
+ [status.HTTP_400_BAD_REQUEST, status.HTTP_403_FORBIDDEN,
status.HTTP_503_SERVICE_UNAVAILABLE]
Review Comment:
I checked every place we call Keycloak. Some still return a 500 when
Keycloak is down: the web `/login` and /`login/callback` routes, and every
permission check (`_is_authorized`, `_is_batch_authorized`), which raises
`AirflowException`. Since every request checks permissions, an outage still
shows up as 500s everywhere.
I'd rather not keep fixing it route by route here. Would you be OK with
keeping this PR scoped to the endpoints it adds or changes, and handling the
rest in a follow-up that maps outages to 503 in one place (one exception plus
one handler)?
--
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]