HandleCheckout read the SDK's package-level key to learn the environment,
which two forbidigo exceptions allowed. BillingCheckoutHandler
now has KeyMode func() string, documented beside
MemberProductsHandler.StripeMode. internal/integrations/stripe gains
SDKKeyMode, the mode of the key the SDK holds at the call (the same
store.ModeForKey on stripe.Key as before, so an unset or unrecognised key
still answers ""). server.Config carries it as StripeKeyMode, cmd/start.go
wires it, and server.go sets the handler from the config. The environment
test sets KeyMode from a prefix instead of assigning the SDK key; the offer
and gate tests set "test", the mode of the key stripetest.Install sets. Both
forbidigo exceptions are deleted. TestSDKKeyMode is new: it sets the SDK
key to unset, a live key, a restricted test key and an unrecognised one and
checks SDKKeyMode answers "", live, test and "".
Shown to change no output: the function is evaluated per request exactly
where the SDK key was read, with the same classification, so every
configuration answers as before. The tests of internal/server and
internal/entitlements, run at the parent and here on a reset test database,
have the same 1329 names and the same results, and no golden changed;
internal/integrations/stripe and cmd pass. The lint snapshot has no added
line. 2 breaks, each caught by the old and the new test, and a third on the
new side (SDKKeyMode returning ""), caught by TestSDKKeyMode. Two wiring
lines are unprobed: KeyMode: cfg.StripeKeyMode in server.go and
StripeKeyMode: stripeintegration.SDKKeyMode in cmd/start.go, because no test
builds the server's router or runs the start command. A fresh app database
and make screens show only the masked operator-integration-stripe screen
different.