Repository navigation
Which OAuth scope authorizes the List Worker Deployments endpoint in Wrangler? #16586
Replies: 2 comments
|
I can't see Cloudflare's server-side mapping from OAuth scopes to API permission groups either, but here's what the Wrangler source does show, plus a way to narrow it down without widening anything you've granted. Wrangler's scope catalog is in
The endpoint docs list "Workers Scripts Read/Write" and "Workers Tail Read". By name, those correspond to The least-privileged scope that matches by name is the read-only
I haven't found an official scope-to-permission mapping. |
|
One important distinction: the endpoint’s OpenAPI x-api-token-group metadata lists accepted permission groups, but that alone does not establish how Wrangler OAuth scopes map to those groups. For this exact GET endpoint, the published specification accepts several groups, including Workers Tail Read, Workers Scripts Read, and Workers Scripts Write. The Wrangler scope catalog separately defines workers_tail:read and workers_scripts:write, but their descriptions are not an explicit authorization mapping. I would therefore avoid concluding that workers_tail:read is the documented minimum OAuth scope, or that workers:write is insufficient, until Cloudflare confirms the mapping. wrangler whoami can confirm which OAuth scopes were granted, but it does not demonstrate which permission group the API authorizer evaluated for this endpoint. Could Cloudflare clarify whether the OAuth scope-to-permission mapping is documented anywhere, and whether the endpoint’s accepted permission groups are evaluated identically for OAuth tokens and API tokens? A safe diagnostic can remain limited to the HTTP status and numeric API error code, as the original author requested. |
Uh oh!
There was an error while loading. Please reload this page.
In Wrangler 4.152.0 on Windows, an OAuth login with account:read, user:read, workers:write and d1:write (plus offline_access) can download an existing Worker using init --from-dash --no-delegate-c3, list secret names, and read D1 metadata. However, deployments status --json receives HTTP 403 on GET /accounts/{account_id}/workers/scripts/{script_name}/deployments.
The endpoint documentation lists accepted permissions including Workers Scripts Read/Write and Workers Tail Read. Wrangler describes workers:write broadly but also lists workers_scripts:write and workers_tail:read separately. We have not established their effective server-side mapping.
Does workers:write authorize this exact GET? If not, which least-privileged OAuth scope is documented as sufficient, and is there an official mapping from OAuth scopes to the endpoint permission names?
We are asking about authorization semantics, not reporting a confirmed scope defect. No extra permissions or deployment writes have been attempted. Please suggest a supported diagnostic limited to HTTP status and a numeric API error code; we will not post account identifiers, Worker names, credentials, headers, response bodies or logs.
All reactions