audit: remove duplicate Stripe integration card + tighten input validation

Deep audit of the recent change set (passes 56-60):

- Remove the generic Integrations-tab Stripe card. saveIntegration
  overwrites integrations.config wholesale, so configuring Stripe there
  clobbered the dues config (mode/prices/grace_days) that the Dues tab
  manages, and couldn't actually set up dues. Stripe is now configured in
  one place (the Dues tab). PayPal/Zeffy/Venmo sync cards unchanged.
- deleteDuesPaymentMethod validates platform against DUES_LINK_PLATFORMS
  instead of passing a raw client string into the enum column.
- markNotificationsRead uses a strict uuid regex for the id filter.

PGRST201 class characterized + confirmed contained: PostgREST treats a
2-FK table as an ambiguous junction only when its PK covers both FKs; the
only such table now is space_member_custom_roles (a legitimate M2M).
Guarded by integration/auth-embed.test.ts.
This commit is contained in:
Moheeb Zara
2026-05-20 00:33:08 -07:00
parent 49d8805b4c
commit 36afa7ea2c
4 changed files with 33 additions and 18 deletions
+5 -16
View File
@@ -71,22 +71,11 @@ const INTEGRATIONS_CONFIG = [
],
docs: 'https://developer.venmo.com/',
},
{
platform: 'stripe',
name: 'Stripe',
description: 'Accept card payments and subscriptions',
icon: (
<svg className="w-6 h-6 text-indigo-600" viewBox="0 0 24 24" fill="currentColor">
<path d="M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.591-7.305z"/>
</svg>
),
fields: [
{ key: 'publishable_key', label: 'Publishable Key', type: 'text', placeholder: 'pk_test_...' },
{ key: 'secret_key', label: 'Secret Key', type: 'password', placeholder: 'sk_test_...' },
{ key: 'webhook_secret', label: 'Webhook Secret', type: 'password', placeholder: 'whsec_...' },
],
docs: 'https://stripe.com/docs/api',
},
// Stripe is intentionally NOT listed here. Stripe recurring dues is
// configured in the dedicated Dues tab (saveStripeSettings: mode, tier->price
// map, grace days, vaulted keys). The generic saveIntegration path OVERWRITES
// integrations.config with a different shape, which would clobber the dues
// config (drop prices/mode/grace_days). One Stripe config UI, in Dues.
]
export default function SettingsClient({ space, isAdmin, integrations, currentRole }: Props) {