Repository navigation
Show native OAuth project limits in auth status - #325
Open
masnwilliams wants to merge 3 commits into
Open
masnwilliams wants to merge 3 commits into
masnwilliams wants to merge 3 commits into
Conversation
yummybomb
reviewed
Nov 22, 2026
yummybomb
left a comment
Contributor
There was a problem hiding this comment.
two credential issues to address:
pkg/auth/storage.go:28—projectscan push credentials past the windows keyring's 2,560-byte limit. login reports success after saving to disk, but the next command still reads the old keyring entry. make the successful fallback authoritative.cmd/auth.go:181— project-limited native logins saved by older cli versions still showorganization-wideuntil refresh. show the scope as unknown when it wasn't recorded, and point users tokernel login --force.
yummybomb
requested changes
Nov 22, 2026
…d show an unrecorded scope as unknown
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 26a80d1. Configure here.
Contributor
Author
|
@yummybomb thanks, both addressed (26a80d1, 08ad67f):
|
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
kernel auth statusdecides its "Access scope" line from the token response'saccess_scopeandproject_id. Tokens from the native authorization server limit a grant to chosen projects through its policy and list them in a separateprojectsfield, withaccess_scope: organizationand noproject_id. The CLI ignored that field, so a sign-in limited to one project showed "organization-wide". Enforcement was already correct; only the display was wrong.projectsfrom the token response on login, and keep it across refreshes that omit it.auth statusshowsproject <id>for one project,projects <id>, <id>for several, andorganization-wideonly when the grant isn't limited.access_scope: project) display as before.Testing
go test ./pkg/auth/ ./cmd/: new tests for storing projects on exchange and keeping them on refresh, and for the scope label.Note
Medium Risk
Changes OAuth token persistence and credential load/save behavior; display-only scope risk is low but wrong merge of keyring/file could surface stale tokens.
Overview
kernel auth statusnow reports access scope from storedprojectsandScopeRecorded, not only legacyaccess_scope/project_id. Native org-scoped grants limited to specific projects showproject <id>orprojects <id>, …>instead of always organization-wide; older credentials without recorded scope show an unknown message promptingkernel login --force.On login and refresh, the CLI persists
projectsfrom the token response, setsScopeRecordedwhenaccess_scopeis present, and keeps project lists when refresh responses omitprojects.Token storage adds
SavedAt, resolves keyring vs. credentials file by picking the newer copy (expiry fallback for older saves), clears stale keyring entries on file fallback, and removes the file when keyring saves succeed again—supporting larger payloads (e.g. project lists) when the OS keychain refuses them.Reviewed by Cursor Bugbot for commit 08ad67f. Bugbot is set up for automated code reviews on this repo. Configure here.