chore(deps): upgrade sdk-go to v0.2.0 (credstore API)#14
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Upgrades the AuthGate Go SDK dependency to sdk-go v0.2.0 and migrates the CLI from the legacy tokenstore API to the new generic credstore API for token persistence (including optional keyring-backed storage).
Changes:
- Bump
github.com/go-authgate/sdk-gotov0.2.0and update transitive deps / Go version. - Replace custom token file JSON + locking with
credstorestores and updatedSave/Loadsignatures. - Introduce
-token-store/TOKEN_STOREto selectauto|file|keyringstorage backend.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
go.mod |
Bumps Go version and pins sdk-go v0.2.0 plus new indirect deps for credstore/keyring support. |
go.sum |
Updates module checksums to match the dependency upgrades. |
tui/types.go |
Switches TokenStorage to alias the new credstore.Token type. |
main.go |
Adds credstore-backed token storage (auto/file/keyring) and wires SaveTokens/LoadTokens through the new API. |
main_test.go |
Updates token persistence tests to use credstore.NewTokenFileStore and new Save/Load signatures. |
filelock.go |
Removes now-unneeded custom lockfile implementation (replaced by credstore). |
filelock_test.go |
Removes tests for the deleted lockfile implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| flagTokenStore = flag.String( | ||
| "token-store", | ||
| "", | ||
| "Token storage backend: auto, file, keyring (default: auto or TOKEN_STORE env)", | ||
| ) |
There was a problem hiding this comment.
The new TOKEN_STORE / -token-store configuration is introduced here, but the repo’s user-facing configuration docs/examples (e.g., .env.example and/or README token storage section) don’t mention it. Please update the docs so users can discover and correctly set the new backend selection option.
- Bump github.com/go-authgate/sdk-go to v0.2.0; update Go version
(1.24.2 → 1.25.0) and transitive dependencies
- Migrate from sdk-go/tokenstore to sdk-go/credstore throughout:
- tui/types.go: TokenStorage aliases credstore.Token
- main.go: tokenStore typed as credstore.Store[credstore.Token];
initTokenStore updated to credstore constructors
- Save/Load call sites updated to new generic API signatures
(Save takes explicit clientID + value, Load returns value not pointer)
- Update tests: credstore.NewTokenFileStore, Save/Load signatures,
type assertions updated to generic credstore concrete types
- Document TOKEN_STORE env var in .env.example
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
ac5e05d to
4443c73
Compare
Summary
github.com/go-authgate/sdk-gofrom pseudo-version to v0.2.0tokenstorepackage to the new genericcredstorepackageChanges
go.mod/go.sumtui/types.gocredstore; updateTokenStoragetype aliasmain.gocredstore.Store[credstore.Token]; new store init helpers; updatedSave/Loadcall signaturesmain_test.gocredstoreAPI (NewTokenFileStore,Save(id, Token{}))API differences (v0.1.0 → v0.2.0)
tokenstore)credstore)Store(concrete)Store[T any](generic)NewFileStore(path)NewTokenFileStore(path)NewKeyringStore(svc)NewTokenKeyringStore(svc)NewSecureStore(kr, file)+ type assertionDefaultTokenSecureStore(svc, path)Save(*Token)Save(clientID string, data Token)Load(id) (*Token, error)Load(id) (Token, error)Test plan
go build ./...passesgo test ./...passes (all tests green)🤖 Generated with Claude Code