You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
auth status can report read_only: true while a preserved scope still grants write access #233
gws auth login and gws auth status report read_only: true when no service in the per-service access map holds a write scope. That map is derived from gws's own scope tables (internal/auth/scopes.go), so a scope outside those tables is not counted.
--add deliberately preserves every scope the stored login already holds, including ones gws does not itself request. So this sequence overstates the protection:
An older login holds gmail.readonly plus https://mail.google.com/ (full mailbox access, not in the built-in tables).
gws auth login --add --services tasks --readonly
Login and auth status report read_only: true, although the token still carries full Gmail access.
Where
allReadOnly and deriveGrantedAccess in cmd/auth.go
The complete granted scope list is already recorded in granted_access.json.
Suggested fix
Derive read_only from the complete granted scope list rather than from the access map alone: any granted scope that is not a known read-only scope (and not an identity scope) makes read_only false, or reports it as unknown. Add a regression test with a preserved scope outside the built-in tables.
Notes
Raised as a warning by the Codex review on #230 and deferred from v1.44.0. Only affects logins that carry scopes gws never requests.
Activity