Map REMOTE_AUTH_BACKEND env var to list #1059
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issue: None
New Behavior
REMOTE_AUTH_BACKEND
is now mapped as a list inconfiguration.py
, so we can configure multiple remote auth backends without usingextra.py
.Example use case: use LDAP and social backends.
Contrast to Current Behavior
As of today,
REMOTE_AUTH_BACKEND
environment variable is not mapped to any specific type, just a string. To configure multiple backends, we have to set ourREMOTE_AUTH_BACKEND
list inextra.py
.Discussion: Benefits and Drawbacks
Benefits
extra.py
settings.py
castsREMOTE_AUTH_BACKEND
to a list if it is not a list or tuple, before copying*REMOTE_AUTH_BACKEND
intoAUTHENTICATION_BACKENDS
, so nothing has to be done in netbox-docker to carry this backward compatibilityREMOTE_AUTH_BACKEND
being python import paths, they will not contain white spaces. The_AS_LIST
lambda should work as expected in all casesDrawbacks
I don't see any
Changes to the Wiki
Upstream netbox documentation about REMOTE_AUTH_BACKEND should specify that configuring multiple remote auth backends with a list is possible (it's already the case).
I don't see any required change in the netbox-docker wiki.
Proposed Release Note Entry
REMOTE_AUTH_BACKEND environment variable can now define multiple backends, separated with white spaces.
Double Check
develop
branch.