From 33b6f1aaebd2e6d3333bc6218b487e6fb13c4651 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 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/open_inwoner/conf/ci.py b/src/open_inwoner/conf/ci.py index fd3a61312e..71003f62f9 100644 --- a/src/open_inwoner/conf/ci.py +++ b/src/open_inwoner/conf/ci.py @@ -28,19 +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", - "open_inwoner.accounts.backends.DigiDEHerkenningOIDCBackend", - "open_inwoner.accounts.backends.CustomOIDCBackend", ] + ELASTIC_APM["DEBUG"] = True ELASTICSEARCH_DSL_AUTO_REFRESH = False