Skip to content

feat(state): add request-aware authentication seams - #3054

Open
benpsnyder wants to merge 1 commit into
alchemy-run:mainfrom
benpsnyder:infra104-request-aware-state-auth
Open

benpsnyder wants to merge 1 commit into
alchemy-run:mainfrom
benpsnyder:infra104-request-aware-state-auth

Conversation

@benpsnyder

Copy link
Copy Markdown
Contributor

Allow HTTP state clients to perform an effectful request transform after authorization and absolute-URL resolution. This supports asynchronous per-request proof signing without having the store overwrite the resulting headers.

Add an opt-in request-aware authentication Layer. Hosts receive the actual request and own token verification, authorization, and replay checks. Each request invokes that validator only for its matching authentication scheme; a denial cannot be retried through the other scheme. Existing bearer authentication remains the default, and the public version endpoint is unchanged.

Validation

Verified commit 62627d844207145bf72cb325b85e01f3739d6456, independently based on upstream main at 5bbe9aa4d8ea8975b47e488239c04afd68f2d54c:

  • pnpm --filter alchemy run build
  • pnpm exec tsrs -b packages/alchemy/tsconfig.test.json
  • pnpm test test/State/HttpStateAuth.test.ts test/State/HttpStateStore.test.ts --retry 0 — 22 tests passed
  • Stock Oxlint and test-policy Oxlint on the changed source/test files
  • Focused Oxfmt and git diff --check

Tests use an in-memory HTTP router and controlled transports. They cover absolute URL/method signing, no request on signing failure, one validator invocation on denial, and unchanged default bearer behavior. No cloud state was accessed.

@alchemy-version-bot

Copy link
Copy Markdown
Contributor

Install the packages built from this commit:

alchemy

pnpm install https://pkg.alchemy.run/alchemy/pr:3054:62627d8
@alchemy.run (28)
pnpm install https://pkg.alchemy.run/@alchemy.run/better-auth/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/git/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/drizzle/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/acme/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/axiom/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/doppler/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/infisical/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/turso/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/planetscale/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/neon/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/prisma/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/hetzner/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/railway/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/fly/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/github/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/stripe/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/gcp/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/aws/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/domain/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/kubernetes/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/docker/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/redis/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/sql/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare-runtime/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/node-utils/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@alchemy.run/pkg/pr:3054:62627d8
Transitive Dependencies (19)
pnpm install https://pkg.alchemy.run/@distilled.cloud/aws/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/acme/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/axiom/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/core/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/doppler/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/infisical/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/turso/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/planetscale/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/neon/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/prisma/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/hetzner/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/railway/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/fly-io/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/github/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/stripe/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/aws4signer/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/cloudflare/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/iceberg/pr:3054:62627d8
pnpm install https://pkg.alchemy.run/@distilled.cloud/gcp/pr:3054:62627d8

Published Nov 5, 2026, 6:18 AM UTC. Expires Nov 12, 2026, 6:18 AM UTC, extended while this pull request is open.

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