Skip to content

Turn stripe.sh into a non-writing provider shim (#87) - #92

Merged
AntoineToussaint merged 3 commits into
mainfrom
issue-87-migrate-scripts-setup-stripe-sh-to-a-non
Aug 3, 2026
Merged

Turn stripe.sh into a non-writing provider shim (#87)#92
AntoineToussaint merged 3 commits into
mainfrom
issue-87-migrate-scripts-setup-stripe-sh-to-a-non

Conversation

@AntoineToussaint

Copy link
Copy Markdown
Contributor

Closes #87.

Summary

  • scripts/setup/stripe.sh becomes a thin, non-writing shim: it never curls Stripe, writes configuration, or manages remote resources. Account validation, webhook create/observe, secret capture, and billing config projection now belong to the codefly-dev/provider-stripe plugin.
  • The one thing it still does locally is host classification of a supplied key — accepting sk_test_ and rk_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.
  • Removed flags fail closed with exact guidance (--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.sh is 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 provider CLI 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: no curl/api.stripe.com/config writes in source, provider-common.sh still 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 job provider-shim runs it.
  • node module/tools/base-integrity.mjs verify still green (no module/ base files touched).
  • Manually exercised --help, --provision-webhook, a live key, and rk_test_ acceptance.

🤖 Generated with Claude Code

AntoineToussaint and others added 3 commits August 1, 2026 11:26
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
AntoineToussaint merged commit 09be338 into main Aug 3, 2026
5 checks passed
@AntoineToussaint
AntoineToussaint deleted the issue-87-migrate-scripts-setup-stripe-sh-to-a-non branch August 3, 2026 23:22
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.

Migrate scripts/setup/stripe.sh to a non-writing provider shim

1 participant