Skip to content

feat(oauth): re-land explicit scopes now that Code ceilings are seeded - #3974

Open
MattBro wants to merge 1 commit into
mainfrom
matt/oauth-reland-explicit-scopes
Open

feat(oauth): re-land explicit scopes now that Code ceilings are seeded#3974
MattBro wants to merge 1 commit into
mainfrom
matt/oauth-reland-explicit-scopes

Conversation

@MattBro

@MattBro MattBro commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Problem

PostHog Code still requests scope=* at sign-in. That blocks retiring the wildcard server-side and keeps the desktop token full-privilege.

#3411 shipped an explicit scope list (plus llm_gateway:read) and bumped OAUTH_SCOPE_VERSION, but the US/EU Code OAuth app ceilings were not seeded yet. Fresh sign-ins hit invalid_scope, so #3668 reverted to *. Seeding + *→ceiling narrowing are now live in both regions, so the client change is unblocked.

Changes

  • OAUTH_SCOPES: regenerate from live scopes_supported on us.posthog.com (203 scopes, includes loop:* and scopes added after feat(desktop): Implement loops ➿ #3411) plus privileged llm_gateway:read last. Drops agents:* / agent_approvals:*, which left the advertised set.
  • OAUTH_SCOPE_VERSION 5 → 6 so existing installs re-authorize onto the narrower set.
  • Comment on OAUTH_SCOPES documents the deploy-order guardrail (seed ceiling in US+EU before shipping a non-* client / version bump) so this doesn't get bundled again without the seed.
  • Restore structural tests (no dups, llm_gateway:read last, well-formed strings) + fingerprint guard.

Preconditions (already done)

  1. #70538 *→ceiling narrowing deployed US+EU
  2. Code app ceilings seeded to ["@default", "llm_gateway:read"] in US+EU
  3. Verified: real * sign-in narrowed correctly in US; zero invalid_scope from this path

How did you test this?

  • pnpm --filter @posthog/shared test — 767 passed, including oauth.test.ts (fingerprint + structural guards)
  • Pre-commit pnpm typecheck clean

Related

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Request the live scopes_supported set plus llm_gateway:read instead of
"*", and bump OAUTH_SCOPE_VERSION 5 → 6 so installs re-authorize.

The Jul 22 revert (#3668) was required because #3411 shipped the explicit
list before US/EU OAuth app ceilings were seeded. Both Code apps are now
seeded to [@default, llm_gateway:read] and *→ceiling narrowing is live,
so the client change is unblocked.

Regenerated from us.posthog.com scopes_supported (203 scopes, includes
loop:* and post-#3411 additions); drop agents:* which left the advertised
set. Comment documents the seed-before-release guardrail so it doesn't
get bundled again without the ceiling.
@trunk-io

trunk-io Bot commented Jul 29, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit c779e4d.

@greptile-apps

greptile-apps Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(oauth): re-land explicit scopes now..." | Re-trigger Greptile

@MattBro
MattBro requested a review from charlesvien July 29, 2026 22:10
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.

1 participant