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

Map REMOTE_AUTH_BACKEND env var to list #1059

Conversation

NeodymiumFerBore
Copy link
Contributor

@NeodymiumFerBore NeodymiumFerBore commented Aug 25, 2023

Related Issue: None

New Behavior

REMOTE_AUTH_BACKEND is now mapped as a list in configuration.py, so we can configure multiple remote auth backends without using extra.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 our REMOTE_AUTH_BACKEND list in extra.py.

Discussion: Benefits and Drawbacks

Benefits

  • Can configure multiple remote auth backends via environment variable, without any addition in extra.py
  • Backward compatibility: it will not break existing configurations:
    • Single backend set as env var: will load a single element list
    • Set as extra conf: the extra conf will still supersede the new definition
  • the upstream settings.py casts REMOTE_AUTH_BACKEND to a list if it is not a list or tuple, before copying *REMOTE_AUTH_BACKEND into AUTHENTICATION_BACKENDS, so nothing has to be done in netbox-docker to carry this backward compatibility
  • Parameters for REMOTE_AUTH_BACKEND being python import paths, they will not contain white spaces. The _AS_LIST lambda should work as expected in all cases

Drawbacks
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

  • I have read the comments and followed the PR template.
  • I have explained my PR according to the information in the comments.
  • My PR targets the develop branch.

@tobiasge tobiasge merged commit 4d54bb1 into netbox-community:develop Aug 28, 2023
5 of 9 checks passed
@tobiasge tobiasge mentioned this pull request Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants