summaryrefslogtreecommitdiff
path: root/kvmd/plugins
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-09-28 02:09:57 +0300
committerMaxim Devaev <[email protected]>2023-09-28 02:09:57 +0300
commitcfc556f41240283180f993207ce77309bb1b623c (patch)
tree6cdebb4446bd931516865dc2301080f33dc61250 /kvmd/plugins
parent29e266f5427e26947acdbfa942775760f83ff115 (diff)
extra isinstance check
Diffstat (limited to 'kvmd/plugins')
-rw-r--r--kvmd/plugins/auth/ldap.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/kvmd/plugins/auth/ldap.py b/kvmd/plugins/auth/ldap.py
index 8743b2c9..7f7ed597 100644
--- a/kvmd/plugins/auth/ldap.py
+++ b/kvmd/plugins/auth/ldap.py
@@ -91,7 +91,12 @@ class Plugin(BaseAuthService):
attrlist=["memberOf"],
timeout=self.__timeout,
) or []):
- if dn is not None and isinstance(attrs, dict) and self.__group.encode() in attrs.get("memberOf"): # type: ignore
+ if (
+ dn is not None
+ and isinstance(attrs, dict)
+ and isinstance(attrs["memberOf"], (list, dict))
+ and self.__group.encode() in attrs["memberOf"]
+ ):
return True
except ldap.INVALID_CREDENTIALS:
pass