]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix OAuth2 SSO when roles_path is empty 62296/head
authorAfreen Misbah <afreen@ibm.com>
Fri, 14 Mar 2025 05:50:30 +0000 (11:20 +0530)
committerAfreen Misbah <afreen@ibm.com>
Fri, 14 Mar 2025 05:55:09 +0000 (11:25 +0530)
Fixes https://tracker.ceph.com/issues/70454

Due to PR linter updates, this place remained not updated hence failing

Signed-off-by: Afreen Misbah <afreen@ibm.com>
src/pybind/mgr/dashboard/services/auth/oauth2.py

index 26027adf603d99366a615823e4f961ff88870c27..50878852897909086a46f3d4a4b84fe71f010b9c 100644 (file)
@@ -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