Skip to content

Commit d9a06c0

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 ae4ea36 commit d9a06c0

File tree

1 file changed

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

1 file changed

+11
-10
lines changed

src/open_inwoner/conf/ci.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -28,20 +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-
"digid_eherkenning_oidc_generics.backends.OIDCAuthenticationDigiDBackend",
41-
"digid_eherkenning_oidc_generics.backends.OIDCAuthenticationEHerkenningBackend",
42-
"open_inwoner.accounts.backends.CustomOIDCBackend",
4343
]
4444

45+
4546
ELASTIC_APM["DEBUG"] = True
4647

4748
ELASTICSEARCH_DSL_AUTO_REFRESH = False

0 commit comments

Comments
 (0)