Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AUTH_LDAP_MIRROR_GROUPS ldap_config tweak #448

Merged
merged 7 commits into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ configuration/*
!configuration/extra.py
configuration/ldap/*
!configuration/ldap/ldap_config.py
!configuration/ldap/extra.py
prometheus.yml
super-linter.log
8 changes: 8 additions & 0 deletions configuration/ldap/extra.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
####
## This file contains extra configuration options that can't be configured
## directly through environment variables.
####

# import ldap
ryanmerolle marked this conversation as resolved.
Show resolved Hide resolved

# AUTH_LDAP_MIRROR_GROUPS = ["netbox-group-1", "netbox-group-2"]
3 changes: 2 additions & 1 deletion configuration/ldap/ldap_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def _import_group_type(group_type_name):

# For more granular permissions, we can map LDAP groups to Django groups.
AUTH_LDAP_FIND_GROUP_PERMS = environ.get('AUTH_LDAP_FIND_GROUP_PERMS', 'True').lower() == 'true'
AUTH_LDAP_MIRROR_GROUPS = environ.get('AUTH_LDAP_MIRROR_GROUPS', '').lower() == 'true'
if environ.get('AUTH_LDAP_MIRROR_GROUPS') is not None:
ryanmerolle marked this conversation as resolved.
Show resolved Hide resolved
AUTH_LDAP_MIRROR_GROUPS = environ.get('AUTH_LDAP_MIRROR_GROUPS', '').lower() == 'true'

# Cache groups for one hour to reduce LDAP traffic
AUTH_LDAP_CACHE_TIMEOUT = int(environ.get('AUTH_LDAP_CACHE_TIMEOUT', 3600))
Expand Down