Skip to content

Prefer --api-key over STRIPE_API_KEY#1591

Open
EfeDurmaz16 wants to merge 1 commit into
stripe:masterfrom
EfeDurmaz16:efe/api-key-mismatch-warning
Open

Prefer --api-key over STRIPE_API_KEY#1591
EfeDurmaz16 wants to merge 1 commit into
stripe:masterfrom
EfeDurmaz16:efe/api-key-mismatch-warning

Conversation

@EfeDurmaz16
Copy link
Copy Markdown

Summary

  • make the explicit --api-key override take precedence over STRIPE_API_KEY
  • keep STRIPE_API_KEY as the fallback before persisted config/keychain credentials
  • update whoami key classification and regression tests for flag/env precedence

Closes #1581.

Testing

  • go test ./pkg/config -run TestGetAPIKey
  • env HOME=$(mktemp -d) go test ./pkg/cmd -run TestWhoami
  • env HOME=$(mktemp -d) go test ./pkg/config ./pkg/cmd -run 'TestGetAPIKey|TestWhoami'

Note: a non-isolated local go test ./pkg/config ./pkg/cmd reads my machine's existing Stripe config and also hits an existing TestGetLoginEmpty template-state failure. The focused regression tests above pass with an isolated HOME.

@EfeDurmaz16 EfeDurmaz16 requested a review from a team as a code owner May 14, 2026 20:54
@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented May 14, 2026

CLA assistant check
All committers have signed the CLA.

@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented May 14, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented May 14, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

--api-key flag is silently overridden by STRIPE_API_KEY env var

1 participant