You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DCR for the Cloudflare portal: persist dynamic registrations and allowlist the portal callbacks #395
Restriction: good. POST https://api.mctl.ai/oauth/register with redirect_uris: ["https://evil.example/cb"] gets 400 invalid_redirect_uri ("redirect_uri "https://evil.example/cb\" is not allowed").
Blocker 1, the registry is in-memory.internal/auth/oauth_server.go (around line 431) says: "the registry below is in-memory, so a restart drops the registration while the client keeps its cached client_id". In automatic mode the portal registers once and caches the client_id. Every mctl-api rollout would then leave the portal with an unknown client (invalid_client), and the api upstream would stop working until someone re-authenticates it in the dashboard.
Blocker 2, callbacks not allowlisted.OAUTH_ALLOWED_REDIRECT_URIS is not set in services/admins/mctl-api/values.yaml, so the defaults apply (glama, smithery, chatgpt). The portal's DCR registration carries both:
Persist dynamically registered clients, for example alongside the existing RefreshStore, so a registration survives restarts. Consider idempotency per redirect set, as in seerrsense#75, to bound the rows.
Allowlist the two portal callbacks above. Use exact entries, not a dash.cloudflare.com/* prefix.
A DCR client that names no scope gets mctl, the only scope.
Acceptance
After a mctl-api rollout, a DCR client registered before it still resolves. Then the api portal upstream can be switched to automatic in #1363.
Activity