From 222ede2c4bd4754db93c4c7329a7d5a9924361db Mon Sep 17 00:00:00 2001 From: ryanmerolle Date: Tue, 20 Apr 2021 03:35:57 -0400 Subject: [PATCH] enahance ldap extra.py with more examples --- configuration/ldap/extra.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/configuration/ldap/extra.py b/configuration/ldap/extra.py index 2edae86..60a80eb 100644 --- a/configuration/ldap/extra.py +++ b/configuration/ldap/extra.py @@ -1,8 +1,28 @@ #### ## This file contains extra configuration options that can't be configured ## directly through environment variables. +## All vairables set here overwrite any existing found in ldap_config.py #### -# import ldap +# # This Python script inherits all the imports from ldap_config.py +# from django_auth_ldap.config import LDAPGroupQuery # Imported since not in ldap_config.py -# AUTH_LDAP_MIRROR_GROUPS = ["netbox-group-1", "netbox-group-2"] +# # Sets a base requirement of membetship to netbox-user-ro, netbox-user-rw, or netbox-user-admin. +# AUTH_LDAP_REQUIRE_GROUP = ( +# LDAPGroupQuery("cn=netbox-user-ro,ou=groups,dc=example,dc=com") +# | LDAPGroupQuery("cn=netbox-user-rw,ou=groups,dc=example,dc=com") +# | LDAPGroupQuery("cn=netbox-user-admin,ou=groups,dc=example,dc=com") +# ) + +# # Sets LDAP Flag groups variables with example. +# AUTH_LDAP_USER_FLAGS_BY_GROUP = { +# "is_staff": ( +# LDAPGroupQuery("cn=netbox-user-ro,ou=groups,dc=example,dc=com") +# | LDAPGroupQuery("cn=netbox-user-rw,ou=groups,dc=example,dc=com") +# | LDAPGroupQuery("cn=netbox-user-admin,ou=groups,dc=example,dc=com") +# ), +# "is_superuser": "cn=netbox-user-admin,ou=groups,dc=example,dc=com", +# } + +# # Sets LDAP Mirror groups variables with example groups +# AUTH_LDAP_MIRROR_groups = ["netbox-user-ro", "netbox-user-rw", "netbox-user-admin"]