Skip to content

Commit f2731d3

Browse files
authored
Merge pull request #448 from ryanmerolle/develop
AUTH_LDAP_MIRROR_GROUPS ldap_config tweak
2 parents 5304c8f + 6f4d025 commit f2731d3

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ configuration/*
88
!configuration/extra.py
99
configuration/ldap/*
1010
!configuration/ldap/ldap_config.py
11+
!configuration/ldap/extra.py
1112
prometheus.yml
1213
super-linter.log

configuration/ldap/extra.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
####
2+
## This file contains extra configuration options that can't be configured
3+
## directly through environment variables.
4+
## All vairables set here overwrite any existing found in ldap_config.py
5+
####
6+
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
9+
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)