Closer/docs
null 89d06eeb7d fix(billing): correct RevenueCat webhook auth to HMAC-SHA256 + enable export
The webhook verified an Ed25519 signature in an X-Signature header, but RevenueCat
offers no public-key signing — it sends HMAC-SHA256 in X-RevenueCat-Webhook-Signature
(t=<ts>,v1=<hex>) computed over "<ts>.<rawBody>". As written, every real event would
have 401'd and premium would never sync for the partner.

- Rewrite verification to HMAC-SHA256 with a +/-5-min timestamp replay guard and a
  constant-time compare; extract a pure verifyWebhookSignature() for unit testing.
- Rename secret REVENUECAT_SIGNING_KEY -> REVENUECAT_WEBHOOK_SECRET (it is an HMAC
  secret, not an Ed25519 key). Never deployed, so no migration.
- Uncomment the export in index.ts (deploy still gated on seeding the secret).
- Add revenueCatWebhook.test.ts: valid / tampered / wrong-secret / missing / stale.
- Reconcile Future.md + Engineering_Reference_Manual.md to the real scheme.

Verified against the live account: the entitlement identifier is now closer_premium,
so events match entitlementLogic. Build + 80 tests green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 03:43:59 -05:00
..
brand docs(readme): refresh ready-state home screenshots 2026-07-09 00:30:27 -05:00
crypto docs(crypto): key-storage migration design (design-only, gated) 2026-07-06 21:08:52 -05:00
qa feat: signup flow, age gate, user model updates, how well screen, game prompt banner 2026-07-02 02:42:55 -05:00
release docs(store): rename marketing assets to Closer Couples 2026-07-08 22:01:10 -05:00
screenshots docs(readme): refresh ready-state home screenshots 2026-07-09 00:30:27 -05:00
store docs(store): refine banner card icon balance 2026-07-09 00:04:16 -05:00
CopyMigration.md refactor(copy): Slice 1 — dedup age-gate copy into CloserCopy.AgeGate 2026-07-09 00:39:04 -05:00
Engineering_Reference_Manual.md fix(billing): correct RevenueCat webhook auth to HMAC-SHA256 + enable export 2026-07-09 03:43:59 -05:00
NameChange.md docs(brand): retire unreferenced generated-art feature graphics; single source of truth 2026-07-08 23:51:10 -05:00
copy-guide.md docs: brand identity, copy guide, release checklists, store assets, README 2026-06-21 17:56:46 -05:00
date-planning-roadmap.md feat(dates): add Date Match MVP Phase 1 — swipe UI, Firestore models, 30+ seed ideas, match reveal 2026-06-16 23:30:58 -05:00
standardization-review.md docs: update standardization review to completed state 2026-07-06 22:19:33 -05:00