Skip to content

refactor: new architecture#7

Merged
alukach merged 52 commits into
mainfrom
refactor/new-architecture
Mar 9, 2026
Merged

refactor: new architecture#7
alukach merged 52 commits into
mainfrom
refactor/new-architecture

Conversation

@alukach

@alukach alukach commented Mar 4, 2026

Copy link
Copy Markdown
Member

No description provided.

alukach and others added 17 commits March 3, 2026 16:01
…lones

Non-OIDC buckets now return Cow::Borrowed, eliminating a HashMap clone
on every request. OIDC buckets return Cow::Owned with injected temporary
credentials. Multipart PendingRequest uses into_owned() since it needs
ownership.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ch routing

Introduces a RouteHandler trait that allows request interception before
the main proxy dispatch pipeline. Handlers are checked in registration
order and can short-circuit with a HandlerAction. Includes RequestInfo
struct for passing parsed request metadata to handlers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename the core handler struct to Gateway to better reflect its role as
the single entry point for request processing. Add route_handlers field
and handle() method that checks registered RouteHandlers before falling
through to the proxy dispatch pipeline. A ProxyHandler type alias
preserves backwards compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract OIDC discovery endpoint handling into a RouteHandler
implementation. Serves openid-configuration and JWKS JSON responses.
Also adds ProxyResult::json() helper to simplify JSON response
construction from downstream crates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract STS request handling into a RouteHandler implementation that
delegates to the existing try_handle_sts() function. Also adds
ProxyResult::xml() helper for constructing XML responses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace inline OIDC discovery and STS interception code in all three
runtimes (server, lambda, cf-workers) with registered route handlers
on the Gateway. Each runtime now uses Gateway::handle() as the single
entry point, eliminating ~200 lines of duplicated pre-dispatch logic.

AppState structs are simplified by removing sts_config, jwks_cache,
token_key, and oidc_discovery fields — these are now owned by the
route handlers registered on the gateway.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add GatewayResponse<Body> enum and handle_request() method that resolves
NeedsBody internally via a body-collection closure. The body is passed
through untouched for Forward (preserving zero-copy streaming), and only
materialized via the closure for multipart operations.

Runtimes now match on two variants instead of three, with body collection
handled lazily by the gateway.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alukach alukach force-pushed the refactor/new-architecture branch from ef0a44d to 0be16a1 Compare March 4, 2026 22:05
@alukach alukach force-pushed the refactor/new-architecture branch from 8e40690 to 1abe0de Compare March 4, 2026 23:14
@github-actions

github-actions Bot commented Mar 5, 2026

Copy link
Copy Markdown

🚀 Latest commit deployed to https://multistore-proxy-pr-7.alukach.workers.dev

  • Date: 2026-03-08T17:16:54Z
  • Commit: f4a69a4

@alukach alukach merged commit d84fe87 into main Mar 9, 2026
10 checks passed
@alukach alukach deleted the refactor/new-architecture branch March 11, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant