Skip to content

fix: use current Google Health write-only scopes - #9

Open
doziedotdev wants to merge 1 commit into
Google-Health-API:mainfrom
doziedotdev:fix/current-writeonly-oauth-scopes
Open

fix: use current Google Health write-only scopes#9
doziedotdev wants to merge 1 commit into
Google-Health-API:mainfrom
doziedotdev:fix/current-writeonly-oauth-scopes

Conversation

@doziedotdev

Copy link
Copy Markdown

Summary

  • replace the six obsolete unsuffixed Google Health write scopes with their current .writeonly names
  • label those scopes as write-only rather than read/write, since Google now separates read and write authorization
  • add a regression test that requires every current write-only scope and rejects the obsolete names

Problem

A token authorized with googlehealth.health_metrics_and_measurements was issued successfully, but a weight create request failed with HTTP 403 insufficient authentication scopes. Google's live Health API discovery document and current scope table require googlehealth.health_metrics_and_measurements.writeonly alongside the corresponding readonly scope.

The same rename applies to activity/fitness, sleep, nutrition, profile, and settings. This PR is a focused follow-up to the scope portion of closed draft #7; it intentionally excludes the separate nutrition-log feature.

Existing credentials do not gain renamed scopes automatically. Users who need writes must reauthorize with the applicable .writeonly scope.

Validation

  • go test ./...
  • go vet ./...
  • go build -trimpath ./...
  • generated schema scopes output contains all six .writeonly scopes and no obsolete unsuffixed write scopes
  • regression test was proven to fail when one obsolete scope was temporarily restored
  • live verification: the obsolete health-measurements scope produced HTTP 403; after authorizing both .readonly and .writeonly, a weight create and exact-ID readback succeeded

@google-cla

google-cla Bot commented Aug 16, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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.

1 participant