Repository navigation
feat: serve the admin console through console_router - #4
Merged
Merged
Conversation
Proxies the Seamless admin dashboard from the auth API at /console, as the Express and Fastify adapters do, so an Axum API can serve it on its own origin. GET and HEAD only, nothing forwarded but the method and path, no path that can leave the console subtree, and redirects followed only within it.
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.
Adds
Adapter::console_router(), the counterpart of the Express and Fastify console proxies. It lets an Axum API serve the Seamless admin dashboard at/consoleon its own origin.seamless initdefaults to the console served by the API, so the Axum API template (fells-code/seamless-templates#112) needs this.Behaviour matches the Node proxies and fells-code/seamless-auth-go#3:
GETandHEADonly (anything else answers 405)./or\\, answer 400.One Axum-specific point: the router serves absolute
/consoleroutes and is merged (.merge(auth.console_router())), not nested. A router nested at/consolein axum 0.8 never matches/console/, which is where the browser lands. I probed this to confirm.Tests cover proxying,
/consoleand/console/, HEAD, refused methods, eight traversal shapes (none reach the upstream), redirects inside and outside the console, an auth server URL with a path, and an unreachable upstream. fmt, clippy-D warnings(default features and none), and tests on stable and 1.88 pass.