Repository navigation
fix: let the Cloudflare token create Polylane alert subscriptions - #142
Conversation
The read-only token link changed every edit grant to read, so the token had Notifications Read and Workers Observability Read. Polylane then got 403 when it created the webhook destination for a new account, and no account connected from the CLI got Workers issues or alerts. The link now keeps edit on these two groups only. This matches nominal PR #6405. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Polylane could not verify the production impact of this pull request. This change only edits the permission list in the Cloudflare token URL the CLI builds, so no deployed resource runs the new code and existing account tokens stay as they are. The affected accounts stayed steady over 72h: coreplane-prod served 299k–800k Worker requests per hour at 34–52 errors per hour (mean 419k requests, 41 errors).
Also considered · 3 refuted
Analysed against 8 cloud accounts and 1 repository
Polylane could not find the cloud resources this repository manages, so this review looked at the entire cloud account. Connect this repository to its resources and the next review will focus on exactly what this code deploys to. Polylane analysed |
boristane
left a comment
There was a problem hiding this comment.
LGTM: The token transform preserves edit only for the two intended alert-subscription groups, and the wizard accurately names those exceptions.
Reviewed the full diff, traced the affected callers, compared the two-grant exception with nominal#6405, and made a second pass over the permission transform and interactive/headless token paths. No blocking findings. The connect request still sends readOnly: true; existing tokens are unaffected. The updated test checks both required edit grants and rejects other non-read grants in the default read-only URL.
Local verification on Node v22.23.4:
npm ci: passed.npm run codegen: passed against the live API spec.npm run typecheck: reproduced the two reported IntegrationType/conductor errors atsrc/commands/integration/connect.ts:422and:1497. That file is unchanged from the PR base; these are unrelated to this diff.npm run lint: passed.npm run test: 622 passed, 0 failed.git diff --check: passed.
The production count of 15 affected accounts is not independently verifiable from this code review. End-to-end destination/policy creation remains unverified and depends on the companion backend deployment and a live Cloudflare account, as the PR notes.
The Cloudflare token link that the CLI opens now keeps edit on Notifications and Workers Observability. Every other permission stays read. With the old link, Polylane could not create alert subscriptions, so no account connected from the CLI got Workers issues or alerts.
Why: In prod, 15 Cloudflare accounts connected from the CLI (
origin: cli) have the alerts flag set and no webhook destination. Creating a webhook destination or a notification policy needs Notifications Write. The Workers Issues automation and alerts need Workers Observability Write. This copy of the token link changed both to read. Nominal makes the same change in coreplanelabs/nominal#6405.Where to look
editfor the two alert subscription keys. ⚠ It must stay the same as nominal'spackages/util/cloudflare-token-url.ts.Feedback wanted: Is the wizard note clear about what Polylane can change in the account?
Risk: A new CLI token can create and delete notifications and Workers observability alerts in the customer's account. Tokens that already exist do not change. Roll back with a revert.
Verified:
npm testpasses (622).npm run lintpasses.npm run typecheckhas 2 errors insrc/commands/integration/connect.tsfrom the generated client'sIntegrationType; this change does not touch that file.Decisions (1)
readOnly: truein Polylane, and agent tool writes stay blocked. Only the alert setup that Polylane runs on connect needs these two groups.Validation (3 criteria)
notificationsandworkers_observabilitytest/cloudflare-token-url.test.tsnpm test: 622 pass, 0 fail🤖 Generated with Claude Code