From 737ae7f73a8d7d5c705720ff3281c1783ec4d2ac Mon Sep 17 00:00:00 2001 From: Afreen Misbah Date: Fri, 14 Mar 2025 11:20:30 +0530 Subject: [PATCH] mgr/dashboard: fix OAuth2 SSO when roles_path is empty Fixes https://tracker.ceph.com/issues/70454 Due to PR linter updates, this place remained not updated hence failing Signed-off-by: Afreen Misbah --- src/pybind/mgr/dashboard/services/auth/oauth2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/dashboard/services/auth/oauth2.py b/src/pybind/mgr/dashboard/services/auth/oauth2.py index 26027adf603d9..5087885289790 100644 --- a/src/pybind/mgr/dashboard/services/auth/oauth2.py +++ b/src/pybind/mgr/dashboard/services/auth/oauth2.py @@ -93,7 +93,7 @@ class OAuth2(SSOAuth): except AttributeError: raise cherrypy.HTTPError(401) - if jmespath and hasattr(mgr.SSO_DB.config, 'roles_path'): + if jmespath and getattr(mgr.SSO_DB.config, 'roles_path', None): logger.debug("Using 'roles_path' to fetch roles") roles = jmespath.search(mgr.SSO_DB.config.roles_path, jwt_payload) # e.g Keycloak -- 2.39.5