Skip to content

Refactor oauth#921

Open
darinkrauss wants to merge 1 commit intodarin/refactor-data-rawfrom
darin/refactor-oauth
Open

Refactor oauth#921
darinkrauss wants to merge 1 commit intodarin/refactor-data-rawfrom
darin/refactor-oauth

Conversation

@darinkrauss
Copy link
Copy Markdown
Contributor

  • Refactor oauth
  • Update TokenSource functions to return whether change occurred
  • Add optional client error response parser
  • Update Dexcom package accordingly
  • Add mocks

- Refactor oauth
- Update TokenSource functions to return whether change occurred
- Add optional client error response parser
- Update Dexcom package accordingly
- Add mocks
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors OAuth token-source handling to expose whether token state changed, adds optional client-side error parsing, and updates Dexcom/OAuth clients and mocks to match.

Changes:

  • Update TokenSource APIs (UpdateToken/ExpireToken) to return (bool, error) and propagate conditional session updates.
  • Add NewWithErrorParser constructors to OAuth client/provider to support optional error-response parsing.
  • Update tests and add generated GoMock mocks for OAuth interfaces.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
private/plugin/abbott Bumps the Abbott submodule reference.
oauth/work/mixin.go Updates token update/expire flow to return change flags and handle missing token source.
oauth/token/source.go Implements (bool, error) semantics for token refresh/expire and adds “no-op” behavior.
oauth/test/token_source.go Updates the hand-rolled test stub to support (bool, error) outputs.
oauth/test/oauth_mocks.go Adds generated GoMock mocks for OAuth interfaces.
oauth/provider/client/client.go Adds provider constructor supporting optional error parser and wires it into oauth client creation.
oauth/oauth.go Updates TokenSource interface signatures and adds go:generate directives for mocks.
oauth/client/client.go Adds client constructor supporting optional error parser; adapts to new token-source signatures.
oauth/client/client_test.go Updates tests to use the new (bool, error) token source outputs.
dexcom/fetch/runner.go Updates Dexcom runner token handling to return change flags and conditionally persist session updates.
dexcom/client/client_test.go Updates Dexcom client tests to use the new token source outputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread oauth/oauth.go
Comment thread oauth/oauth.go
Comment thread oauth/token/source.go
Comment thread oauth/provider/client/client.go
@darinkrauss
Copy link
Copy Markdown
Contributor Author

Updates based upon feedback included in later PR.

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.

2 participants