Skip to content

Register read and write for a dynamic registration that names no scope - #3319

Merged
jeremy merged 1 commit into
mainfrom
fix/dcr-unscoped-read-write
Nov 19, 2026
Merged

jeremy merged 1 commit into
mainfrom
fix/dcr-unscoped-read-write

Conversation

@jeremy

@jeremy jeremy commented Nov 19, 2026

Copy link
Copy Markdown
Member

A client metadata document that names no scope is provisioned with read write (document.rb), so the consent screen offers both levels and the person picks. Dynamic registration gave the same client read alone, through Oauth.canonical_scope("").

The hosted MCP server's 401 challenge names scope="read write". A client that registered with no scope and then authorized with that scope was refused invalid_scope (validate_scope → Client#allows_scope?), before the person saw the consent screen.

  • Oauth::ClientsController#validated_scopes: a registration that names no scope, counting offline_access as none (as Oauth.requested_scopes already does), registers read write, the same default as a metadata document.
  • A registration that names only scopes Fizzy doesn't issue still registers read, as before.
  • Tests: an unscoped registration (absent, blank, offline_access only, empty list) registers read write and its consent screen offers both levels with read write preselected; the first fails on main with Expected: "read write" Actual: "read". A second pins the unknown-scopes case.

Clients already registered with no scope keep read. They can't be told apart from clients that asked for read, so they aren't widened. One refused this way never reached consent, so the unauthorized-registration sweep removes it within a day, and the client registers again.

A client metadata document that names no scope is provisioned with read and
write, so the consent screen offers both and the person picks. Dynamic
registration gave the same client read alone: an MCP client that registers
before it knows what it will ask for, then authorizes with the "read write"
its server's challenge names, was refused invalid_scope.

A registration naming no scope (offline_access names none) now gets both, as
a metadata document does. One naming only scopes Fizzy doesn't issue still
gets read.
Copilot AI balanced review requested due to automatic review settings November 19, 2026 01:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

No active review issues were identified for the OAuth scope-default update.

No open issues 🎉

What changed in this PR

Aligns OAuth dynamic client registration with client metadata documents: clients that name no scope receive read write, allowing users to choose either access level on the consent screen.

Changes:

  • Defaults absent, blank, empty-list, and offline_access-only scopes to read write.
  • Preserves the read default for registrations naming only unsupported scopes.
  • Adds integration coverage for registration defaults and consent-screen choices.

Existing registrations remain unchanged.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
test/​integration/​oauth_flow_test.rb Tests scope defaults and consent-screen options.
app/​controllers/​oauth/​clients_controller.rb Uses metadata-document defaults when no scope is requested.

Review effort: Balanced

@jeremy
jeremy merged commit be11c24 into main Nov 19, 2026
14 checks passed
@jeremy
jeremy deleted the fix/dcr-unscoped-read-write branch November 19, 2026 02:02
hermes-handy added a commit to handy-la/fizzy that referenced this pull request Nov 22, 2026
Trae de upstream:
- Fija fizzy-mcp-server v0.2.6 y después v0.2.7 en el despliegue SaaS (basecamp#3316, basecamp#3322).
- Termina la vista previa de connected apps en producción (basecamp#3296).
- Un registro dinámico de OAuth sin scope registra read y write; uno que
  nombra sólo scopes desconocidos registra read (basecamp#3319).
- La pantalla de consentimiento OAuth se carga completa, para que Authorize
  pueda redirigir a la app después de iniciar sesión (basecamp#3321).
- Ruby 4.0.10 en .ruby-version, Dockerfiles y CI (basecamp#3320).
- El modo SaaS registra la ubicación de visitante de Cloudflare como
  client.geo (basecamp#3324).
- Puma permite GC de marcado completo durante las peticiones (basecamp#3327).
- Dependabot: aws-sdk-s3 1.242.0, surfguard bcce49e, acciones de GitHub,
  mittens 0.3.5, bootsnap 1.26.1, tzinfo-data 1.2026.6 y solid_queue 1.7.2.

Conflicto sólo en Gemfile.lock: se conservan las gemas de Handy (faraday y
sus dependencias, de ruby_llm) y la plataforma ruby de ffi de upstream.
`bundle lock` con Ruby 4.0.10 no cambia el archivo. No toca
personalizaciones de Handy.
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.

2 participants