auth login --services: cloud-platform is re-added after being deselected in the scope picker
Maintainers usually reply within 1 day
Nobody has claimed this yet.
- #929 by @grep999 — closed without merging
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- authentication, cli, security
Research direction
Start by reproducing gws auth login --services gmail and inspect the auth login scope-picker flow that builds the authorize URL. Trace how picker state becomes the final scope list, then verify that deselecting cloud-platform and other scopes removes them from the URL while the selection counter remains accurate.
Written by the indexing model from the issue text.
Description
Version: gws 0.22.5 (@googleworkspace/cli via npm), node v20.11.1, Linux 6.8.0
auth login --services <svc> opens the scope picker. Scopes deselected in the picker can still end up in the authorize URL. cloud-platform is preselected and is re-added regardless of the selection.
Repro
gws auth login --services gmail- In the picker, deselect everything except
gmail.send. Header readsSelect OAuth scopes 1/17 selected. - Enter.
- Read the printed authorize URL.
scope= contains:
https://www.googleapis.com/auth/gmail.send
https://www.googleapis.com/auth/cloud-platform <- deselected at step 2
openid
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile
Expected: no cloud-platform.
--scopes is unaffected and produces exactly what is asked for:
$ gws auth login --scopes https://www.googleapis.com/auth/gmail.send
scope=https://www.googleapis.com/auth/gmail.send openid \
https://www.googleapis.com/auth/userinfo.email \
https://www.googleapis.com/auth/userinfo.profile
Impact
cloud-platform grants read, write and delete across the user's Google Cloud resources. Someone who opens the picker to narrow scopes, sees 1/17 selected, and consents, grants it anyway. The counter reports the intended selection, so nothing on screen shows the grant is wider than chosen. The authorize URL is the only place the real scope list appears, and it is long enough to wrap in a terminal.
gmail.readonly (restricted, full mailbox read) is also preselected via the Recommended (Core Consumer Scopes) entry.
Also
Toggling Recommended (Core Consumer Scopes) off moves the counter from 9/17 to 8/17 but leaves the eight individual scopes checked, cloud-platform among them. Each has to be deselected separately. If the row is meant to act as a group toggle, that is a second bug; if it is just another checkbox, the name reads like a group.
Suggested fix
Build the authorize URL from picker state, or print the resolved scope list for confirmation before opening the browser. The second is useful on its own: right now checking what you are about to grant means parsing a URL by eye.
- Dominant language
- Rust
- Stars
- 32.3k
- Forks
- 2k
- Avg merge
- 16h 3m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from googleworkspace/cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
googleworkspace/cli#984 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
googleworkspace/cli#983 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
googleworkspace/cli#958 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
googleworkspace/cli#921 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
googleworkspace/cli#920 ·
Maintainers usually reply within 1 day
All issues in googleworkspace/cli
Similar issues
-
area:cli area:security bug priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
status: new topic: ga4gh-sdk type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
comp-rbac
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ClickHouse/ClickHouse#131875 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
bug(python): read_transaction raises TypeError on a Rewrite with rewritten indicesPossibly taken @Borg93 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
lance-format/lance#11117 ·
Maintainers usually reply within 2 days