Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ss.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
selfie-bot
approved these changes
Nov 20, 2026
selfie-bot
left a comment
Collaborator
There was a problem hiding this comment.
OPERATIONS.md step 2 of setting up ("Create the R2 bucket, with its r2.dev access left off") still cites docs/specs/access.md → Serving images. The rule now lives under Who can do what, so that pointer should move there too. It's outside the diff, so there's no inline suggestion for it.
|
|
||
| /** Every R2 bucket `wrangler.toml` binds. */ | ||
| function bucketNames() { | ||
| const names = [...readFileSync("wrangler.toml", "utf8").matchAll(/^bucket_name = "([^"]+)"$/gm)].map(([, name]) => name); |
Collaborator
There was a problem hiding this comment.
This is the one place the check can pass without having looked. A second [[r2_buckets]] written as bucket_name="x", indented, or with a trailing comment doesn't match, and its bucket is skipped without an error. The length === 0 guard only catches the case where every bucket is missed. A looser match keeps the check fail-closed for those spellings:
Suggested change
| const names = [...readFileSync("wrangler.toml", "utf8").matchAll(/^bucket_name = "([^"]+)"$/gm)].map(([, name]) => name); | |
| const names = [...readFileSync("wrangler.toml", "utf8").matchAll(/^\s*bucket_name\s*=\s*["']([^"']+)["']/gm)].map(([, name]) => name); |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs/specs/access.mdrequires that every image is served by the Worker after an access check, so the bucket'sr2.devURL and custom domains stay off. Nothing checked that. Nowpreflight, which already checks the Hyperdrive and the Worker's secrets, reads everybucket_nameinui/wrangler.tomland fails the release if any of those buckets has itsr2.devURL on or a custom domain. A response of an unexpected shape fails too, rather than passing.The rule moves above the fold in
access.md, into Who can do what, since it's enforced now. The rest of Serving images stays under## Future.The deploy token has had Workers R2 Storage Read since #88. Tested with a real
preflightagainst the account, using wrangler's login token:The responses it reads are
{"enabled": false, …}and{"domains": []}. The first release after merging will be the first run with the deploy token itself.🤖 Generated with Claude Code