Repository navigation
Remove ChiAuthBackend (5.0.0) - #21
Merged
Merged
Conversation
Every user_manager consumer (daedalus, email_service, monitor — all on chi-cetus) signs CHI users in through header SSO, so the backend that let the local form accept UC and CHI credentials authenticated no one in production. It was also the second of two paths answering the same questions, which is how #8 happened. The local form stays: it is how daedalus and monitor sign in during development, and /admin/login/ is the documented way in for a local superuser. Both go through Django's ModelBackend, which this does not touch. Gone with the backend, since nothing else read them: CHI_AUTH_API_ACCESS_TOKEN, CHI_AUTH_CHECK_SYSTEMS, CHI_AUTH_TIMEOUT, UC_PASSWORD_MANAGER_URL, the ACCOUNT_LOOKUP_URL and allow_chi_auth_login context variables, the UC/CHI hints and links in login.html, and the requests dependency. New checks for the upgrade: - E003: AUTHENTICATION_BACKENDS still lists ChiAuthBackend. That path is only imported at sign-in, so a missed one fails every login after a healthy-looking deploy; as a check Error it fails `migrate` instead. - W009: one of the three removed settings is still set, and does nothing. Fixes #9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9. Stacked on #20 (4.0.1). Merge that first, and GitHub will retarget this PR to
main.Why now
#9 was waiting for a survey of every consumer before deleting a login path. The survey is done: the only consumers are daedalus, email_service and monitor, all on chi-cetus. The other names in #9 and in this README's old "Projects using it" list were guesses, and none of those repositories mentions
user_manager. All three consumers run header SSO in production, soChiAuthBackendauthenticated nobody.What goes, and what stays
Stays:
login_view's form andlogin.html, authenticating through Django'sModelBackend. Deleting the whole password path, as #9 first proposed, would have broken two things:CHI_AUTH_USE_MIDDLEWAREtoFalse, and monitor's README says that's how you sign in locally./admin/login/as the way in for a local superuser.Goes, because nothing else read it:
authentication_backends.pyand its 16 testsCHI_AUTH_API_ACCESS_TOKEN,CHI_AUTH_CHECK_SYSTEMS,CHI_AUTH_TIMEOUTandUC_PASSWORD_MANAGER_URLACCOUNT_LOOKUP_URLandallow_chi_auth_logincontext variables. No consumer template uses them.login.html, the "sign in with your UC/CHI credentials" hint and the two password-help linksrequestsdependency. daedalus and monitor importrequestsand already declare it; email_service doesn't import it.New checks for the upgrade
user_manager.E003fires whenAUTHENTICATION_BACKENDSstill listsChiAuthBackend. Django only imports a backend at sign-in, so without this check a missed line fails every login,/admin/login/included, after a deploy that looked healthy. I confirmed it:authenticate()raisesModuleNotFoundError, andmanage.py migrateexits 1 without applying anything.user_manager.W009names any of the three removed settings that is still set. All three consumers set them today.set -e. daedalus's and monitor's do. email_service's doesn't: a failedmigratethere falls through to gunicorn. The upgrade note says to check it by hand, and the missingset -eis already recorded as drift in chi-platformconvergence.md§5.Consumer work
Each consumer needs one change alongside its pin bump: remove one line from
AUTHENTICATION_BACKENDS, and delete the three settings fromsettings.py,example.settings.envand the deployedsettings.env. All three are still on v3.2.0, so this goes on top of the 4.0 bumps already filed (daedalus#99, email_service#44, monitor#44). Doing both in one pass means each consumer gets touched once.Verification
runtests.py: 97 tests pass (was 110: −16 backend tests, +3 checks, +1 settings test, and the context-processor tests rewritten). The login tests run againstModelBackendalone.ruff checkandruff format --checkare clean.chi-platform/audit.sh user_manager: ✓ 18 checks.CHI_AUTH_TIMEOUTgets E003 and W009 frommigrateandrunserver.🤖 Generated with Claude Code