fix(auth): normalize mounted request paths - #5807
Open
RaresKeY wants to merge 1 commit into
Open
Conversation
RaresKeY
marked this pull request as ready for review
July 28, 2026 16:57
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
This replaces #5678, which GitHub closed during the repository transfer and fork-network separation. The branch has been rebuilt on the current dev history; the implementation scope is unchanged.
Normalize the path used by authentication middleware to the same application-relative form Starlette uses for route matching. This keeps setup, public-route exemptions, API error responses, and protected routes consistent when Odysseus is mounted below a non-empty ASGI
root_path; it also makes login redirects mount-aware and limits the static exemption to the actual/staticroute family.Target branch
dev, notmain.Linked Issue
Fixes #5677
Part of #5674
Type of Change
Checklist
dev.How to Test
python -m pytest -q tests/test_auth_root_path.py tests/test_cors_preflight.py tests/test_webhook_trigger_auth_exempt.py tests/test_auth_policy.py tests/test_auth_regressions.pyin the repository environment. The focused suite passes with 46 tests.401, a protected browser route redirects to the mount-aware login URL, and path-token webhooks still reach their own credential check.The exact-head full isolated suite completes with 4677 passing and 5 skipped tests. Its 12 failures exactly match the clean current-
devrunner baseline: the omitted.env.example, one offline URL-join check, two backup-recovery checks, and eight offline web-fetch checks. This branch does not touch those areas.Visual / UI changes — REQUIRED if you touched anything that renders
Not applicable. This changes middleware path handling and tests only; no rendered UI files are touched.