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 21, 2024
1 parent 9b0e8c1 commit 0d5dee3
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/open_inwoner/conf/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d5dee3

Please sign in to comment.