Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(cli): store session token in OS keyring with file fallback#20256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
zedkipp wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromzedkipp/keyring

Conversation

zedkipp
Copy link
Contributor

@zedkippzedkipp commentedOct 9, 2025
edited
Loading

This change implements secure storage of the CLI token using the operating system keyring with a fallback to the previous plaintext file storage. Previously, the Coder CLI stored authentication tokens in plaintext configuration files, which posed a security risk because users' tokens are stored unencrypted and can be easily accessed by other processes or users with file system access.

The secure storage is platform dependent. The security command is used on macOS. Windows Credential Manager API is used on Windows. Linux depends on GNOME keyring and Secret Service API (via D-Bus).

We're using the go-keyring package because it's prior art from the GitHub CLI.

Known TODOs:

  • Linux docs need improvement
  • CLI test with real OS keyring?
  • Test CLI login/logout on a headless linux machine
  • ensure Nix env works on Linux

#19403

This change implements secure storage of the CLI token using the operating system keyringwith a fallback to the previous plaintext file storage. Previously, the Coder CLI storedauthentication tokens in plaintext configuration files, which posed a security riskbecause users' tokens are stored unencrypted and can be easily accessed by otherprocesses or users with file system access.The secure storage is platform dependent. The security command is used on macOS.Windows Credential Manager API is used on Windows. Linux depends on GNOME keyring andSecret Service API (via D-Bus).
returnxerrors.Errorf("write session token: %w",werr)
}
ifr.tokenBackend.PreferredLocation()==sessionstore.LocationKeyring&&location==sessionstore.LocationFile {
cliui.Warn(inv.Stderr,"⚠️ Token stored in PLAIN TEXT because keyring access failed.")
Copy link
ContributorAuthor

@zedkippzedkippOct 9, 2025
edited
Loading

Choose a reason for hiding this comment

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

These messages should probably provide a docs link. I see some GitHub CLI users flagging thishttps://redirect.github.com/cli/cli/issues/8954

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@zedkippzedkipp

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@zedkipp

[8]ページ先頭

©2009-2025 Movatter.jp