Skip to content

feat(oauth): Add refresh to oauthdevice.Client#1227

Merged
burmudar merged 3 commits intowb/add-oauth-device-flowfrom
wb/add-oauth-refresh-token
Mar 9, 2026
Merged

feat(oauth): Add refresh to oauthdevice.Client#1227
burmudar merged 3 commits intowb/add-oauth-device-flowfrom
wb/add-oauth-refresh-token

Conversation

@burmudar
Copy link
Contributor

@burmudar burmudar commented Dec 8, 2025

add refresh to oauthdevice.Client

oauthdevice: add RefreshToken field and Refresh method

Test plan

@burmudar
Copy link
Contributor Author

burmudar commented Dec 8, 2025

Copy link
Member

@keegancsmith keegancsmith left a comment

Choose a reason for hiding this comment

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

did you test what happens if someone revokes src-cli and then you try refresh a token / use an old token? I'm interested to know if the error message you show users is possible to debug as that being the issue.

@burmudar
Copy link
Contributor Author

burmudar commented Dec 8, 2025

did you test what happens if someone revokes src-cli and then you try refresh a token / use an old token? I'm interested to know if the error message you show users is possible to debug as that being the issue.

Noopee! Def a good call out - I'll make sure to test it

@burmudar burmudar force-pushed the wb/add-oauth-device-flow branch from fd1668e to 1565618 Compare January 23, 2026 09:03
@burmudar burmudar force-pushed the wb/add-oauth-refresh-token branch from 2f24f44 to 7f2c665 Compare January 23, 2026 09:03
@burmudar burmudar force-pushed the wb/add-oauth-device-flow branch from 1565618 to 9a04958 Compare January 23, 2026 09:10
@burmudar burmudar force-pushed the wb/add-oauth-refresh-token branch from 7f2c665 to 87b5732 Compare January 23, 2026 09:10
@burmudar burmudar force-pushed the wb/add-oauth-device-flow branch from 9a04958 to c1c82ec Compare February 26, 2026 12:33
@burmudar burmudar force-pushed the wb/add-oauth-refresh-token branch from 87b5732 to abd0850 Compare February 26, 2026 12:33
@burmudar burmudar self-assigned this Feb 26, 2026
@burmudar
Copy link
Contributor Author

did you test what happens if someone revokes src-cli and then you try refresh a token / use an old token? I'm interested to know if the error message you show users is possible to debug as that being the issue.

Noopee! Def a good call out - I'll make sure to test it

Tried the above scenario and the only error we get back is "Invalid OAuth Token". We catch it in #1228 and then guide the user to re-run src login --oauth <endpoint>

@burmudar burmudar marked this pull request as ready for review February 26, 2026 14:10
@burmudar burmudar requested review from a team, eseliger and keegancsmith February 26, 2026 14:10
@burmudar burmudar force-pushed the wb/add-oauth-device-flow branch from c1c82ec to 61a1070 Compare March 9, 2026 09:30
@burmudar burmudar force-pushed the wb/add-oauth-refresh-token branch from abd0850 to f79c981 Compare March 9, 2026 09:30
* add refresh to oauthdevice.Client
* add OAuth Transport and use it if no access token
* secrets: switch to zalando/go-keyring and add context support
* secrets: scope keyring by endpoint
@burmudar burmudar merged commit e2cb620 into wb/add-oauth-device-flow Mar 9, 2026
8 checks passed
@burmudar burmudar deleted the wb/add-oauth-refresh-token branch March 9, 2026 10:03
burmudar added a commit that referenced this pull request Mar 9, 2026
…Auth client (#1223)

* removed unused func

* add refresh token to device response unmarshall

* make NewClient take ClientID as param

* add oauth flow and use oauth token when SRC_ACCESS_TOKEN is empty

* feat(oauth): Add refresh to oauthdevice.Client (#1227)

* add refresh to oauthdevice.Client
* oauthdevice: add RefreshToken field and Refresh method

* feat(oauth): Use keyring to store oauth token (#1228)
  * add refresh to oauthdevice.Client
  * add OAuth Transport and use it if no access token
  * secrets: switch to zalando/go-keyring and add context support
  * secrets: scope keyring by endpoint
burmudar added a commit that referenced this pull request Mar 23, 2026
…Auth client (#1223)

* removed unused func

* add refresh token to device response unmarshall

* make NewClient take ClientID as param

* add oauth flow and use oauth token when SRC_ACCESS_TOKEN is empty

* feat(oauth): Add refresh to oauthdevice.Client (#1227)

* add refresh to oauthdevice.Client
* oauthdevice: add RefreshToken field and Refresh method

* feat(oauth): Use keyring to store oauth token (#1228)
  * add refresh to oauthdevice.Client
  * add OAuth Transport and use it if no access token
  * secrets: switch to zalando/go-keyring and add context support
  * secrets: scope keyring by endpoint

(cherry picked from commit 0bc535e)
burmudar added a commit that referenced this pull request Mar 23, 2026
…Auth client (#1223)

* removed unused func

* add refresh token to device response unmarshall

* make NewClient take ClientID as param

* add oauth flow and use oauth token when SRC_ACCESS_TOKEN is empty

* feat(oauth): Add refresh to oauthdevice.Client (#1227)

* add refresh to oauthdevice.Client
* oauthdevice: add RefreshToken field and Refresh method

* feat(oauth): Use keyring to store oauth token (#1228)
  * add refresh to oauthdevice.Client
  * add OAuth Transport and use it if no access token
  * secrets: switch to zalando/go-keyring and add context support
  * secrets: scope keyring by endpoint

(cherry picked from commit 0bc535e)
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