Skip to content

fix(auth): add missing profile scope for people/me verification - #120

Merged
rianjs merged 2 commits into
mainfrom
fix/119-missing-profile-scope
May 13, 2026
Merged

fix(auth): add missing profile scope for people/me verification#120
rianjs merged 2 commits into
mainfrom
fix/119-missing-profile-scope

Conversation

@rianjs

@rianjs rianjs commented May 13, 2026

Copy link
Copy Markdown
Contributor

What

Adds people.UserinfoProfileScope (https://www.googleapis.com/auth/userinfo.profile) to AllScopes and ScopeDescriptions in internal/auth/auth.go.

Why

gro init verifies each Google API after OAuth by making a live call. The People API verification calls people/me with PersonFields("names,emailAddresses") — this also powers gro me. Google requires the userinfo.profile scope for this endpoint; the contacts scope only grants access to the user's contacts list, not their own profile.

Without this fix, gro init always exits with a 403 on the People API verification step:

Error: verifying People API: googleapi: Error 403: The caller does not have permission
to request "people/me". Request requires one of the following scopes: [profile].

This makes fresh credential setup completely broken for anyone following the setup instructions.

Migration

Existing users with a stored token will need to re-authenticate after upgrading:

gro config clear && gro init

Closes #119

rianjs added 2 commits May 13, 2026 14:56
gro init calls people/me with PersonFields("names,emailAddresses") to
verify the People API and power `gro me`. The contacts scope covers
the contacts list but not the authenticated user's own profile — Google
requires userinfo.profile for that endpoint.

Without this scope, gro init always fails with a 403 on the People API
verification step, making fresh credential setup impossible.

Closes #119
Update the hardcoded count in TestAllScopes (6→7) and add the scope
assertion. Add userinfo.profile to the architecture test allowlist with
a note that it is read-only and scoped to the authenticated user's own
profile, not the contacts list.
@rianjs

rianjs commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

Findings

  • Blocker - CI guardrails still reject the new scope. internal/auth/auth.go:35 adds people.UserinfoProfileScope, but internal/auth/auth_test.go:104 still expects exactly 6 scopes, and internal/architecture/architecture_test.go:312 does not include https://www.googleapis.com/auth/userinfo.profile in allowedScopes. As written, the auth and architecture tests will fail. Update both test guardrails, and use that architecture allowlist entry to document why this profile scope is non-destructive/read-only.

Notes

The production scope choice looks correct. Google’s People API docs show people/me with personFields=names,emailAddresses, and the people.get reference lists https://www.googleapis.com/auth/userinfo.profile as an accepted private-data scope: https://developers.google.com/people/v1/profiles and https://developers.google.com/people/api/rest/v1/people/get

CheckScopesMigration should pick this up automatically because it iterates auth.AllScopes; no extra migration logic appears necessary. In this checkout, docs/google-cloud-setup.md already mentions the profile scope.

@rianjs
rianjs merged commit a39aaa2 into main May 13, 2026
2 checks passed
@rianjs
rianjs deleted the fix/119-missing-profile-scope branch May 13, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: gro init fails with 403 on People API verification — missing profile scope

1 participant