Turn stripe.sh into a non-writing provider shim (#87) - #92
Merged
AntoineToussaint merged 3 commits intoAug 3, 2026
Merged
Conversation
Stripe billing setup moves to the codefly-dev/provider-stripe plugin. The script no longer curls Stripe, writes configuration, or provisions webhooks; it classifies a supplied test-mode key locally (accepting sk_test_ and rk_test_, refusing live keys) and prints the exact migration path. Removed flags fail closed with guidance. provider-common.sh is preserved for the non-migrated provider scripts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Split the temp-file fixture into a withTempDir helper that always removes its directory, so the key-file helper no longer leaks temp dirs or hides a guard in a finally block. Add observable-behavior tests: an ambient live STRIPE_API_KEY is refused, --env-file never reads or echoes the webhook secret, and the shim creates no files in its working directory or TMPDIR. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
stripe.sh no longer installs configuration, provisions webhooks, or describes dogfood setup, so its cases in the generic writing-script tests no longer apply. Drop stripe from the help, install, and loopback-rejection loops and add TestStripeSetupIsNonWritingShim, which enforces the shim contract at the Go boundary: removed flags fail closed with migration guidance, a test-mode key is classified without being printed or written, a live key is refused, and help points at the provider plugin. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
AntoineToussaint
deleted the
issue-87-migrate-scripts-setup-stripe-sh-to-a-non
branch
August 3, 2026 23:22
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.
Closes #87.
Summary
scripts/setup/stripe.shbecomes a thin, non-writing shim: it nevercurls Stripe, writes configuration, or manages remote resources. Account validation, webhook create/observe, secret capture, and billing config projection now belong to thecodefly-dev/provider-stripeplugin.sk_test_andrk_test_, refusing live keys — so a live credential is caught before it ever reaches the plugin, and no management/runtime credential is silently written into config.--provision-webhook,--skip-remote-validation,--webhook-origin,--webhook-secret-file,--force,--workspace,--skip-doctor); the shim explains import-by-ID (we_..., never URL adoption) for endpoints the old script created.provider-common.shis untouched so the non-migrated provider scripts keep working.Risk / dependency
The issue notes this depends on provider-stripe#2 (Observe/ApplyAction/Doctor) for full plugin parity. That work is open (provider-stripe PR #5, not yet merged). The shim itself is safe to land now — it only removes writing behavior and redirects operators — but until #2 merges, the plugin cannot yet perform every operation the guidance points to. The shim references the plugin's operations conceptually rather than a
codefly providerCLI verb, because that verb is not in the released CLI yet.Test plan
node --test scripts/setup/stripe-shim.test.mjs— 13 static + behavioral checks: nocurl/api.stripe.com/config writes in source,provider-common.shstill sourced, each removed flag hard-fails with plugin guidance,sk_test_/rk_test_accepted without echoing the key,sk_live_/rk_live_refused, import-by-ID guidance present. New CI jobprovider-shimruns it.node module/tools/base-integrity.mjs verifystill green (nomodule/base files touched).--help,--provision-webhook, a live key, andrk_test_acceptance.🤖 Generated with Claude Code