Skip to content

Comments

feat: use file-based token storage instead of keychain#8

Merged
struong merged 2 commits intomasterfrom
struong/keychain-persistence
Jan 4, 2026
Merged

feat: use file-based token storage instead of keychain#8
struong merged 2 commits intomasterfrom
struong/keychain-persistence

Conversation

@struong
Copy link
Owner

@struong struong commented Jan 4, 2026

motivation

On macOS, unsigned binaries using the keychain trigger password prompts on every run due to code signing requirements. This makes the tool frustrating to use for local development builds.

change

  • Replaced keyring crate with dirs crate for cross-platform config directory detection
  • Token is now stored in ~/.config/ghune/token (or platform equivalent)
  • File permissions set to 0o600 on Unix systems (owner read/write only)
  • Added trailing newline to token file for consistency with standard config files

This approach matches how other CLI tools (gh, aws, gcloud) handle credential storage.

testing

  • Manual testing: Run the tool, enter token when prompted, verify subsequent runs use stored token without prompts
  • Verified file permissions are 0600 on macOS/Linux
  • Tested token clearing with logout command

Replaces keyring with file-based storage at ~/.config/ghune/token
with 600 permissions. This avoids repeated keychain password prompts
on macOS for unsigned binaries.
@struong struong merged commit f5e8135 into master Jan 4, 2026
3 checks passed
This was referenced Jan 4, 2026
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.

1 participant