Add project-scoped OAuth authorization - #138
Open
masnwilliams wants to merge 9 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
i dont know too much about ts, so take it or leave it:
the behavior and test coverage are headed in the right direction, but these are authorization boundaries and long-lived flows. i’d rather simplify and harden the structure now than preserve the added incidental complexity. |
masnwilliams
force-pushed
the
hypeship/project-scoped-oauth
branch
from
August 10, 2026 17:27
47f1631 to
1d265ac
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1d265ac. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

summary
tests
bun test(170 passing)bun run buildwith test build-time configurationdependency
Requires kernel/kernel#3165 to be deployed before this change writes structured OAuth contexts.
Note
High Risk
Changes authentication, token issuance, refresh rotation, and authorization boundaries; incorrect context handling could widen or break access for existing clients.
Overview
Adds organization-wide vs single-project OAuth grants. Users pick scope on
/select-org(with searchable project list when the client uses PKCE S256);/authorizevalidates membership, enforces PKCE for shared clients and project scope, verifies active projects via the Kernel API, and stores a versioned authorization context in Redis (PKCE-bound request keys or legacy client-id mapping).The token endpoint resolves scope only from stored context—client-supplied
org_id/access_scope/project_idare stripped before Clerk—and returnsorg_id,access_scope, and optionalproject_id. JWT and refresh mappings persist the full context; refresh keeps project scope and rejects escalation. Legacy Redis values that are plainorg_*IDs still decode as organization-wide access.New
GET /oauth/projectssupports the picker; README notes project-scoped tokens cannot switch projects.Reviewed by Cursor Bugbot for commit 478cd7b. Bugbot is set up for automated code reviews on this repo. Configure here.