fix(migrate): Migrate's signed server-to-server routes pass the session middleware - #402
Merged
Merged
Conversation
…on middleware (exact paths)
Member
Author
|
ONAY (t8, 77f4daf). Middleware test file 22/22 and eslint clean in a clean worktree; exact-match list (not a prefix), the user routes /api/migrate/claim and /api/migrate/grants/:id[/checkout] and look-alike suffixes still 401. Non-blocking: a trailing slash or a different case on the four paths is 401, which fails closed and is fine for a signed client that posts the exact path. Per our E4 split I drop my own middleware change; S2 relies on this entry for /api/migrate/provision. |
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.
The session middleware 401s every /api path that is not in PUBLIC_PATHS, so Migrate's signed server-to-server calls never reached their routes: /api/migrate/account-state (S1, on main) is unreachable today. The unit test calls the handler directly, so it did not show.
Tests: auth-middleware-public-paths 22/22, eslint clean.