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

fix(cli): remove defaulting to keyring when --global-config set#20943

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

Merged
zedkipp merged 4 commits intomainfromzedkipp/keyring-dir
Nov 26, 2025

Conversation

@zedkipp
Copy link
Contributor

@zedkippzedkipp commentedNov 26, 2025
edited
Loading

This fixes a regression that caused the VS code extension to be unable to authenticate after making keyring usage on by default. This is because the VS code extension assumes the CLI will always use the session token stored on disk, specifically in the directory specified by --global-config.

This fix makes keyring usage enabled when the --global-config directory is not set. This is a bit wonky but necessary to allow the extension to continue working without modification and without backwards compat concerns. In the future we should modify these extensions to either access the credential in the keyring (like Coder Desktop) or some other approach that doesn't rely on the session token being stored on disk.

Tests:
coder login dev.coder.com -> token stored in keyring
coder login --global-config=/tmp/ dev.coder.com -> token stored in/tmp/session

This fixes a regression that caused the VS code extension to be unableto authenticate after making keyring usage on by default. This isbecause the VS code extension assumes the CLI will always use the sessiontoken stored on disk, specifically in the directory specified by--global-config.This fix makes keyring usage enabled when the --global-config directoryis not set. This is a bit wonky but necessary to allow the extension tocontinue working without modification and without backwards compat concerns.In the future we should modify these extensions to either access thecredential in the keyring (like Coder Desktop) or some other approach thatdoesn't rely on the session token being stored on disk.
@zedkippzedkipp changed the titlefix(cli): don't default to keyring when --global-config setfix(cli): remove defaulting to keyring when --global-config setNov 26, 2025
@zedkippzedkipp marked this pull request as ready for reviewNovember 26, 2025 07:16
@ibetitsmike
Copy link
Contributor

@codex review

@dannykoppingdannykopping added the cherry-pick/v2.29Needs to be cherry-picked to the 2.29 release branch labelNov 26, 2025
cli/root.go Outdated
// either access the credential in the keyring (like Coder Desktop) or some other
// approach that doesn't rely on the session token being stored on disk. We set the
// global config directory in most CLI tests, so we need to skip this check for tests.
assumeExtensionInUse:=r.globalConfig!=config.DefaultDir()&&!testing.Testing()
Copy link
Contributor

Choose a reason for hiding this comment

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

!testing.Testing()

this one really rubs me the wrong way (I'd rather have logic in tests that enforce using keyring, but I'll let@deansheather be the final judge

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Same. I don't see an easy way around this right now. If I unset--global-config in the tests, I think parallel CLI invocations will be reading/writing to the same directory (e.g. URL) and won't have isolation. Any ideas?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I think I might be able to set theHOME env var in keyring tests to work around this. Checking.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

That didn't work, but I made a way to override this behavior for tests that need to exercise the keyring even though--global-config is set. I also added test coverage for when--global-config is set by modifying how existing CLI tests are setup (removed--use-keyring=false so only--global-config remains).

Copy link

@chatgpt-codex-connectorchatgpt-codex-connectorbot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@zedkippzedkippenabled auto-merge (squash)November 26, 2025 08:52
@zedkippzedkipp merged commitbbf7b13 intomainNov 26, 2025
32 checks passed
@zedkippzedkipp deleted the zedkipp/keyring-dir branchNovember 26, 2025 09:17
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsNov 26, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@chatgpt-codex-connectorchatgpt-codex-connector[bot]chatgpt-codex-connector[bot] left review comments

@ibetitsmikeibetitsmikeibetitsmike approved these changes

@deansheatherdeansheatherAwaiting requested review from deansheather

Assignees

@zedkippzedkipp

Labels

cherry-pick/v2.29Needs to be cherry-picked to the 2.29 release branch

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@zedkipp@ibetitsmike@dannykopping

[8]ページ先頭

©2009-2025 Movatter.jp