Skip to content

Conversation

@burmudar
Copy link
Contributor

@burmudar burmudar commented Dec 8, 2025

use keyring to store oauth token

add internal/keyring package to use 99designs keyring

  • rename keyring to store
  • make keyring struct src-cli and set label on secret

return Token struct

store token in keyring

create token struct from TokenResponse

  • Token converts expiresIn to a timestamp
  • Store the token with the endpoint suffix

add basic http transport for oauth

OAuth transport and use when available in api client

Test plan

@burmudar
Copy link
Contributor Author

burmudar commented Dec 8, 2025

cmd/src/login.go Outdated
noToken := cfg.AccessToken == ""
endpointConflict := endpointArg != cfg.Endpoint

secretStore, err := keyring.Open()
Copy link
Member

Choose a reason for hiding this comment

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

you only open this if doing deviceflow. If we are not doing deviceflow don't open secret storage. IE avoid interacting with secret storage unless we actually need to.

Maybe you can add a wrapper around secretstore which lazily opens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Stop looking over my shoulder :P busy addressing this atm 😄

@burmudar burmudar force-pushed the wb/add-oauth-refresh-token branch from 2f24f44 to 7f2c665 Compare January 23, 2026 09:03
- rename keyring to store
- make keyring struct src-cli and set label on secret
- Token converts expiresIn to a timestamp
- Store the token with the endpoint suffix
- Add secret store that supports different backends
- We use a registry map for a few secrets and the registry gets
  persisted as one secret to the keyring. We don't waant to create a
  keyring secret for every different secret
- Store is opened once to load the registry.
@burmudar burmudar force-pushed the wb/add-oauth-refresh-token branch from 7f2c665 to 87b5732 Compare January 23, 2026 09:10
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.

3 participants