Skip to content

Pass access configuration to Router Worker - #15238

Merged
jamesopstad merged 1 commit into
mainfrom
james/access-dev-vite-plugin
Aug 17, 2026
Merged

jamesopstad merged 1 commit into
mainfrom
james/access-dev-vite-plugin

Conversation

@jamesopstad

Copy link
Copy Markdown
Contributor

Fixes #15204.

Follow up to #15211.

Honor access.dev when running Workers with @cloudflare/vite-plugin, so ctx.access.getIdentity() returns the configured identity.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bug fix

A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4617af0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/vite-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Aug 17, 2026
@workers-devprod
workers-devprod requested review from a team and penalosa and removed request for a team August 17, 2026 11:01
@workers-devprod

workers-devprod commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@github-actions

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@ask-bonk

ask-bonk Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Everything is fully consistent:

  • Access.dev type matches the wrangler config (aud, identity)
  • entryWorkerConfig?.access?.dev at line 162 correctly extracts the dev sub-object, matching the V4WorkerOptions.access shape ({ aud, identity })
  • The Router Worker is the correct target: it's the entry-facing routeTarget, so the entry worker injects the ACCESS_BLOB header, which propagates to the USER_WORKER (already configured via Pass access.dev through to Miniflare via unstable_getMiniflareWorkerOptions() #15211) where getIdentity() resolves
  • Test config, worker code, and assertions all align (correct key ordering, correct values)
  • Changeset is a valid patch for @cloudflare/vite-plugin

I've completed a thorough review of PR #15238. The change is small, well-scoped, and correct:

  1. access: entryWorkerConfig?.access?.dev correctly maps the wrangler access.dev config to the V4WorkerOptions.access field (which v4-convert.ts maps to internal dev.access).
  2. Targeting the Router Worker is correct — it's the entry-facing routeTarget, so miniflare's entry worker injects the ACCESS_BLOB header, which the Router Worker forwards to USER_WORKER (already access-configured via the prior PR Pass access.dev through to Miniflare via unstable_getMiniflareWorkerOptions() #15211), populating ctx.access where the test reads it.
  3. The test, worker code, wrangler config, and changeset are all consistent and correct.

No logic bugs, security issues, backward-compatibility violations, or incorrect API behavior found.

LGTM

github run

@pkg-pr-new

pkg-pr-new Bot commented Aug 17, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@15238

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15238

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15238

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@15238

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@15238

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@15238

miniflare

npm i https://pkg.pr.new/miniflare@15238

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15238

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@15238

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@15238

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@15238

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@15238

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@15238

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@15238

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@15238

wrangler

npm i https://pkg.pr.new/wrangler@15238

commit: 4617af0

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Aug 17, 2026
@jamesopstad
jamesopstad merged commit 3a4fc6b into main Aug 17, 2026
70 of 71 checks passed
@jamesopstad
jamesopstad deleted the james/access-dev-vite-plugin branch August 17, 2026 11:56
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Aug 17, 2026
@togana

togana commented Aug 17, 2026

Copy link
Copy Markdown

@jamesopstad Thanks for fixing this! Really appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

When using @cloudflare/vite-plugin, access.dev (a local simulation of ctx.access) does not work

4 participants