Skip to content

Commit 222ede2

Browse files
committed
enahance ldap extra.py with more examples
1 parent 28a2628 commit 222ede2

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

configuration/ldap/extra.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
####
22
## This file contains extra configuration options that can't be configured
33
## directly through environment variables.
4+
## All vairables set here overwrite any existing found in ldap_config.py
45
####
56

6-
# import ldap
7+
# # This Python script inherits all the imports from ldap_config.py
8+
# from django_auth_ldap.config import LDAPGroupQuery # Imported since not in ldap_config.py
79

8-
# AUTH_LDAP_MIRROR_GROUPS = ["netbox-group-1", "netbox-group-2"]
10+
# # Sets a base requirement of membetship to netbox-user-ro, netbox-user-rw, or netbox-user-admin.
11+
# AUTH_LDAP_REQUIRE_GROUP = (
12+
# LDAPGroupQuery("cn=netbox-user-ro,ou=groups,dc=example,dc=com")
13+
# | LDAPGroupQuery("cn=netbox-user-rw,ou=groups,dc=example,dc=com")
14+
# | LDAPGroupQuery("cn=netbox-user-admin,ou=groups,dc=example,dc=com")
15+
# )
16+
17+
# # Sets LDAP Flag groups variables with example.
18+
# AUTH_LDAP_USER_FLAGS_BY_GROUP = {
19+
# "is_staff": (
20+
# LDAPGroupQuery("cn=netbox-user-ro,ou=groups,dc=example,dc=com")
21+
# | LDAPGroupQuery("cn=netbox-user-rw,ou=groups,dc=example,dc=com")
22+
# | LDAPGroupQuery("cn=netbox-user-admin,ou=groups,dc=example,dc=com")
23+
# ),
24+
# "is_superuser": "cn=netbox-user-admin,ou=groups,dc=example,dc=com",
25+
# }
26+
27+
# # Sets LDAP Mirror groups variables with example groups
28+
# AUTH_LDAP_MIRROR_groups = ["netbox-user-ro", "netbox-user-rw", "netbox-user-admin"]

0 commit comments

Comments
 (0)