aaron-wolmutt commented on code in PR #58292:
URL: https://github.com/apache/airflow/pull/58292#discussion_r2558292407
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/auth.py:
##########
@@ -38,3 +40,27 @@ def get_auth_menus(
authorized_menu_items=authorized_menu_items,
extra_menu_items=extra_menu_items,
)
+
+
+@auth_router.get("/auth/me")
+def get_current_user(
+ user: GetUserDep,
+) -> SimpleAuthenticatedMeResponse | FabAuthenticatedMeResponse:
+ """Get current authenticated user information."""
+ auth_manager = get_auth_manager()
+ if auth_manager.get_auth_manager_type() == "SimpleAuthManager":
+ return SimpleAuthenticatedMeResponse(
+ username=user.username or "",
+ role=user.role or "",
+ )
+
+ if auth_manager.get_auth_manager_type() == "FabAuthManager":
+ return FabAuthenticatedMeResponse(
Review Comment:
Removed the get_auth_manager_type() and check
--
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]