mirror of
https://github.com/luxfi/kms.git
synced 2026-07-27 05:54:18 +00:00
remove Stripe from CSP + de-brand test fixtures (Stripe account disabled)
frontend CSP no longer needs to allow *.stripe.com (Infisical-era billing UI we don't use). Drop all stripe.com sources + the stripe-only child-src. Rename the Stripe-flavored example secret in zapserver/envelope tests to a neutral api-key/secret-value fixture. No Go code paths change.
This commit is contained in:
+4
-5
@@ -8,12 +8,11 @@
|
||||
http-equiv="Content-Security-Policy"
|
||||
content="
|
||||
default-src 'self';
|
||||
connect-src 'self' http://127.0.0.1:* https://checkout.stripe.com https://api.stripe.com https://api.pwnedpasswords.com https://hcaptcha.com https://*.hcaptcha.com;
|
||||
script-src 'self' https://js.stripe.com https://api.stripe.com https://hcaptcha.com https://*.hcaptcha.com 'unsafe-inline' 'unsafe-eval';
|
||||
connect-src 'self' http://127.0.0.1:* https://api.pwnedpasswords.com https://hcaptcha.com https://*.hcaptcha.com;
|
||||
script-src 'self' https://hcaptcha.com https://*.hcaptcha.com 'unsafe-inline' 'unsafe-eval';
|
||||
style-src 'self' 'unsafe-inline' https://hcaptcha.com https://*.hcaptcha.com;
|
||||
child-src https://api.stripe.com;
|
||||
frame-src https://js.stripe.com/ https://api.stripe.com https://hcaptcha.com https://*.hcaptcha.com;
|
||||
img-src 'self' https://*.stripe.com data:;
|
||||
frame-src https://hcaptcha.com https://*.hcaptcha.com;
|
||||
img-src 'self' data:;
|
||||
media-src 'self';
|
||||
font-src 'self' https://fonts.gstatic.com;
|
||||
"
|
||||
|
||||
@@ -38,7 +38,7 @@ func mustHeader(ident *keys.ServiceIdentity) envelope.IdentityHeader {
|
||||
func TestEnvelope_BuildVerify_RoundTrip(t *testing.T) {
|
||||
ident := mustIdent(t, "hanzo/kms-operator")
|
||||
defer ident.Wipe()
|
||||
req := json.RawMessage(`{"path":"hanzo/commerce","name":"stripe","env":"prod"}`)
|
||||
req := json.RawMessage(`{"path":"hanzo/commerce","name":"api-key","env":"prod"}`)
|
||||
now := time.Unix(1_717_200_000, 0)
|
||||
|
||||
env, err := envelope.Build(mustHeader(ident), ident, 0x0040, req, "nonce-1", now)
|
||||
|
||||
@@ -80,7 +80,7 @@ func bootConsensusNativeServer(t *testing.T, validators, operators []ids.NodeID)
|
||||
secStore := store.NewSecretStore(db)
|
||||
|
||||
// Pre-populate so an authorized Get returns OK rather than NotFound.
|
||||
sec, err := store.Seal(mk, "hanzo/commerce", "stripe-key", "prod", []byte("sk_live_real"))
|
||||
sec, err := store.Seal(mk, "hanzo/commerce", "api-key", "prod", []byte("secret-value"))
|
||||
if err != nil {
|
||||
t.Fatalf("store.Seal: %v", err)
|
||||
}
|
||||
@@ -151,7 +151,7 @@ func TestConsensusE2E_ValidatorReadsSecret(t *testing.T) {
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
value, err := c.Get(ctx, "stripe-key", "prod")
|
||||
value, err := c.Get(ctx, "api-key", "prod")
|
||||
if err != nil {
|
||||
t.Fatalf("Get: %v", err)
|
||||
}
|
||||
@@ -207,7 +207,7 @@ func TestConsensusE2E_NonValidatorDenied(t *testing.T) {
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
if _, err := c.Get(ctx, "stripe-key", "prod"); err == nil {
|
||||
if _, err := c.Get(ctx, "api-key", "prod"); err == nil {
|
||||
t.Fatalf("stranger Get must be rejected (got nil error)")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ func TestAuthz_OperatorWrite_Allowed(t *testing.T) {
|
||||
now := time.Unix(1_717_200_000, 0)
|
||||
|
||||
putRaw := signedEnvelopeBytes(t, ident, OpSecretPut, buildInner(t, putReq{
|
||||
Path: "hanzo/commerce", Name: "stripe-key", Env: "prod",
|
||||
Path: "hanzo/commerce", Name: "api-key", Env: "prod",
|
||||
Value: base64.StdEncoding.EncodeToString([]byte("sk_live_xxx")),
|
||||
}), now, "nonce-1")
|
||||
verifiedIdent, payload, err := s.verifyAndAuthorize(context.Background(), putRaw, OpSecretPut)
|
||||
|
||||
Reference in New Issue
Block a user