Skip to content

feat: Add shm credential store for headless auth#849

Open
lox wants to merge 2 commits into
mainfrom
lox/auth-login-shm-store
Open

feat: Add shm credential store for headless auth#849
lox wants to merge 2 commits into
mainfrom
lox/auth-login-shm-store

Conversation

@lox
Copy link
Copy Markdown
Contributor

@lox lox commented Jun 3, 2026

Headless Linux users can complete OAuth device auth now, but the CLI still tries to persist tokens in a desktop keyring. On machines without a working keyring, or where gnome-keyring loses the login item, users fall back to BUILDKITE_API_TOKEN.

This adds an explicit --credential-store shm mode for bk auth login that stores access and refresh tokens in a 0600 JSON file under a per-user /dev/shm/buildkite-cli-<uid>/ directory. The default auto mode still prefers the OS keyring, but can fall back to the shm store and read it later so users do not need to pass a flag on every command.

Example:

bk auth login --device --credential-store shm

The shm store is ephemeral and clears on reboot, which matches the issue request for a headless/session-like credential store without writing tokens to shell env or persistent config.

Fixes #807

@lox lox requested review from a team as code owners June 3, 2026 22:11
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

Reviewed commit: 344a2526db

ℹ️ 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".

Comment thread pkg/keyring/keyring.go
Comment thread cmd/auth/login.go Outdated
@lox lox force-pushed the lox/auth-login-shm-store branch 3 times, most recently from d47478f to 1121523 Compare June 4, 2026 03:31
@lox lox force-pushed the lox/auth-login-shm-store branch from 1121523 to daa9201 Compare June 4, 2026 03:40
@lox
Copy link
Copy Markdown
Contributor Author

lox commented Jun 4, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

Reviewed commit: daa92018c0

ℹ️ 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".

Comment thread pkg/keyring/keyring.go Outdated
Comment thread pkg/keyring/keyring.go
Comment thread pkg/keyring/keyring.go Outdated
@lox
Copy link
Copy Markdown
Contributor Author

lox commented Jun 4, 2026

@codex review

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.

💡 feat: Allow 'bk auth login' on headless servers

1 participant