Skip to content

Commit

Permalink
✨ [#1637] added environmental variable to disable 2fa in
Browse files Browse the repository at this point in the history
base.py
  • Loading branch information
bart-maykin committed Jun 19, 2024
1 parent 26749c7 commit cdf7911
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Changes

**New features**

* [#1637] Added 2FA which is disabled by the environment variable``DISABLE_2FA`` by default.
* [#135] Added ``createinitialsuperuser`` management command to create admin superuser
* [#87] Supported configuration of the API with a management command ``setup_configuration`` and environment variables
* [open-zaak/open-zaak#1203] Added configuration of retry variables with admin UI and with
Expand Down
4 changes: 0 additions & 4 deletions src/nrc/conf/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@
INTERNAL_IPS = ("127.0.0.1",)
DEBUG_TOOLBAR_CONFIG = {"INTERCEPT_REDIRECTS": False}

# None of the authentication backends require two-factor authentication.
if config("DISABLE_2FA", default=True): # pragma: no cover
MAYKIN_2FA_ALLOW_MFA_BYPASS_BACKENDS = AUTHENTICATION_BACKENDS

# in memory cache and django-axes don't get along.
# https://django-axes.readthedocs.io/en/latest/configuration.html#known-configuration-problems
CACHES = {
Expand Down
5 changes: 5 additions & 0 deletions src/nrc/conf/includes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,11 @@
"mozilla_django_oidc_db.backends.OIDCAuthenticationBackend",
]

# if DISABLE_2FA is true, fill the MAYKIN_2FA_ALLOW_MFA_BYPASS_BACKENDS with all
# configured AUTHENTICATION_BACKENDS and thus disabeling the entire 2FA chain
if config("DISABLE_2FA", default=True): # pragma: no cover
MAYKIN_2FA_ALLOW_MFA_BYPASS_BACKENDS = AUTHENTICATION_BACKENDS

#
# SENTRY - error monitoring
#
Expand Down

0 comments on commit cdf7911

Please sign in to comment.