Conversation
Member
appleboy
commented
Mar 9, 2026
- Remove the custom file-based locking implementation and its tests.
- Introduce a shared tokenstore dependency and add keyring-related indirect dependencies.
- Replace manual token file read/write logic with tokenstore abstractions for loading and saving tokens.
- Add a configurable token storage backend with support for auto, file, and OS keyring modes.
- Update CLI flags and configuration to select and initialize the token storage backend.
- Refactor tests to use the new tokenstore API instead of direct file and JSON handling.
- Simplify TUI token types by aliasing them to the shared tokenstore token type.
- Remove the custom file-based locking implementation and its tests. - Introduce a shared tokenstore dependency and add keyring-related indirect dependencies. - Replace manual token file read/write logic with tokenstore abstractions for loading and saving tokens. - Add a configurable token storage backend with support for auto, file, and OS keyring modes. - Update CLI flags and configuration to select and initialize the token storage backend. - Refactor tests to use the new tokenstore API instead of direct file and JSON handling. - Simplify TUI token types by aliasing them to the shared tokenstore token type. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Adopts the shared sdk-go/tokenstore package to manage OAuth token persistence, replacing the CLI’s bespoke JSON + file-locking implementation and adding a configurable backend (file vs OS keyring vs auto fallback).
Changes:
- Replace
tui.TokenStoragewith an alias totokenstore.Tokenand remove the local multi-client JSON map types. - Initialize a configurable
tokenstore.StoreininitConfig(modes:auto,file,keyring) and wire it into the TUI deps. - Remove the custom file-lock implementation/tests; refactor token save/load tests to use the new tokenstore API.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tui/types.go |
Aliases TokenStorage to the shared tokenstore.Token. |
main.go |
Adds -token-store config and routes token load/save through tokenstore.Store; removes bespoke file token logic. |
main_test.go |
Updates token persistence tests to use tokenstore.NewFileStore + Save/Load. |
go.mod |
Adds github.com/go-authgate/sdk-go and keyring-related indirect deps. |
go.sum |
Records checksums for the newly introduced dependencies. |
filelock.go |
Deletes the custom cross-process lock implementation. |
filelock_test.go |
Removes tests for the deleted file-locking implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Extract initTokenStore function from initConfig for testability - Add tests for file, keyring, auto, and invalid token store modes - Verify correct backend types and fallback warning behavior Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.