chore: remove dead pre-Vite webpack whitelist in auth utils#36
Merged
Conversation
is_allowed_during_login() still special-cased old webpack-style login asset paths (/js/login.js, /css/login.css, /fonts/..., /img/...) via the remove_webpack_suffixes() helper and a login_resources whitelist. Since the Vite migration, all of the login page's JS/CSS/fonts/images are built under /assets/ (already whitelisted, and verified in production — see the #31 login blank-page fix), so these old paths can never occur in a real request anymore. Remove remove_webpack_suffixes(), webpack_prefixed_extensions, and login_resources; is_allowed_during_login() now just checks favicon, the login page itself, /assets/, and /theme/ (custom theme assets). No behaviour change for any real request. Test file updated to match: drop WebpackSuffixesTest (tested the removed function) and the old-style parameterized cases; add /theme/ coverage that existed in code but wasn't tested. 1734 backend tests pass (14 fewer than before — exactly the removed dead-code tests, no other regressions). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
Removes dead code in
src/web/web_auth_utils.py, left over from the pre-Vite (webpack) build. Noted as a follow-up when fixing #31 (blank login page).is_allowed_during_login()still special-cased old webpack-style login asset paths (/js/login.js,/css/login.css,/fonts/...,/img/...) via aremove_webpack_suffixes()helper and alogin_resourceswhitelist. Since the Vite migration, all of the login page's JS/CSS/fonts/images are built under/assets/— already whitelisted, and verified live in production (the #31 fix). The old paths can therefore never occur in a real request anymore.Changes
remove_webpack_suffixes(),webpack_prefixed_extensions, and thelogin_resourceswhitelist.is_allowed_during_login()now just checks: favicon, the login page itself,/assets/, and/theme/(custom theme assets).Testing
WebpackSuffixesTest(tested the deleted function) and the old-webpack-style parameterized cases fromLoginResourcesTest; added/theme/coverage that existed in the code path but wasn't tested before.pytest src/tests/— 1734 passed (14 fewer than before master, exactly the removed dead-code tests — no other regressions).remove_webpack_suffixes,webpack_prefixed_extensions, orlogin_resourcesanywhere insrc/.🤖 Generated with Claude Code