Skip to content

feat: serve the admin console through console_router - #4

Merged
Bccorb merged 1 commit into
mainfrom
feat/console-proxy
Oct 8, 2026
Merged

Bccorb merged 1 commit into
mainfrom
feat/console-proxy

Conversation

@Bccorb

@Bccorb Bccorb commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Adds Adapter::console_router(), the counterpart of the Express and Fastify console proxies. It lets an Axum API serve the Seamless admin dashboard at /console on its own origin. seamless init defaults 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:

  • GET and HEAD only (anything else answers 405).
  • Only the method and path are forwarded, so the browser's cookies never reach the upstream.
  • Only content-type, cache-control, etag and last-modified come back.
  • A 10 second timeout, and 502 when the upstream is unreachable.
  • Literal or encoded dot segments, and encoded / or \\, answer 400.
  • Redirects are followed only within the console on the auth API's origin. This uses a dedicated client, because the adapter's own client follows no redirects.

One Axum-specific point: the router serves absolute /console routes and is merged (.merge(auth.console_router())), not nested. A router nested at /console in axum 0.8 never matches /console/, which is where the browser lands. I probed this to confirm.

Tests cover proxying, /console and /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.

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.
@Bccorb
Bccorb merged commit 8804972 into main Oct 8, 2026
3 checks passed
@Bccorb
Bccorb deleted the feat/console-proxy branch October 15, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant