Skip to content

Commit

Permalink
Derive CI auth backends from base
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
swrichards committed Oct 16, 2024
1 parent 624ce24 commit a8a696b
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/open_inwoner/conf/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a8a696b

Please sign in to comment.