Commit 31419716 by Czémán Arnold

settings: Add extra LDAP group types

parent c18cc042
...@@ -591,19 +591,25 @@ TWO_FACTOR_ISSUER = get_env_variable("TWO_FACTOR_ISSUER", "CIRCLE") ...@@ -591,19 +591,25 @@ TWO_FACTOR_ISSUER = get_env_variable("TWO_FACTOR_ISSUER", "CIRCLE")
if get_env_variable('LDAP_AUTH', 'FALSE') == 'TRUE': if get_env_variable('LDAP_AUTH', 'FALSE') == 'TRUE':
import ldap import ldap
from django_auth_ldap.config import ( from django_auth_ldap.config import (
LDAPSearch, GroupOfNamesType, PosixGroupType, ActiveDirectoryGroupType LDAPSearch, PosixGroupType, NISGroupType, MemberDNGroupType,
GroupOfNamesType, GroupOfUniqueNamesType, ActiveDirectoryGroupType,
OrganizationalRoleGroupType,
) )
LDAP_SCOPE_MAP = { LDAP_SCOPE_MAP = {
"SUBTREE": ldap.SCOPE_SUBTREE, "SUBTREE": ldap.SCOPE_SUBTREE,
"BASE": ldap.SCOPE_BASE, "BASE": ldap.SCOPE_BASE,
"ONELEVEL": ldap.SCOPE_SUBTREE "ONELEVEL": ldap.SCOPE_SUBTREE,
} }
LDAP_GROUP_MAP = { LDAP_GROUP_MAP = {
"POSIX": PosixGroupType(), "POSIX": PosixGroupType(),
"AD": ActiveDirectoryGroupType(), "NIS": NISGroupType(),
"MEMBER_DN": MemberDNGroupType(),
"GROUP_OF_NAMES": GroupOfNamesType(), "GROUP_OF_NAMES": GroupOfNamesType(),
"GROUP_OF_UNIQUE_NAMES": GroupOfUniqueNamesType(),
"AD": ActiveDirectoryGroupType(),
"ORG_ROLE": OrganizationalRoleGroupType(),
} }
# Baseline configuration. # Baseline configuration.
...@@ -650,9 +656,8 @@ if get_env_variable('LDAP_AUTH', 'FALSE') == 'TRUE': ...@@ -650,9 +656,8 @@ if get_env_variable('LDAP_AUTH', 'FALSE') == 'TRUE':
'django_auth_ldap.backend.LDAPBackend', 'django_auth_ldap.backend.LDAPBackend',
) )
# org_id attribute
LDAP_ORG_ID_ATTRIBUTE = ( LDAP_ORG_ID_ATTRIBUTE = (
get_env_variable('LDAP_ORG_ID_ATTRIBUTE', "") == "TRUE") get_env_variable("LDAP_ORG_ID_ATTRIBUTE", "") == "TRUE")
LDAP_GROUP_OWNER_ATTRIBUTE = get_env_variable("LDAP_GROUP_OWNER_ATTRIBUTE", LDAP_GROUP_OWNER_ATTRIBUTE = get_env_variable("LDAP_GROUP_OWNER_ATTRIBUTE",
"owner") "owner")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment