Skip to content

Commit 0d5dee3

Browse files
committed
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.
1 parent 9b0e8c1 commit 0d5dee3

File tree

1 file changed

+11
-9
lines changed
  • src/open_inwoner/conf

1 file changed

+11
-9
lines changed

src/open_inwoner/conf/ci.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,21 @@
2828
}
2929
)
3030

31-
# Allow logging in with both username+password and email+password
31+
32+
_MOCK_AUTHENTICATION_BACKENDS = {
33+
"digid_eherkenning.backends.DigiDBackend": "digid_eherkenning.mock.backends.DigiDBackend",
34+
"eherkenning.backends.eHerkenningBackend": "eherkenning.mock.backends.eHerkenningBackend",
35+
}
36+
3237
AUTHENTICATION_BACKENDS = [
33-
"open_inwoner.accounts.backends.CustomAxesBackend",
34-
"open_inwoner.accounts.backends.UserModelEmailBackend",
35-
"open_inwoner.accounts.backends.Verify2FATokenBackend",
38+
_MOCK_AUTHENTICATION_BACKENDS.get(backend, backend)
39+
for backend in AUTHENTICATION_BACKENDS
40+
] + [
41+
# Allow logging in with both username+password and email+password
3642
"django.contrib.auth.backends.ModelBackend",
37-
# mock login like dev.py
38-
"digid_eherkenning.mock.backends.DigiDBackend",
39-
"eherkenning.mock.backends.eHerkenningBackend",
40-
"open_inwoner.accounts.backends.DigiDEHerkenningOIDCBackend",
41-
"open_inwoner.accounts.backends.CustomOIDCBackend",
4243
]
4344

45+
4446
ELASTIC_APM["DEBUG"] = True
4547

4648
ELASTICSEARCH_DSL_AUTO_REFRESH = False

0 commit comments

Comments
 (0)