Skip to content

Allow ESI shared-template caching behind basic auth - #1070

Open
prk-Jr wants to merge 1 commit into
mainfrom
esi-edge-terminated-auth-main
Open

Allow ESI shared-template caching behind basic auth#1070
prk-Jr wants to merge 1 commit into
mainfrom
esi-edge-terminated-auth-main

Conversation

@prk-Jr

@prk-Jr prk-Jr commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Allow ESI shared-template caching when Trusted Server has already validated the request Basic Auth credential at the edge.
  • Preserve the fail-closed bypass for publisher-origin credentials and ambiguous repeated Authorization fields.
  • Carry the server-only authentication decision through all four adapter middleware stacks without modifying the forwarded header.

Changes

File Change
crates/trusted-server-core/src/auth.rs Add the request marker, fail closed on repeated Authorization fields, and add marker lifecycle regressions.
crates/trusted-server-core/src/publisher.rs Exempt exactly one edge-terminated credential from cache bypass and independently reject repeated values.
crates/trusted-server-adapter-fastly/src/middleware.rs Pass the mutable request through Basic Auth middleware.
crates/trusted-server-adapter-axum/src/middleware.rs Pass the mutable request through Basic Auth middleware.
crates/trusted-server-adapter-cloudflare/src/middleware.rs Pass the mutable request through Basic Auth middleware.
crates/trusted-server-adapter-spin/src/middleware.rs Pass the mutable request through Basic Auth middleware.

Test plan

  • cargo test-fastly && cargo test-axum
  • cargo test-cloudflare && cargo test-spin
  • All six target-specific Clippy gates
  • cargo fmt --all -- --check
  • Native core suite: 2,216 tests
  • Regression tests cover pass-through, edge-terminated, and repeated Authorization behavior
  • JS tests
  • JS format
  • Docs format
  • Manual staging validation

Checklist

  • Changes follow CLAUDE.md conventions
  • No unwrap calls added to production code
  • No println calls added
  • New code has regression tests
  • No secrets or credentials committed

No linked issue for this PR, per request.

@prk-Jr prk-Jr self-assigned this Aug 25, 2026
@ChristianPavilonis ChristianPavilonis changed the title Allow shared templates behind edge-terminated auth Allow ESI shared-template caching behind basic auth Aug 25, 2026
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