Skip to content

Fix OAuth client credentials and gzip decoding#27

Open
petersentaylor wants to merge 1 commit intosteipete:mainfrom
petersentaylor:fix/oauth-auth-and-gzip
Open

Fix OAuth client credentials and gzip decoding#27
petersentaylor wants to merge 1 commit intosteipete:mainfrom
petersentaylor:fix/oauth-auth-and-gzip

Conversation

@petersentaylor
Copy link
Copy Markdown

Summary

  • use the configured/default Eight Sleep OAuth client credentials for password-grant auth
  • stop forcing Accept-Encoding: gzip so Go can transparently decode API responses

Why

The current auth flow sends a hardcoded sleep-client payload with an empty client secret, which causes the OAuth token endpoint to fail and forces the CLI onto the legacy login fallback. In practice that fallback can get rate-limited with 429 Too Many Requests.

After fixing the OAuth request, live status requests succeeded, but response decoding still failed because the client explicitly requested gzip and then attempted to JSON-decode compressed bytes directly. Removing the manual Accept-Encoding header lets Go handle decompression correctly.

Verification

  • go test ./...
  • verified live eightctl status on macOS after rebuilding the binary

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