jedcunningham commented on code in PR #47514:
URL: https://github.com/apache/airflow/pull/47514#discussion_r1985720198
##########
airflow/auth/managers/simple/routes/login.py:
##########
@@ -40,6 +43,27 @@ def create_token(
return SimpleAuthManagerLogin.create_token(body=body)
+@login_router.get(
+ "/token",
+ status_code=status.HTTP_307_TEMPORARY_REDIRECT,
+
responses=create_openapi_http_exception_doc([status.HTTP_401_UNAUTHORIZED]),
+)
+def create_token_all_admins() -> RedirectResponse:
+ """Create a token with no credentials only if
``simple_auth_manager_all_admins`` is True."""
+ is_simple_auth_manager_all_admins = conf.getboolean("core",
"simple_auth_manager_all_admins")
+ if not is_simple_auth_manager_all_admins:
+ raise HTTPException(
+ status.HTTP_401_UNAUTHORIZED,
Review Comment:
I guess I can expand on why. 401 implies that a lack of credentials, 403
says "final answer no".
--
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]