From e1899ae1953f70f6cedd44828e2f1999a2d1677f Mon Sep 17 00:00:00 2001 From: Sidney Richards Date: Wed, 16 Oct 2024 18:43:23 +0200 Subject: [PATCH] Derive CI auth backends from base Having different AUTHENTICATION_BACKEND literals per environment has frequently caused problems in the past when trying to change these settings. This commit ensures ci follows the dev environment approach: express the backends as a function of the base backends. --- src/open_inwoner/conf/ci.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/open_inwoner/conf/ci.py b/src/open_inwoner/conf/ci.py index b1b10cff61..71003f62f9 100644 --- a/src/open_inwoner/conf/ci.py +++ b/src/open_inwoner/conf/ci.py @@ -28,20 +28,21 @@ } ) -# Allow logging in with both username+password and email+password + +_MOCK_AUTHENTICATION_BACKENDS = { + "digid_eherkenning.backends.DigiDBackend": "digid_eherkenning.mock.backends.DigiDBackend", + "eherkenning.backends.eHerkenningBackend": "eherkenning.mock.backends.eHerkenningBackend", +} + AUTHENTICATION_BACKENDS = [ - "open_inwoner.accounts.backends.CustomAxesBackend", - "open_inwoner.accounts.backends.UserModelEmailBackend", - "open_inwoner.accounts.backends.Verify2FATokenBackend", + _MOCK_AUTHENTICATION_BACKENDS.get(backend, backend) + for backend in AUTHENTICATION_BACKENDS +] + [ + # Allow logging in with both username+password and email+password "django.contrib.auth.backends.ModelBackend", - # mock login like dev.py - "digid_eherkenning.mock.backends.DigiDBackend", - "eherkenning.mock.backends.eHerkenningBackend", - "digid_eherkenning_oidc_generics.backends.OIDCAuthenticationDigiDBackend", - "digid_eherkenning_oidc_generics.backends.OIDCAuthenticationEHerkenningBackend", - "open_inwoner.accounts.backends.CustomOIDCBackend", ] + ELASTIC_APM["DEBUG"] = True ELASTICSEARCH_DSL_AUTO_REFRESH = False