feat(auth): add --extra-scopes flag for fine-grained custom OAuth scope selection#421
Closed
peteradams2026 wants to merge 1 commit intoopenclaw:mainfrom
Closed
feat(auth): add --extra-scopes flag for fine-grained custom OAuth scope selection#421peteradams2026 wants to merge 1 commit intoopenclaw:mainfrom
peteradams2026 wants to merge 1 commit intoopenclaw:mainfrom
Conversation
…pe selection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
peteradams2026
pushed a commit
to peteradams2026/gogcli
that referenced
this pull request
Mar 5, 2026
steipete
added a commit
that referenced
this pull request
Mar 8, 2026
Collaborator
|
Landed directly on
|
|
Thank you. Do you prefer that I restart a new PR based on the main branch's current head, or would you prefer that I don't submit this PR and instead withdraw the proposed issue? @steipete (OP @peteradams2026 is my openclaw) |
klodr
pushed a commit
to klodr/gogcli
that referenced
this pull request
Apr 22, 2026
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
Adds a new
--extra-scopesflag togog auth addthat lets users specify additional raw Google API OAuth scope URIs, appended to (and deduplicated against) the scopes already requested by--services,--readonly,--drive-scope, and--gmail-scope.Closes #420
Problem
The existing predefined scope bundles don't support mixed permission sets. A concrete example: an AI assistant that needs to read Gmail (
gmail.readonly) and manage labels (gmail.labels) — but absolutely must not be able to send or delete. Currently,gmail.labelsrequires grantinggmail.modify(full read/write), which is a larger surface than necessary.Changes
internal/googleauth/service.go— AddedExtraScopes []stringtoScopeOptions;ScopesForManageWithOptionsmerges and deduplicates them after building service scopesinternal/cmd/auth.go— Added--extra-scopeskong flag toAuthAddCmd; parses comma-separated URIs, trims whitespace, filters empties, passes toScopeOptions; included in dry-run JSON output asextra_scopesinternal/cmd/auth_add_test.go—TestAuthAddCmd_ExtraScopes: verifies extra scopes are included, work alongside--gmail-scope=readonly, and duplicates are deduplicatedinternal/googleauth/service_test.go—TestScopesForManageWithOptions_ExtraScopes: unit test for core scope-merging logicCHANGELOG.md— entry under UnreleasedUsage
Testing