Repository navigation
Report the Stripe key mode on /v1/info; pin CI lint to v2.14.0 - #114
Merged
Merged
Conversation
…uction Nothing in the billing path distinguishes a live Stripe configuration from a test one: a test key, test webhook secret and test price ID work together in production, take no money, and raise no error. The go-live (#53) therefore had no single check that it had actually happened. billing.KeyMode reads the mode from the secret key prefix (sk_/rk_ live or test). It is reported as services.billing.mode on /v1/info and in the startup log, and the app warns once at startup when production is running on anything other than a live key. Assisted-by: Claude Fable 5.1
golangci-lint v2.13.1 cannot decode the export data Go 1.27.2 emits ("export
data version 5 is greater than maximum supported version 4") and fails
typecheck on every package. CI resolves Go from go.mod and the last run was
before 1.27.2 shipped, so the next PR would have failed regardless of content.
v2.14.0 handles it; make lint-new reports 0 new issues with it locally.
Also adds the changelog entries for this branch.
Assisted-by: Claude Fable 5.1
|
Security-Accelerated is on CodeRabbit Free, which includes PR summaries. Ask your admin to upgrade for code reviews.
ℹ️ Recent review info
📝 Walkthrough
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First step of the Stripe go-live (#53).
Why
Nothing in
internal/billingtells a live Stripe configuration from a test one. A test key, test webhook secret and test price ID all work together in production, take no money, and raise no error. #53's own notes call this out: a half-rotated secret set degrades quietly. There was no single check that the switch to live mode had happened.What
billing.KeyModereadslive/test/unknownfrom the secret key prefix (sk_andrk_forms). Table-driven test./v1/infogainsservices.billing.mode; the same struct feeds the startup log, so it appears there too.omitempty, so the field is absent when billing is disabled.app.gowarns once at startup whenapplication.modeisproductionand the mode is notlive./v1/inforow mentions the field.CI fix folded in
make verifyfailed locally on lint: golangci-lint v2.13.1 cannot decode the export data Go 1.27.2 emits and fails typecheck on every package. CI pins v2.13.1 and resolves Go fromgo.mod, and its last run predates 1.27.2, so the next PR would have failed on the lint step whatever it touched. Bumped the pin to v2.14.0, which handles it. Separate commit.Verification
make verifypasses: gofmt, vet,lint-new(0 issues with v2.14.0), unit tests with-race, integration tests.After merge and release, the go-live check becomes:
/v1/infoshowsservices.billing.mode: "live".Summary by CodeRabbit
/v1/infonow reports the Stripe key mode as live, test, or unknown.