@onesub/server 0.21.1 → 0.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,24 @@ export type GoogleWebhookWork = {
24
24
  kind: 'subscription';
25
25
  notification: DecodedGoogleSubscriptionNotification;
26
26
  };
27
+ /**
28
+ * Startup check for the two conditions that leave `POST /onesub/webhook/google`
29
+ * open. Called once from `createOneSubMiddleware`; warns rather than throws
30
+ * because rejecting would break deployments that front the route with their own
31
+ * Pub/Sub verification.
32
+ *
33
+ * Gated on `NODE_ENV=production` for the same reason the mockMode guard is:
34
+ * neither condition is meaningful locally, where no real RTDN arrives, and
35
+ * warning unconditionally would fire on nearly every test and drown itself out.
36
+ *
37
+ * Why it matters. The subscription paths re-fetch state from Google before
38
+ * writing, so a forged notification cannot fabricate an entitlement. The voided
39
+ * path does not: it acts on the payload alone, setting a subscription to
40
+ * `canceled` by `purchaseToken` or deleting a one-time purchase row by
41
+ * `orderId`. So the exposure is entitlement *revocation* for a caller who knows
42
+ * or guesses one of those ids — not free entitlement.
43
+ */
44
+ export declare function warnIfGoogleWebhookOpen(config: OneSubServerConfig): void;
27
45
  /**
28
46
  * State-mutating half of the Google webhook: everything AFTER the gate
29
47
  * (push-token auth, body validation, idempotency markIfNew, packageName
@@ -1 +1 @@
1
- {"version":3,"file":"webhook-google.d.ts","sourceRoot":"","sources":["../../src/routes/webhook-google.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAA6B,kBAAkB,EAAoB,MAAM,gBAAgB,CAAC;AAEtG,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EACL,wBAAwB,EAYzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,wBAAwB,EACxB,gCAAgC,EACjC,MAAM,wBAAwB,CAAC;A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AG,EAAE,QAAQ,EACb,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,iBAAiB,EACxB,aAAa,EAAE,aAAa,EAC5B,iBAAiB,CAAC,EAAE,iBAAiB,EACrC,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,IAAI,CAAC,CAmIf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onesub/server",
3
- "version": "0.21.1",
3
+ "version": "0.21.2",
4
4
  "description": "Server-side receipt validation middleware for react-native-iap. Apple StoreKit 2 + Google Play Billing. One line.",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",