Repository navigation
[workers-auth] Request user token scope for cf - #16557
Conversation
Include user-api-tokens.write in cf OAuth login defaults so users can list and manage user tokens after granting the sensitive scope. Existing grants require a fresh login.
🦋 Changeset detectedLatest commit: bf48bc7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
|
Hi @Kmschr. Thanks for taking the time to contribute to Workers SDK. This PR has been automatically closed because you are not currently a registered (vouched) collaborator for this repository. AI tools now let our team generate proposed code changes quickly. Reviewing changes, checking that they solve the right problem, and maintaining code quality over time still take substantial care and effort. We therefore limit PRs to registered collaborators so we can focus that effort where it is most useful. For the majority of external contributors, the most effective way to help is through issues: describing a problem or use case, providing a minimal reproduction, investigating its cause, or helping us verify a fix. Those contributions help us understand what needs to change and are very welcome. We will take an initial look at this PR and decide whether it is something we want to invest time in reviewing and maintaining. We may reopen it if we decide to proceed, but we cannot guarantee that it will be reopened or receive a full review. |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
|
This pull request's reviews are posted as pull request reviews: see the review of |
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/runtime-types
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
|
clanker review |
There was a problem hiding this comment.
✅ Approved — This is a single-scope addition with a matching regression test and a patch changeset. No issues were found.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🚀 Release: ✅ LGTM
Risk: Low. A patch changeset is included.
🔒 Security: ✅ LGTM
This change widens the default cf OAuth grant to include user API token management, which is the stated intent. The user has to consent to the new scope, and existing sessions need a fresh login before they get it. No exploitable issue was found.
📖 AGENTS.md: ✅ LGTM
The new test follows the repository's convention of taking expect from the test context.
📋 Code Quality: ✅ LGTM
user-api-tokens.write is added in sorted position. It flows into CF_REQUESTABLE_SCOPES, DefaultScopeKeys and validateScopeKeys. The test count updates (482 → 483, 476 → 477) match the single scope added.
⚡ Performance: ✅ LGTM
No performance concerns.
📝 Documentation: ✅ LGTM
The changeset describes the change and tells users with an existing session to log in again.
Reviewed commit: bf48bc79
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
cf OAuth login omits
user-api-tokens.write, so user API token listing and management can fail with 403 responses. Include the scope in cf's registered catalog and default login scopes now that the OAuth client supports it.The regression test checks the cf descriptor's login defaults and scope validation, and the catalog counts are updated. A patch changeset is included. Users with an existing OAuth session need to log in again and grant the sensitive scope.
Validation:
pnpm -w test:ci -F @cloudflare/workers-auth: 204 passed, 6 credential-store integration tests skipped.pnpm check:type -F @cloudflare/workers-auth: passed.A picture of a cute animal (not mandatory, but encouraged)