@hyodotdev/openiap-commerce-protocol 0.0.0-bootstrap.0 → 0.1.0

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.
Files changed (42) hide show
  1. package/CONVENTION.md +168 -0
  2. package/DESIGN.md +1056 -0
  3. package/README.md +227 -5
  4. package/SPEC.md +1471 -0
  5. package/conformance/index.d.ts +303 -0
  6. package/conformance/index.mjs +2126 -0
  7. package/conformance/mock-provider.mjs +491 -0
  8. package/examples/entitlement-granted-no-subscription.json +12 -0
  9. package/examples/entitlement-revoked.json +21 -0
  10. package/examples/provider-capabilities.json +209 -0
  11. package/examples/store-event-mapping.json +287 -0
  12. package/examples/subscription-canceled.json +22 -0
  13. package/examples/subscription-product-changed.json +30 -0
  14. package/examples/subscription-renewed.json +29 -0
  15. package/examples/verify-purchase-request.json +6 -0
  16. package/examples/verify-purchase-result.json +7 -0
  17. package/generated/bindings/graphql-operations.json +87 -0
  18. package/generated/bindings/http-binding.json +143 -0
  19. package/generated/bindings/introspection-signature.json +320 -0
  20. package/generated/bindings/operations-sdl.json +4 -0
  21. package/generated/bindings/operations.graphql +366 -0
  22. package/generated/commerce-protocol.graphql +1219 -0
  23. package/generated/openapi/commerce-protocol.openapi.json +1413 -0
  24. package/generated/schemas/commerce-event.schema.json +499 -0
  25. package/generated/schemas/commerce-protocol.bundle.schema.json +1576 -0
  26. package/generated/schemas/operations.schema.json +578 -0
  27. package/generated/schemas/primitives.schema.json +101 -0
  28. package/generated/schemas/provider-capabilities.schema.json +205 -0
  29. package/generated/schemas/store-event-mapping.schema.json +211 -0
  30. package/generated/vectors/lifecycle.json +908 -0
  31. package/generated/vectors/operations.json +1122 -0
  32. package/package.json +62 -12
  33. package/schema/01-primitives.graphql +102 -0
  34. package/schema/02-commerce-event.graphql +195 -0
  35. package/schema/03-provider-capabilities.graphql +139 -0
  36. package/schema/04-store-event-mapping.graphql +98 -0
  37. package/schema/05-operations.graphql +461 -0
  38. package/schema/06-compiler-vocabulary.graphql +139 -0
  39. package/schema/07-protocol-metadata.graphql +76 -0
  40. package/src/index.d.ts +63 -0
  41. package/src/index.mjs +121 -0
  42. package/vectors/signatures.json +139 -0
@@ -0,0 +1,1122 @@
1
+ {
2
+ "$comment": "Operation conformance vectors for the OpenIAP Commerce Protocol. Generated from commerce-protocol.graphql — do not edit. Every case runs on each binding the provider declares unless it names `bindings`; a case with `requiresStore` runs only when the provider declares that store, and `requiresCapability` additionally requires that store capability's implementation support. A case's normalized outcome must also agree across bindings. Fixture evidence is fake but well-formed: these vectors verify the transport contract and never certify real store receipt validity.",
3
+ "protocolVersion": "1.0",
4
+ "fixtures": {
5
+ "userId": "conformance-user-1",
6
+ "erasureUserId": "conformance-erasure-user-1",
7
+ "appleJws": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0.c2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJl",
8
+ "googlePurchaseToken": "conformance-google-purchase-token-0000000001",
9
+ "amazonUserId": "conformance-amazon-user-1",
10
+ "amazonReceiptId": "conformance-amazon-receipt-0000000001",
11
+ "horizonUserId": "1234567890123456",
12
+ "horizonSku": "conformance.sku",
13
+ "unknownPurchaseToken": "conformance-google-purchase-token-unknown-9999",
14
+ "unknownUserId": "conformance-user-the-provider-never-heard-of"
15
+ },
16
+ "credentialRoles": [
17
+ "verification",
18
+ "server"
19
+ ],
20
+ "cases": [
21
+ {
22
+ "id": "providerCapabilities.success.contract",
23
+ "operation": "providerCapabilities",
24
+ "credential": null,
25
+ "input": null,
26
+ "expect": {
27
+ "kind": "result",
28
+ "schema": "ProviderCapabilities"
29
+ }
30
+ },
31
+ {
32
+ "id": "subscriptionStatus.auth.missing-credential",
33
+ "operation": "subscriptionStatus",
34
+ "credential": null,
35
+ "input": {
36
+ "userId": "conformance-user-1"
37
+ },
38
+ "expect": {
39
+ "kind": "error",
40
+ "codes": [
41
+ "UNAUTHORIZED"
42
+ ],
43
+ "preExecution": true
44
+ }
45
+ },
46
+ {
47
+ "id": "subscriptionStatus.auth.unknown-credential",
48
+ "operation": "subscriptionStatus",
49
+ "credential": "invalid",
50
+ "input": {
51
+ "userId": "conformance-user-1"
52
+ },
53
+ "expect": {
54
+ "kind": "error",
55
+ "codes": [
56
+ "UNAUTHORIZED"
57
+ ],
58
+ "preExecution": true
59
+ }
60
+ },
61
+ {
62
+ "id": "subscriptionStatus.auth.verification-role-refused",
63
+ "operation": "subscriptionStatus",
64
+ "credential": "verification",
65
+ "input": {
66
+ "userId": "conformance-user-1"
67
+ },
68
+ "expect": {
69
+ "kind": "error",
70
+ "codes": [
71
+ "FORBIDDEN"
72
+ ],
73
+ "preExecution": true
74
+ }
75
+ },
76
+ {
77
+ "id": "subscriptionStatus.auth.precedes-validation",
78
+ "operation": "subscriptionStatus",
79
+ "credential": "invalid",
80
+ "input": {
81
+ "userId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
82
+ },
83
+ "expect": {
84
+ "kind": "error",
85
+ "codes": [
86
+ "UNAUTHORIZED"
87
+ ],
88
+ "preExecution": true
89
+ }
90
+ },
91
+ {
92
+ "id": "subscriptionStatus.auth.precedes-structural-validation",
93
+ "operation": "subscriptionStatus",
94
+ "credential": "invalid",
95
+ "input": {},
96
+ "expect": {
97
+ "kind": "error",
98
+ "codes": [
99
+ "UNAUTHORIZED"
100
+ ],
101
+ "preExecution": true
102
+ }
103
+ },
104
+ {
105
+ "id": "subscriptionStatus.input.missing-required-member",
106
+ "operation": "subscriptionStatus",
107
+ "credential": "server",
108
+ "input": {},
109
+ "expect": {
110
+ "kind": "error",
111
+ "codes": [
112
+ "INVALID_REQUEST"
113
+ ]
114
+ }
115
+ },
116
+ {
117
+ "id": "subscriptionStatus.success.contract",
118
+ "operation": "subscriptionStatus",
119
+ "credential": "server",
120
+ "input": {
121
+ "userId": "conformance-user-1"
122
+ },
123
+ "expect": {
124
+ "kind": "result",
125
+ "schema": "SubscriptionStatusResult",
126
+ "checks": [
127
+ "tokenless",
128
+ "statusConsistency"
129
+ ]
130
+ }
131
+ },
132
+ {
133
+ "id": "entitlements.auth.missing-credential",
134
+ "operation": "entitlements",
135
+ "credential": null,
136
+ "input": {
137
+ "userId": "conformance-user-1"
138
+ },
139
+ "expect": {
140
+ "kind": "error",
141
+ "codes": [
142
+ "UNAUTHORIZED"
143
+ ],
144
+ "preExecution": true
145
+ }
146
+ },
147
+ {
148
+ "id": "entitlements.auth.unknown-credential",
149
+ "operation": "entitlements",
150
+ "credential": "invalid",
151
+ "input": {
152
+ "userId": "conformance-user-1"
153
+ },
154
+ "expect": {
155
+ "kind": "error",
156
+ "codes": [
157
+ "UNAUTHORIZED"
158
+ ],
159
+ "preExecution": true
160
+ }
161
+ },
162
+ {
163
+ "id": "entitlements.auth.verification-role-refused",
164
+ "operation": "entitlements",
165
+ "credential": "verification",
166
+ "input": {
167
+ "userId": "conformance-user-1"
168
+ },
169
+ "expect": {
170
+ "kind": "error",
171
+ "codes": [
172
+ "FORBIDDEN"
173
+ ],
174
+ "preExecution": true
175
+ }
176
+ },
177
+ {
178
+ "id": "entitlements.auth.precedes-validation",
179
+ "operation": "entitlements",
180
+ "credential": "invalid",
181
+ "input": {
182
+ "userId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
183
+ },
184
+ "expect": {
185
+ "kind": "error",
186
+ "codes": [
187
+ "UNAUTHORIZED"
188
+ ],
189
+ "preExecution": true
190
+ }
191
+ },
192
+ {
193
+ "id": "entitlements.auth.precedes-structural-validation",
194
+ "operation": "entitlements",
195
+ "credential": "invalid",
196
+ "input": {},
197
+ "expect": {
198
+ "kind": "error",
199
+ "codes": [
200
+ "UNAUTHORIZED"
201
+ ],
202
+ "preExecution": true
203
+ }
204
+ },
205
+ {
206
+ "id": "entitlements.input.missing-required-member",
207
+ "operation": "entitlements",
208
+ "credential": "server",
209
+ "input": {},
210
+ "expect": {
211
+ "kind": "error",
212
+ "codes": [
213
+ "INVALID_REQUEST"
214
+ ]
215
+ }
216
+ },
217
+ {
218
+ "id": "entitlements.success.contract",
219
+ "operation": "entitlements",
220
+ "credential": "server",
221
+ "input": {
222
+ "userId": "conformance-user-1"
223
+ },
224
+ "expect": {
225
+ "kind": "result",
226
+ "schema": "EntitlementsResult",
227
+ "checks": [
228
+ "tokenless",
229
+ "entitlementsConsistency"
230
+ ]
231
+ }
232
+ },
233
+ {
234
+ "id": "verifyPurchase.auth.missing-credential",
235
+ "operation": "verifyPurchase",
236
+ "credential": null,
237
+ "input": {
238
+ "store": "apple",
239
+ "apple": {
240
+ "jws": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0.c2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJl"
241
+ }
242
+ },
243
+ "expect": {
244
+ "kind": "error",
245
+ "codes": [
246
+ "UNAUTHORIZED"
247
+ ]
248
+ }
249
+ },
250
+ {
251
+ "id": "verifyPurchase.auth.unknown-credential",
252
+ "operation": "verifyPurchase",
253
+ "credential": "invalid",
254
+ "input": {
255
+ "store": "apple",
256
+ "apple": {
257
+ "jws": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0.c2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJl"
258
+ }
259
+ },
260
+ "expect": {
261
+ "kind": "error",
262
+ "codes": [
263
+ "UNAUTHORIZED"
264
+ ]
265
+ }
266
+ },
267
+ {
268
+ "id": "verifyPurchase.input.missing-required-member",
269
+ "operation": "verifyPurchase",
270
+ "credential": "verification",
271
+ "input": {},
272
+ "expect": {
273
+ "kind": "error",
274
+ "codes": [
275
+ "INVALID_REQUEST"
276
+ ]
277
+ }
278
+ },
279
+ {
280
+ "id": "verifyPurchase.success.contract",
281
+ "operation": "verifyPurchase",
282
+ "credential": "verification",
283
+ "input": {
284
+ "store": "apple",
285
+ "apple": {
286
+ "jws": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0.c2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJl"
287
+ }
288
+ },
289
+ "requiresStore": "apple",
290
+ "requiresCapability": "initialValidation",
291
+ "expect": {
292
+ "kind": "result",
293
+ "schema": "VerifyPurchaseResult",
294
+ "allowCodes": [
295
+ "VERIFICATION_FAILED"
296
+ ]
297
+ }
298
+ },
299
+ {
300
+ "id": "verifyPurchase.input.unknown-member-ignored",
301
+ "operation": "verifyPurchase",
302
+ "credential": "verification",
303
+ "input": {
304
+ "store": "apple",
305
+ "apple": {
306
+ "jws": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0.c2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJl"
307
+ },
308
+ "unknownFutureMember": "ignored"
309
+ },
310
+ "bindings": [
311
+ "rest"
312
+ ],
313
+ "requiresStore": "apple",
314
+ "requiresCapability": "initialValidation",
315
+ "expect": {
316
+ "kind": "result",
317
+ "schema": "VerifyPurchaseResult",
318
+ "allowCodes": [
319
+ "VERIFICATION_FAILED"
320
+ ]
321
+ }
322
+ },
323
+ {
324
+ "id": "verifyPurchase.idempotent.repeat",
325
+ "operation": "verifyPurchase",
326
+ "credential": "verification",
327
+ "input": {
328
+ "store": "apple",
329
+ "apple": {
330
+ "jws": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0.c2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJl"
331
+ }
332
+ },
333
+ "repeat": 2,
334
+ "requiresStore": "apple",
335
+ "requiresCapability": "initialValidation",
336
+ "expect": {
337
+ "kind": "result",
338
+ "schema": "VerifyPurchaseResult",
339
+ "allowCodes": [
340
+ "VERIFICATION_FAILED"
341
+ ]
342
+ }
343
+ },
344
+ {
345
+ "id": "verifyPurchase.success.contract.google",
346
+ "operation": "verifyPurchase",
347
+ "credential": "verification",
348
+ "input": {
349
+ "store": "google",
350
+ "google": {
351
+ "purchaseToken": "conformance-google-purchase-token-0000000001"
352
+ }
353
+ },
354
+ "requiresStore": "google",
355
+ "requiresCapability": "initialValidation",
356
+ "expect": {
357
+ "kind": "result",
358
+ "schema": "VerifyPurchaseResult",
359
+ "allowCodes": [
360
+ "VERIFICATION_FAILED"
361
+ ]
362
+ }
363
+ },
364
+ {
365
+ "id": "verifyPurchase.input.unknown-member-ignored.google",
366
+ "operation": "verifyPurchase",
367
+ "credential": "verification",
368
+ "input": {
369
+ "store": "google",
370
+ "google": {
371
+ "purchaseToken": "conformance-google-purchase-token-0000000001"
372
+ },
373
+ "unknownFutureMember": "ignored"
374
+ },
375
+ "bindings": [
376
+ "rest"
377
+ ],
378
+ "requiresStore": "google",
379
+ "requiresCapability": "initialValidation",
380
+ "expect": {
381
+ "kind": "result",
382
+ "schema": "VerifyPurchaseResult",
383
+ "allowCodes": [
384
+ "VERIFICATION_FAILED"
385
+ ]
386
+ }
387
+ },
388
+ {
389
+ "id": "verifyPurchase.idempotent.repeat.google",
390
+ "operation": "verifyPurchase",
391
+ "credential": "verification",
392
+ "input": {
393
+ "store": "google",
394
+ "google": {
395
+ "purchaseToken": "conformance-google-purchase-token-0000000001"
396
+ }
397
+ },
398
+ "repeat": 2,
399
+ "requiresStore": "google",
400
+ "requiresCapability": "initialValidation",
401
+ "expect": {
402
+ "kind": "result",
403
+ "schema": "VerifyPurchaseResult",
404
+ "allowCodes": [
405
+ "VERIFICATION_FAILED"
406
+ ]
407
+ }
408
+ },
409
+ {
410
+ "id": "verifyPurchase.success.contract.horizon",
411
+ "operation": "verifyPurchase",
412
+ "credential": "verification",
413
+ "input": {
414
+ "store": "horizon",
415
+ "horizon": {
416
+ "userId": "1234567890123456",
417
+ "sku": "conformance.sku"
418
+ }
419
+ },
420
+ "requiresStore": "horizon",
421
+ "requiresCapability": "initialValidation",
422
+ "expect": {
423
+ "kind": "result",
424
+ "schema": "VerifyPurchaseResult",
425
+ "allowCodes": [
426
+ "VERIFICATION_FAILED"
427
+ ]
428
+ }
429
+ },
430
+ {
431
+ "id": "verifyPurchase.input.unknown-member-ignored.horizon",
432
+ "operation": "verifyPurchase",
433
+ "credential": "verification",
434
+ "input": {
435
+ "store": "horizon",
436
+ "horizon": {
437
+ "userId": "1234567890123456",
438
+ "sku": "conformance.sku"
439
+ },
440
+ "unknownFutureMember": "ignored"
441
+ },
442
+ "bindings": [
443
+ "rest"
444
+ ],
445
+ "requiresStore": "horizon",
446
+ "requiresCapability": "initialValidation",
447
+ "expect": {
448
+ "kind": "result",
449
+ "schema": "VerifyPurchaseResult",
450
+ "allowCodes": [
451
+ "VERIFICATION_FAILED"
452
+ ]
453
+ }
454
+ },
455
+ {
456
+ "id": "verifyPurchase.idempotent.repeat.horizon",
457
+ "operation": "verifyPurchase",
458
+ "credential": "verification",
459
+ "input": {
460
+ "store": "horizon",
461
+ "horizon": {
462
+ "userId": "1234567890123456",
463
+ "sku": "conformance.sku"
464
+ }
465
+ },
466
+ "repeat": 2,
467
+ "requiresStore": "horizon",
468
+ "requiresCapability": "initialValidation",
469
+ "expect": {
470
+ "kind": "result",
471
+ "schema": "VerifyPurchaseResult",
472
+ "allowCodes": [
473
+ "VERIFICATION_FAILED"
474
+ ]
475
+ }
476
+ },
477
+ {
478
+ "id": "verifyPurchase.success.contract.amazon",
479
+ "operation": "verifyPurchase",
480
+ "credential": "verification",
481
+ "input": {
482
+ "store": "amazon",
483
+ "amazon": {
484
+ "userId": "conformance-amazon-user-1",
485
+ "receiptId": "conformance-amazon-receipt-0000000001",
486
+ "sandbox": true
487
+ }
488
+ },
489
+ "requiresStore": "amazon",
490
+ "requiresCapability": "initialValidation",
491
+ "expect": {
492
+ "kind": "result",
493
+ "schema": "VerifyPurchaseResult",
494
+ "allowCodes": [
495
+ "VERIFICATION_FAILED"
496
+ ]
497
+ }
498
+ },
499
+ {
500
+ "id": "verifyPurchase.input.unknown-member-ignored.amazon",
501
+ "operation": "verifyPurchase",
502
+ "credential": "verification",
503
+ "input": {
504
+ "store": "amazon",
505
+ "amazon": {
506
+ "userId": "conformance-amazon-user-1",
507
+ "receiptId": "conformance-amazon-receipt-0000000001",
508
+ "sandbox": true
509
+ },
510
+ "unknownFutureMember": "ignored"
511
+ },
512
+ "bindings": [
513
+ "rest"
514
+ ],
515
+ "requiresStore": "amazon",
516
+ "requiresCapability": "initialValidation",
517
+ "expect": {
518
+ "kind": "result",
519
+ "schema": "VerifyPurchaseResult",
520
+ "allowCodes": [
521
+ "VERIFICATION_FAILED"
522
+ ]
523
+ }
524
+ },
525
+ {
526
+ "id": "verifyPurchase.idempotent.repeat.amazon",
527
+ "operation": "verifyPurchase",
528
+ "credential": "verification",
529
+ "input": {
530
+ "store": "amazon",
531
+ "amazon": {
532
+ "userId": "conformance-amazon-user-1",
533
+ "receiptId": "conformance-amazon-receipt-0000000001",
534
+ "sandbox": true
535
+ }
536
+ },
537
+ "repeat": 2,
538
+ "requiresStore": "amazon",
539
+ "requiresCapability": "initialValidation",
540
+ "expect": {
541
+ "kind": "result",
542
+ "schema": "VerifyPurchaseResult",
543
+ "allowCodes": [
544
+ "VERIFICATION_FAILED"
545
+ ]
546
+ }
547
+ },
548
+ {
549
+ "id": "bindPurchase.auth.missing-credential",
550
+ "operation": "bindPurchase",
551
+ "credential": null,
552
+ "input": {
553
+ "userId": "conformance-user-1",
554
+ "store": "google",
555
+ "google": {
556
+ "purchaseToken": "conformance-google-purchase-token-0000000001"
557
+ }
558
+ },
559
+ "expect": {
560
+ "kind": "error",
561
+ "codes": [
562
+ "UNAUTHORIZED"
563
+ ],
564
+ "preExecution": true
565
+ }
566
+ },
567
+ {
568
+ "id": "bindPurchase.auth.unknown-credential",
569
+ "operation": "bindPurchase",
570
+ "credential": "invalid",
571
+ "input": {
572
+ "userId": "conformance-user-1",
573
+ "store": "google",
574
+ "google": {
575
+ "purchaseToken": "conformance-google-purchase-token-0000000001"
576
+ }
577
+ },
578
+ "expect": {
579
+ "kind": "error",
580
+ "codes": [
581
+ "UNAUTHORIZED"
582
+ ],
583
+ "preExecution": true
584
+ }
585
+ },
586
+ {
587
+ "id": "bindPurchase.auth.verification-role-refused",
588
+ "operation": "bindPurchase",
589
+ "credential": "verification",
590
+ "input": {
591
+ "userId": "conformance-user-1",
592
+ "store": "google",
593
+ "google": {
594
+ "purchaseToken": "conformance-google-purchase-token-0000000001"
595
+ }
596
+ },
597
+ "expect": {
598
+ "kind": "error",
599
+ "codes": [
600
+ "FORBIDDEN"
601
+ ],
602
+ "preExecution": true
603
+ }
604
+ },
605
+ {
606
+ "id": "bindPurchase.auth.precedes-validation",
607
+ "operation": "bindPurchase",
608
+ "credential": "invalid",
609
+ "input": {
610
+ "userId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
611
+ "store": "google",
612
+ "google": {
613
+ "purchaseToken": "conformance-google-purchase-token-0000000001"
614
+ }
615
+ },
616
+ "expect": {
617
+ "kind": "error",
618
+ "codes": [
619
+ "UNAUTHORIZED"
620
+ ],
621
+ "preExecution": true
622
+ }
623
+ },
624
+ {
625
+ "id": "bindPurchase.auth.precedes-structural-validation",
626
+ "operation": "bindPurchase",
627
+ "credential": "invalid",
628
+ "input": {},
629
+ "expect": {
630
+ "kind": "error",
631
+ "codes": [
632
+ "UNAUTHORIZED"
633
+ ],
634
+ "preExecution": true
635
+ }
636
+ },
637
+ {
638
+ "id": "bindPurchase.input.missing-required-member",
639
+ "operation": "bindPurchase",
640
+ "credential": "server",
641
+ "input": {},
642
+ "expect": {
643
+ "kind": "error",
644
+ "codes": [
645
+ "INVALID_REQUEST"
646
+ ]
647
+ }
648
+ },
649
+ {
650
+ "id": "bindPurchase.success.contract",
651
+ "operation": "bindPurchase",
652
+ "credential": "server",
653
+ "input": {
654
+ "userId": "conformance-user-1",
655
+ "store": "google",
656
+ "google": {
657
+ "purchaseToken": "conformance-google-purchase-token-0000000001"
658
+ }
659
+ },
660
+ "requiresStore": "google",
661
+ "expect": {
662
+ "kind": "result",
663
+ "schema": "BindPurchaseResult"
664
+ }
665
+ },
666
+ {
667
+ "id": "bindPurchase.input.unknown-member-ignored",
668
+ "operation": "bindPurchase",
669
+ "credential": "server",
670
+ "input": {
671
+ "userId": "conformance-user-1",
672
+ "store": "google",
673
+ "google": {
674
+ "purchaseToken": "conformance-google-purchase-token-0000000001"
675
+ },
676
+ "unknownFutureMember": "ignored"
677
+ },
678
+ "bindings": [
679
+ "rest"
680
+ ],
681
+ "requiresStore": "google",
682
+ "expect": {
683
+ "kind": "result",
684
+ "schema": "BindPurchaseResult"
685
+ }
686
+ },
687
+ {
688
+ "id": "bindPurchase.idempotent.repeat",
689
+ "operation": "bindPurchase",
690
+ "credential": "server",
691
+ "input": {
692
+ "userId": "conformance-user-1",
693
+ "store": "google",
694
+ "google": {
695
+ "purchaseToken": "conformance-google-purchase-token-0000000001"
696
+ }
697
+ },
698
+ "repeat": 2,
699
+ "requiresStore": "google",
700
+ "expect": {
701
+ "kind": "result",
702
+ "schema": "BindPurchaseResult"
703
+ }
704
+ },
705
+ {
706
+ "id": "bindPurchase.success.contract.apple",
707
+ "operation": "bindPurchase",
708
+ "credential": "server",
709
+ "input": {
710
+ "userId": "conformance-user-1",
711
+ "store": "apple",
712
+ "apple": {
713
+ "jws": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0.c2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJl"
714
+ }
715
+ },
716
+ "requiresStore": "apple",
717
+ "expect": {
718
+ "kind": "result",
719
+ "schema": "BindPurchaseResult"
720
+ }
721
+ },
722
+ {
723
+ "id": "bindPurchase.input.unknown-member-ignored.apple",
724
+ "operation": "bindPurchase",
725
+ "credential": "server",
726
+ "input": {
727
+ "userId": "conformance-user-1",
728
+ "store": "apple",
729
+ "apple": {
730
+ "jws": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0.c2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJl"
731
+ },
732
+ "unknownFutureMember": "ignored"
733
+ },
734
+ "bindings": [
735
+ "rest"
736
+ ],
737
+ "requiresStore": "apple",
738
+ "expect": {
739
+ "kind": "result",
740
+ "schema": "BindPurchaseResult"
741
+ }
742
+ },
743
+ {
744
+ "id": "bindPurchase.idempotent.repeat.apple",
745
+ "operation": "bindPurchase",
746
+ "credential": "server",
747
+ "input": {
748
+ "userId": "conformance-user-1",
749
+ "store": "apple",
750
+ "apple": {
751
+ "jws": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0eyJjb25mb3JtYW5jZSI6dHJ1ZX0.c2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJlc2lnbmF0dXJl"
752
+ }
753
+ },
754
+ "repeat": 2,
755
+ "requiresStore": "apple",
756
+ "expect": {
757
+ "kind": "result",
758
+ "schema": "BindPurchaseResult"
759
+ }
760
+ },
761
+ {
762
+ "id": "bindPurchase.success.contract.horizon",
763
+ "operation": "bindPurchase",
764
+ "credential": "server",
765
+ "input": {
766
+ "userId": "conformance-user-1",
767
+ "store": "horizon",
768
+ "horizon": {
769
+ "userId": "1234567890123456",
770
+ "sku": "conformance.sku"
771
+ }
772
+ },
773
+ "requiresStore": "horizon",
774
+ "expect": {
775
+ "kind": "result",
776
+ "schema": "BindPurchaseResult"
777
+ }
778
+ },
779
+ {
780
+ "id": "bindPurchase.input.unknown-member-ignored.horizon",
781
+ "operation": "bindPurchase",
782
+ "credential": "server",
783
+ "input": {
784
+ "userId": "conformance-user-1",
785
+ "store": "horizon",
786
+ "horizon": {
787
+ "userId": "1234567890123456",
788
+ "sku": "conformance.sku"
789
+ },
790
+ "unknownFutureMember": "ignored"
791
+ },
792
+ "bindings": [
793
+ "rest"
794
+ ],
795
+ "requiresStore": "horizon",
796
+ "expect": {
797
+ "kind": "result",
798
+ "schema": "BindPurchaseResult"
799
+ }
800
+ },
801
+ {
802
+ "id": "bindPurchase.idempotent.repeat.horizon",
803
+ "operation": "bindPurchase",
804
+ "credential": "server",
805
+ "input": {
806
+ "userId": "conformance-user-1",
807
+ "store": "horizon",
808
+ "horizon": {
809
+ "userId": "1234567890123456",
810
+ "sku": "conformance.sku"
811
+ }
812
+ },
813
+ "repeat": 2,
814
+ "requiresStore": "horizon",
815
+ "expect": {
816
+ "kind": "result",
817
+ "schema": "BindPurchaseResult"
818
+ }
819
+ },
820
+ {
821
+ "id": "bindPurchase.success.contract.amazon",
822
+ "operation": "bindPurchase",
823
+ "credential": "server",
824
+ "input": {
825
+ "userId": "conformance-user-1",
826
+ "store": "amazon",
827
+ "amazon": {
828
+ "userId": "conformance-amazon-user-1",
829
+ "receiptId": "conformance-amazon-receipt-0000000001",
830
+ "sandbox": true
831
+ }
832
+ },
833
+ "requiresStore": "amazon",
834
+ "expect": {
835
+ "kind": "result",
836
+ "schema": "BindPurchaseResult"
837
+ }
838
+ },
839
+ {
840
+ "id": "bindPurchase.input.unknown-member-ignored.amazon",
841
+ "operation": "bindPurchase",
842
+ "credential": "server",
843
+ "input": {
844
+ "userId": "conformance-user-1",
845
+ "store": "amazon",
846
+ "amazon": {
847
+ "userId": "conformance-amazon-user-1",
848
+ "receiptId": "conformance-amazon-receipt-0000000001",
849
+ "sandbox": true
850
+ },
851
+ "unknownFutureMember": "ignored"
852
+ },
853
+ "bindings": [
854
+ "rest"
855
+ ],
856
+ "requiresStore": "amazon",
857
+ "expect": {
858
+ "kind": "result",
859
+ "schema": "BindPurchaseResult"
860
+ }
861
+ },
862
+ {
863
+ "id": "bindPurchase.idempotent.repeat.amazon",
864
+ "operation": "bindPurchase",
865
+ "credential": "server",
866
+ "input": {
867
+ "userId": "conformance-user-1",
868
+ "store": "amazon",
869
+ "amazon": {
870
+ "userId": "conformance-amazon-user-1",
871
+ "receiptId": "conformance-amazon-receipt-0000000001",
872
+ "sandbox": true
873
+ }
874
+ },
875
+ "repeat": 2,
876
+ "requiresStore": "amazon",
877
+ "expect": {
878
+ "kind": "result",
879
+ "schema": "BindPurchaseResult"
880
+ }
881
+ },
882
+ {
883
+ "id": "eraseUser.auth.missing-credential",
884
+ "operation": "eraseUser",
885
+ "credential": null,
886
+ "input": {
887
+ "userId": "conformance-erasure-user-1"
888
+ },
889
+ "expect": {
890
+ "kind": "error",
891
+ "codes": [
892
+ "UNAUTHORIZED"
893
+ ],
894
+ "preExecution": true
895
+ }
896
+ },
897
+ {
898
+ "id": "eraseUser.auth.unknown-credential",
899
+ "operation": "eraseUser",
900
+ "credential": "invalid",
901
+ "input": {
902
+ "userId": "conformance-erasure-user-1"
903
+ },
904
+ "expect": {
905
+ "kind": "error",
906
+ "codes": [
907
+ "UNAUTHORIZED"
908
+ ],
909
+ "preExecution": true
910
+ }
911
+ },
912
+ {
913
+ "id": "eraseUser.auth.verification-role-refused",
914
+ "operation": "eraseUser",
915
+ "credential": "verification",
916
+ "input": {
917
+ "userId": "conformance-erasure-user-1"
918
+ },
919
+ "expect": {
920
+ "kind": "error",
921
+ "codes": [
922
+ "FORBIDDEN"
923
+ ],
924
+ "preExecution": true
925
+ }
926
+ },
927
+ {
928
+ "id": "eraseUser.auth.precedes-validation",
929
+ "operation": "eraseUser",
930
+ "credential": "invalid",
931
+ "input": {
932
+ "userId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
933
+ },
934
+ "expect": {
935
+ "kind": "error",
936
+ "codes": [
937
+ "UNAUTHORIZED"
938
+ ],
939
+ "preExecution": true
940
+ }
941
+ },
942
+ {
943
+ "id": "eraseUser.auth.precedes-structural-validation",
944
+ "operation": "eraseUser",
945
+ "credential": "invalid",
946
+ "input": {},
947
+ "expect": {
948
+ "kind": "error",
949
+ "codes": [
950
+ "UNAUTHORIZED"
951
+ ],
952
+ "preExecution": true
953
+ }
954
+ },
955
+ {
956
+ "id": "eraseUser.input.missing-required-member",
957
+ "operation": "eraseUser",
958
+ "credential": "server",
959
+ "input": {},
960
+ "expect": {
961
+ "kind": "error",
962
+ "codes": [
963
+ "INVALID_REQUEST"
964
+ ]
965
+ }
966
+ },
967
+ {
968
+ "id": "eraseUser.success.contract",
969
+ "operation": "eraseUser",
970
+ "credential": "server",
971
+ "input": {
972
+ "userId": "conformance-erasure-user-1"
973
+ },
974
+ "expect": {
975
+ "kind": "result",
976
+ "schema": "EraseUserResult",
977
+ "ignoreMembers": [
978
+ "status"
979
+ ]
980
+ }
981
+ },
982
+ {
983
+ "id": "eraseUser.input.unknown-member-ignored",
984
+ "operation": "eraseUser",
985
+ "credential": "server",
986
+ "input": {
987
+ "userId": "conformance-erasure-user-1",
988
+ "unknownFutureMember": "ignored"
989
+ },
990
+ "bindings": [
991
+ "rest"
992
+ ],
993
+ "expect": {
994
+ "kind": "result",
995
+ "schema": "EraseUserResult",
996
+ "ignoreMembers": [
997
+ "status"
998
+ ]
999
+ }
1000
+ },
1001
+ {
1002
+ "id": "eraseUser.idempotent.repeat",
1003
+ "operation": "eraseUser",
1004
+ "credential": "server",
1005
+ "input": {
1006
+ "userId": "conformance-erasure-user-1"
1007
+ },
1008
+ "repeat": 2,
1009
+ "expect": {
1010
+ "kind": "result",
1011
+ "schema": "EraseUserResult",
1012
+ "ignoreMembers": [
1013
+ "status"
1014
+ ]
1015
+ }
1016
+ },
1017
+ {
1018
+ "id": "verifyPurchase.store.unsupported",
1019
+ "operation": "verifyPurchase",
1020
+ "credential": "verification",
1021
+ "input": {
1022
+ "store": "a_store_openiap_has_never_heard_of"
1023
+ },
1024
+ "expect": {
1025
+ "kind": "error",
1026
+ "codes": [
1027
+ "UNSUPPORTED_STORE"
1028
+ ]
1029
+ }
1030
+ },
1031
+ {
1032
+ "id": "verifyPurchase.input.mismatched-evidence",
1033
+ "operation": "verifyPurchase",
1034
+ "credential": "verification",
1035
+ "input": {
1036
+ "store": "apple",
1037
+ "google": {
1038
+ "purchaseToken": "conformance-google-purchase-token-0000000001"
1039
+ }
1040
+ },
1041
+ "expect": {
1042
+ "kind": "error",
1043
+ "codes": [
1044
+ "INVALID_REQUEST"
1045
+ ]
1046
+ }
1047
+ },
1048
+ {
1049
+ "id": "providerCapabilities.honesty.binding-declared",
1050
+ "operation": "providerCapabilities",
1051
+ "credential": null,
1052
+ "input": null,
1053
+ "expect": {
1054
+ "kind": "result",
1055
+ "schema": "ProviderCapabilities",
1056
+ "checks": [
1057
+ "declaresTestedBinding"
1058
+ ]
1059
+ }
1060
+ },
1061
+ {
1062
+ "id": "bindPurchase.unknown-evidence.not-bound",
1063
+ "operation": "bindPurchase",
1064
+ "credential": "server",
1065
+ "input": {
1066
+ "userId": "conformance-user-1",
1067
+ "store": "google",
1068
+ "google": {
1069
+ "purchaseToken": "conformance-google-purchase-token-unknown-9999"
1070
+ }
1071
+ },
1072
+ "requiresStore": "google",
1073
+ "expect": {
1074
+ "kind": "result",
1075
+ "schema": "BindPurchaseResult",
1076
+ "resultSubset": {
1077
+ "bound": false
1078
+ }
1079
+ }
1080
+ },
1081
+ {
1082
+ "id": "bindPurchase.unbindable-store.not-bound",
1083
+ "operation": "bindPurchase",
1084
+ "credential": "server",
1085
+ "input": {
1086
+ "userId": "conformance-user-1",
1087
+ "store": "horizon",
1088
+ "horizon": {
1089
+ "userId": "mock-store-user",
1090
+ "sku": "mock.premium"
1091
+ }
1092
+ },
1093
+ "requiresStore": "horizon",
1094
+ "expect": {
1095
+ "kind": "result",
1096
+ "schema": "BindPurchaseResult",
1097
+ "resultSubset": {
1098
+ "bound": false
1099
+ }
1100
+ }
1101
+ },
1102
+ {
1103
+ "id": "entitlements.unknown-user.empty",
1104
+ "operation": "entitlements",
1105
+ "credential": "server",
1106
+ "input": {
1107
+ "userId": "conformance-user-the-provider-never-heard-of"
1108
+ },
1109
+ "expect": {
1110
+ "kind": "result",
1111
+ "schema": "EntitlementsResult",
1112
+ "checks": [
1113
+ "tokenless",
1114
+ "entitlementsConsistency"
1115
+ ],
1116
+ "resultSubset": {
1117
+ "productIds": []
1118
+ }
1119
+ }
1120
+ }
1121
+ ]
1122
+ }