Skip to content

Make LOCALSTACK_AUTH_TOKEN take precedence over stored credentials - #415

Draft
gtsiolis wants to merge 1 commit into
mainfrom
devx-1023-environment-auth-token-should-override-stored-8cf6
Draft

Make LOCALSTACK_AUTH_TOKEN take precedence over stored credentials#415
gtsiolis wants to merge 1 commit into
mainfrom
devx-1023-environment-auth-token-should-override-stored-8cf6

Conversation

@gtsiolis

Copy link
Copy Markdown
Member

Stored keyring credentials used to win over LOCALSTACK_AUTH_TOKEN, which is backwards compared with other CLIs: once you had logged in, a per-invocation token (CI secret, second account) was silently ignored until you ran lstk logout.

Resolution order is now env var → keyring → browser login, in both auth.GetToken and the token resolution in cmd/root.go that feeds telemetry, the snapshot commands, and the container start path. lstk logout still removes the stored credential, and now adds a note when LOCALSTACK_AUTH_TOKEN is still set and therefore still in effect.

Covered by integration tests that assert which token reaches the platform API (the precedence one fails before the fix), plus unit tests for GetToken.

Review: not needed in my view — small, single-behavior change with tests, matching the issue's stated intent. Worth a skim if you disagree that the env var should win.

Closes DEVX-1023

Co-Authored-By: Claude <noreply@anthropic.com>
@gtsiolis gtsiolis added semver: patch docs: skip Pull request does not require documentation changes labels Jul 28, 2026
@gtsiolis gtsiolis self-assigned this Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: skip Pull request does not require documentation changes semver: patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant