The OpenID configuration lists only the scopes the forge grants, and the MCP signup tool says what the setting does #46

Merged
grokbot merged 6 commits from dev/stale-signup-admin-scope into main 2026-10-18 03:55:59 +00:00
Owner

Problem. /.well-known/openid-configuration listed the scope admin. /oauth/authorize never grants it. The MCP signup tool said "Nothing reads it yet", but #2245 made the doors read the setting.

Root cause. The discovery documents wrote the scopes as literals, apart from the type that decides what authorize grants. The tool text was not changed with #2245.

Fix.

  • OAUTH_SCOPES = ["ro", "rw"] as const in core/oauth.ts defines OAuthScope and isOAuthScope. The three discovery documents list OIDC_SCOPES and OAUTH_SCOPES from those constants, so they cannot list a scope that authorize does not grant.
  • The MCP signup tool says what the setting does: open lets anyone in; invite and closed refuse a new account (invite links are not redeemed yet); the first account is never refused.

Test. test/oauth-discovery.test.ts expects scopes_supported to be exactly openid profile email ro rw. test/mcp.test.ts checks the signup tool text. On main: both fail. With the fix: both pass.

Validate (fast). Result: baseline. contain.test.ts, studio-runs.test.ts and web-origins.test.ts also fail on main 1051d451 on this box. tsc passes.

Note: if the invite PR (L1) lands, the words "invite links are not redeemed yet" must change. The PR that lands second changes them.

**Problem.** `/.well-known/openid-configuration` listed the scope `admin`. `/oauth/authorize` never grants it. The MCP `signup` tool said "Nothing reads it yet", but #2245 made the doors read the setting. **Root cause.** The discovery documents wrote the scopes as literals, apart from the type that decides what authorize grants. The tool text was not changed with #2245. **Fix.** - `OAUTH_SCOPES = ["ro", "rw"] as const` in `core/oauth.ts` defines `OAuthScope` and `isOAuthScope`. The three discovery documents list `OIDC_SCOPES` and `OAUTH_SCOPES` from those constants, so they cannot list a scope that authorize does not grant. - The MCP `signup` tool says what the setting does: open lets anyone in; invite and closed refuse a new account (invite links are not redeemed yet); the first account is never refused. **Test.** `test/oauth-discovery.test.ts` expects `scopes_supported` to be exactly `openid profile email ro rw`. `test/mcp.test.ts` checks the `signup` tool text. On main: both fail. With the fix: both pass. **Validate (fast).** Result: baseline. `contain.test.ts`, `studio-runs.test.ts` and `web-origins.test.ts` also fail on main 1051d451 on this box. tsc passes. Note: if the invite PR (L1) lands, the words "invite links are not redeemed yet" must change. The PR that lands second changes them.
The OpenID configuration lists only the scopes the forge grants, and the MCP signup tool says what the setting does
Some checks failed
check / gate (2) (pull_request) Successful in 3m31s
preview / preview (pull_request) Failing after 1m10s
check / gate (3) (pull_request) Successful in 4m11s
check / gate (1) (pull_request) Successful in 9m57s
check / check (pull_request) Successful in 0s
738f40b1ab
Merge remote-tracking branch 'origin/main' into dev/stale-signup-admin-scope
All checks were successful
check / gate (2) (pull_request) Successful in 3m27s
preview / preview (pull_request) Successful in 26s
check / gate (3) (pull_request) Successful in 4m18s
check / gate (1) (pull_request) Successful in 10m3s
check / check (pull_request) Successful in 0s
bb24c8827c
Merge branch 'main' into dev/stale-signup-admin-scope
Some checks failed
preview / preview (pull_request) Failing after 2m13s
check / gate (2) (pull_request) Successful in 6m34s
check / gate (1) (pull_request) Successful in 11m7s
check / gate (3) (pull_request) Successful in 15m55s
check / check (pull_request) Successful in 1s
6490dba59c
Merge origin/main (#58 preview on the droplet runner, #59, #60) into dev/stale-signup-admin-scope
All checks were successful
check / gate (2) (pull_request) Successful in 3m32s
check / gate (3) (pull_request) Successful in 4m25s
check / gate (1) (pull_request) Successful in 10m23s
preview / preview (pull_request) Successful in 21s
check / check (pull_request) Successful in 1s
2316fe3e8a
Merge origin/main (#42 sign-in throttle, release 0.7.165) into dev/stale-signup-admin-scope
All checks were successful
check / gate (2) (pull_request) Successful in 3m36s
check / gate (3) (pull_request) Successful in 4m27s
check / gate (1) (pull_request) Successful in 21m57s
check / check (pull_request) Successful in 0s
preview / preview (pull_request) Successful in 19s
ee9e9234ed
grokbot deleted branch dev/stale-signup-admin-scope 2026-10-18 03:55:59 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
trevato-apps/forge!46
No description provided.