From 9a41ede01324743c69748edfb4554f1e7ecb4272 Mon Sep 17 00:00:00 2001 From: Sidney Richards Date: Mon, 26 Aug 2024 15:40:00 +0200 Subject: [PATCH] fix missing mock DigiD/eHerkenning backends in dev We were too eager in 65304e2 in removing all the dev backends, in an attempt to avoid divergence between the base and dev authentication backends. Unfortunately, we mistakenly also removed references to the mock backends, which broke local development which suddenly required production settings for DigiD and eHerkenning. This commit makes more explicit that all we want to do on dev is replace these backends whilst keeping the other settings the same. --- src/open_inwoner/conf/dev.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/open_inwoner/conf/dev.py b/src/open_inwoner/conf/dev.py index f898d6c7f7..c2a1c13db9 100644 --- a/src/open_inwoner/conf/dev.py +++ b/src/open_inwoner/conf/dev.py @@ -76,6 +76,17 @@ "oidc": {"BACKEND": "django.core.cache.backends.dummy.DummyCache"}, } +_MOCK_AUTHENTICATION_BACKENDS = { + "digid_eherkenning.backends.DigiDBackend": "digid_eherkenning.mock.backends.DigiDBackend", + "eherkenning.backends.eHerkenningBackend": "eherkenning.mock.backends.eHerkenningBackend", +} + +AUTHENTICATION_BACKENDS = [ + _MOCK_AUTHENTICATION_BACKENDS.get(backend, backend) + for backend in AUTHENTICATION_BACKENDS +] + + # # Library settings #