Skip to content

docs: correct the Workers Routes permission claim - #440

Merged
neuromechanist merged 1 commit into
developfrom
fix/issue-439-route-token
Sep 22, 2026
Merged

neuromechanist merged 1 commit into
developfrom
fix/issue-439-route-token

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Corrects a comment in workers/osa-worker/wrangler.toml that I introduced in #438 and that the first deploy after that merge proved false.

What it said

The Trap 2 note concluded that zone access was not a concern here, on the reasoning that secrets.CLOUDFLARE_API_TOKEN already provisions custom domains on osc.earth for the status and branch deployments.

What is actually true

That reasoning does not transfer. Pages custom domains, zone DNS records and Zone:Workers Routes:Edit are three separate grants, and the token holds the first two but not the third.

Run 35687023452, the first Sync Worker CORS after #438 merged:

Trigger configuration for "osa-worker-dev" was only partially updated:
  Routes:
    - A request to the Cloudflare API (.../workers/scripts/osa-worker-dev/routes) failed.
      - No access to the specified resource.

Two details worth recording, both non-obvious:

  • The script upload succeeds, so the code goes live and only route reconciliation fails. The merged host-gating fix from fix: route widget through widget.osc.earth/osa, not workers.dev #438 is verifiably running right now despite the red job.
  • Pre-registering a route by hand does not make the job pass. Wrangler fails reconciling a route that already matches, which is why dev still fails even though develop-widget.osc.earth/osa works.

This is documentation only

No behavior changes. The underlying permission gap is tracked as #439 and needs a token change, which is not something a pull request can carry.

Closes nothing. Related: #437, #438, #439.

The Trap 2 note said zone access was not a concern here, reasoning that
CLOUDFLARE_API_TOKEN already provisions custom domains on osc.earth. That
reasoning does not transfer: Pages custom domains, zone DNS and
Zone:Workers Routes:Edit are three separate grants, and the token holds
the first two but not the third.

The first deploy after #438 merged proved it. sync-cors now fails on
every push touching this directory, and the production route has never
been registered, so widget.osc.earth/osa still answers 522.

Records what actually happened, including that pre-registering a route by
hand does not make the job pass, since wrangler fails reconciling a route
that already matches.
@neuromechanist
neuromechanist merged commit 6d978ed into develop Sep 22, 2026
9 checks passed
@neuromechanist
neuromechanist deleted the fix/issue-439-route-token branch September 22, 2026 04:35
neuromechanist added a commit that referenced this pull request Sep 22, 2026
Brings the widget-hostname work (#437, #438, #440, #441) and the release
hardening (#443) onto the epic branch. Two conflicts, both real rather
than textual.

workers/osa-worker/index.js: phase 1 matched its routes against the raw
url.pathname, which predates develop's host-gated stripMountPrefix. Left
as merged, every phase 1 route would have 404'd on widget.osc.earth
while ordinary chat worked, so the two-run continuation would have been
broken on the mounted host only. Both communityAction and
communityChatResume now match the stripped pathname; the named
ROUTE_PATTERNS constants from phase 1 are kept.

workers/osa-worker/test-routing.js: both branches created this file
independently. Develop's version drives the real exported fetch handler,
phase 1's asserted against the regex constants in isolation. Kept
develop's, because a test that matches a pattern by hand cannot catch a
route wired to the wrong variable, which is exactly the bug above. Phase
1's resume coverage is re-added in that style, driving the real handler
prefixed and unprefixed.

The workflow conflicts were duplicate steps; develop already runs the
routing test in the same job.

Tested: 102 routing, 10 mounted-hosts, 13 endpoint, ruff clean, 2483
pytest passed. Note that a fresh worktree resolves Python 3.14, where
langfuse's pydantic.v1 usage fails at collection; pin 3.12 to match CI.
neuromechanist added a commit that referenced this pull request Sep 30, 2026
The file had sections for 0.8.10, 0.8.12, 0.8.14 and 0.8.15 only. The
three missing releases are written from the pull requests between their
tags (0.8.13: #438, #440, #441, #443; 0.8.11: #418; 0.8.9: #351 to #355
and #359 and #367), so the last seven releases are now all present.

Tested: docs only; each entry checked against its pull request's body.
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