@twin.org/immutable-proof-service 0.0.1-next.3 → 0.0.1-next.30

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.
@@ -1,733 +1,706 @@
1
1
  {
2
- "openapi": "3.1.0",
3
- "info": {
4
- "title": "TWIN - Test Endpoints",
5
- "description": "REST API for TWIN - Test Endpoints.",
6
- "version": "1.0.0",
7
- "license": {
8
- "name": "Apache 2.0 License",
9
- "url": "https://opensource.org/licenses/Apache-2.0"
10
- }
11
- },
12
- "servers": [
13
- {
14
- "url": "https://localhost"
15
- }
16
- ],
17
- "tags": [
18
- {
19
- "name": "Immutable Proof",
20
- "description": "Endpoints which are modelled to access an immutable proof contract."
21
- }
22
- ],
23
- "paths": {
24
- "/immutable-proof": {
25
- "post": {
26
- "operationId": "immutableProofCreate",
27
- "summary": "Create a proof",
28
- "tags": [
29
- "Immutable Proof"
30
- ],
31
- "security": [
32
- {
33
- "jwtBearerAuthScheme": []
34
- }
35
- ],
36
- "requestBody": {
37
- "description": "Create a proof.",
38
- "required": true,
39
- "content": {
40
- "application/json": {
41
- "schema": {
42
- "$ref": "#/components/schemas/ImmutableProofCreateRequest"
43
- },
44
- "examples": {
45
- "immutableProofCreateRequestExample": {
46
- "value": {
47
- "proofObject": {
48
- "@context": "http://schema.org",
49
- "type": "Person",
50
- "name": "John Smith"
51
- }
52
- }
53
- }
54
- }
55
- }
56
- }
57
- },
58
- "responses": {
59
- "201": {
60
- "description": "The rest request ended in created response.",
61
- "headers": {
62
- "location": {
63
- "schema": {
64
- "type": "string"
65
- },
66
- "description": "e.g. test:1234567890"
67
- }
68
- }
69
- },
70
- "400": {
71
- "description": "The server cannot process the request, see the content for more details.",
72
- "content": {
73
- "application/json": {
74
- "schema": {
75
- "$ref": "#/components/schemas/Error"
76
- },
77
- "examples": {
78
- "exampleResponse": {
79
- "value": {
80
- "name": "GeneralError",
81
- "message": "component.error",
82
- "properties": {
83
- "foo": "bar"
84
- }
85
- }
86
- }
87
- }
88
- }
89
- }
90
- },
91
- "401": {
92
- "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
93
- "content": {
94
- "application/json": {
95
- "schema": {
96
- "$ref": "#/components/schemas/Error"
97
- },
98
- "examples": {
99
- "exampleResponse": {
100
- "value": {
101
- "name": "UnauthorizedError",
102
- "message": "component.error"
103
- }
104
- }
105
- }
106
- }
107
- }
108
- },
109
- "404": {
110
- "description": "The resource you tried to access does not exist, see the content for more details.",
111
- "content": {
112
- "application/json": {
113
- "schema": {
114
- "$ref": "#/components/schemas/NotFoundResponse"
115
- },
116
- "examples": {
117
- "exampleResponse": {
118
- "value": {
119
- "name": "NotFoundError",
120
- "message": "component.error",
121
- "properties": {
122
- "notFoundId": "1"
123
- }
124
- }
125
- }
126
- }
127
- }
128
- }
129
- },
130
- "500": {
131
- "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
132
- "content": {
133
- "application/json": {
134
- "schema": {
135
- "$ref": "#/components/schemas/Error"
136
- },
137
- "examples": {
138
- "exampleResponse": {
139
- "value": {
140
- "name": "InternalServerError",
141
- "message": "component.error"
142
- }
143
- }
144
- }
145
- }
146
- }
147
- }
148
- }
149
- }
150
- },
151
- "/immutable-proof/{id}": {
152
- "get": {
153
- "operationId": "immutableProofGet",
154
- "summary": "Get a proof",
155
- "tags": [
156
- "Immutable Proof"
157
- ],
158
- "parameters": [
159
- {
160
- "name": "id",
161
- "description": "The id of the immutable proof to get.",
162
- "in": "path",
163
- "required": true,
164
- "schema": {
165
- "type": "string"
166
- },
167
- "style": "simple",
168
- "example": "ais:1234567890"
169
- },
170
- {
171
- "name": "accept",
172
- "in": "header",
173
- "required": true,
174
- "schema": {
175
- "type": "string"
176
- },
177
- "style": "simple",
178
- "example": "application/json"
179
- }
180
- ],
181
- "security": [
182
- {
183
- "jwtBearerAuthScheme": []
184
- }
185
- ],
186
- "responses": {
187
- "200": {
188
- "description": "Response to getting an immutable proof.",
189
- "content": {
190
- "application/json": {
191
- "schema": {
192
- "$ref": "https://schema.twindev.org/immutable-proof/ImmutableProof"
193
- },
194
- "examples": {
195
- "immutableProofGetResponseExample": {
196
- "value": {
197
- "@context": "https://schema.twindev.org/immutable-proof/",
198
- "type": "ImmutableProof",
199
- "id": "ais:1234567890",
200
- "userIdentity": "user-1",
201
- "proofObjectId": "test:1234567890",
202
- "proofObjectHash": "EAOKyDN0mYQbBh91eMdVeroxQx1H4GfnRbmt6n/2L/Y=",
203
- "proof": {
204
- "@context": "https://w3id.org/security/data-integrity/v2",
205
- "type": "DataIntegrityProof",
206
- "cryptosuite": "eddsa-jcs-2022",
207
- "created": "2024-08-22T11:56:56.272Z",
208
- "proofPurpose": "assertionMethod",
209
- "proofValue": "7DdiPPYtxLjCD3wA1po2rv..."
210
- }
211
- }
212
- }
213
- }
214
- },
215
- "application/ld+json": {
216
- "schema": {
217
- "$ref": "https://schema.twindev.org/immutable-proof/ImmutableProof"
218
- },
219
- "examples": {
220
- "immutableProofJsonLdGetResponseExample": {
221
- "value": {
222
- "@context": "https://schema.twindev.org/immutable-proof/",
223
- "type": "ImmutableProof",
224
- "id": "ais:1234567890",
225
- "userIdentity": "user-1",
226
- "proofObjectId": "test:1234567890",
227
- "proofObjectHash": "EAOKyDN0mYQbBh91eMdVeroxQx1H4GfnRbmt6n/2L/Y=",
228
- "proof": {
229
- "@context": "https://w3id.org/security/data-integrity/v2",
230
- "type": "DataIntegrityProof",
231
- "cryptosuite": "eddsa-jcs-2022",
232
- "created": "2024-08-22T11:56:56.272Z",
233
- "proofPurpose": "assertionMethod",
234
- "proofValue": "7DdiPPYtxLjCD3wA1po2rv..."
235
- }
236
- }
237
- }
238
- }
239
- }
240
- },
241
- "headers": {
242
- "content-type": {
243
- "schema": {
244
- "type": "string"
245
- },
246
- "description": "e.g. application/ld+json"
247
- }
248
- }
249
- },
250
- "400": {
251
- "description": "The server cannot process the request, see the content for more details.",
252
- "content": {
253
- "application/json": {
254
- "schema": {
255
- "$ref": "#/components/schemas/Error"
256
- },
257
- "examples": {
258
- "exampleResponse": {
259
- "value": {
260
- "name": "GeneralError",
261
- "message": "component.error",
262
- "properties": {
263
- "foo": "bar"
264
- }
265
- }
266
- }
267
- }
268
- }
269
- }
270
- },
271
- "401": {
272
- "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
273
- "content": {
274
- "application/json": {
275
- "schema": {
276
- "$ref": "#/components/schemas/Error"
277
- },
278
- "examples": {
279
- "exampleResponse": {
280
- "value": {
281
- "name": "UnauthorizedError",
282
- "message": "component.error"
283
- }
284
- }
285
- }
286
- }
287
- }
288
- },
289
- "404": {
290
- "description": "The resource you tried to access does not exist, see the content for more details.",
291
- "content": {
292
- "application/json": {
293
- "schema": {
294
- "$ref": "#/components/schemas/NotFoundResponse"
295
- },
296
- "examples": {
297
- "exampleResponse": {
298
- "value": {
299
- "name": "NotFoundError",
300
- "message": "component.error",
301
- "properties": {
302
- "notFoundId": "1"
303
- }
304
- }
305
- }
306
- }
307
- }
308
- }
309
- },
310
- "500": {
311
- "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
312
- "content": {
313
- "application/json": {
314
- "schema": {
315
- "$ref": "#/components/schemas/Error"
316
- },
317
- "examples": {
318
- "exampleResponse": {
319
- "value": {
320
- "name": "InternalServerError",
321
- "message": "component.error"
322
- }
323
- }
324
- }
325
- }
326
- }
327
- }
328
- }
329
- },
330
- "post": {
331
- "operationId": "immutableProofVerify",
332
- "summary": "Verify a proof",
333
- "tags": [
334
- "Immutable Proof"
335
- ],
336
- "parameters": [
337
- {
338
- "name": "id",
339
- "description": "The id of the immutable proof to verify.",
340
- "in": "path",
341
- "required": true,
342
- "schema": {
343
- "type": "string"
344
- },
345
- "style": "simple",
346
- "example": "ais:1234567890"
347
- },
348
- {
349
- "name": "accept",
350
- "in": "header",
351
- "required": true,
352
- "schema": {
353
- "type": "string"
354
- },
355
- "style": "simple"
356
- }
357
- ],
358
- "security": [
359
- {
360
- "jwtBearerAuthScheme": []
361
- }
362
- ],
363
- "requestBody": {
364
- "description": "Verify a proof.",
365
- "required": true,
366
- "content": {
367
- "application/json": {
368
- "schema": {
369
- "$ref": "#/components/schemas/ImmutableProofVerifyRequest"
370
- },
371
- "examples": {
372
- "immutableProofVerifyRequestExample": {
373
- "value": {
374
- "proofObject": {
375
- "@context": "http://schema.org",
376
- "type": "Person",
377
- "name": "John Smith"
378
- }
379
- }
380
- }
381
- }
382
- }
383
- }
384
- },
385
- "responses": {
386
- "200": {
387
- "description": "Response to verifying an immutable proof.",
388
- "content": {
389
- "application/json": {
390
- "schema": {
391
- "$ref": "https://schema.twindev.org/immutable-proof/ImmutableProofVerification"
392
- },
393
- "examples": {
394
- "immutableProofVerifyResponseExample": {
395
- "value": {
396
- "@context": "https://schema.twindev.org/immutable-proof/",
397
- "type": "ImmutableProofVerification",
398
- "verified": true
399
- }
400
- },
401
- "immutableProofVerifyResponseFailExample": {
402
- "value": {
403
- "@context": "https://schema.twindev.org/immutable-proof/",
404
- "type": "ImmutableProofVerification",
405
- "verified": false,
406
- "failure": "proofTypeMismatch"
407
- }
408
- }
409
- }
410
- }
411
- }
412
- },
413
- "400": {
414
- "description": "The server cannot process the request, see the content for more details.",
415
- "content": {
416
- "application/json": {
417
- "schema": {
418
- "$ref": "#/components/schemas/Error"
419
- },
420
- "examples": {
421
- "exampleResponse": {
422
- "value": {
423
- "name": "GeneralError",
424
- "message": "component.error",
425
- "properties": {
426
- "foo": "bar"
427
- }
428
- }
429
- }
430
- }
431
- }
432
- }
433
- },
434
- "401": {
435
- "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
436
- "content": {
437
- "application/json": {
438
- "schema": {
439
- "$ref": "#/components/schemas/Error"
440
- },
441
- "examples": {
442
- "exampleResponse": {
443
- "value": {
444
- "name": "UnauthorizedError",
445
- "message": "component.error"
446
- }
447
- }
448
- }
449
- }
450
- }
451
- },
452
- "404": {
453
- "description": "The resource you tried to access does not exist, see the content for more details.",
454
- "content": {
455
- "application/json": {
456
- "schema": {
457
- "$ref": "#/components/schemas/NotFoundResponse"
458
- },
459
- "examples": {
460
- "exampleResponse": {
461
- "value": {
462
- "name": "NotFoundError",
463
- "message": "component.error",
464
- "properties": {
465
- "notFoundId": "1"
466
- }
467
- }
468
- }
469
- }
470
- }
471
- }
472
- },
473
- "500": {
474
- "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
475
- "content": {
476
- "application/json": {
477
- "schema": {
478
- "$ref": "#/components/schemas/Error"
479
- },
480
- "examples": {
481
- "exampleResponse": {
482
- "value": {
483
- "name": "InternalServerError",
484
- "message": "component.error"
485
- }
486
- }
487
- }
488
- }
489
- }
490
- }
491
- }
492
- }
493
- }
494
- },
495
- "components": {
496
- "schemas": {
497
- "DidCryptoSuites": {
498
- "anyOf": [
499
- {
500
- "type": "string",
501
- "const": "eddsa-jcs-2022",
502
- "description": "The type for EdDSA crypto suite for JSON Canonicalization Scheme [RFC8785]. https://www.w3.org/TR/vc-di-eddsa/#eddsa-jcs-2022"
503
- },
504
- {
505
- "type": "string",
506
- "const": "eddsa-rdfc-2022",
507
- "description": "The type for EdDSA crypto suite for RDF Dataset Canonicalization. https://www.w3.org/TR/vc-di-eddsa/#eddsa-rdfc-2022"
508
- }
509
- ],
510
- "description": "The types for DID Proof crypto suites."
511
- },
512
- "DidProof": {
513
- "type": "object",
514
- "properties": {
515
- "@context": {
516
- "anyOf": [
517
- {
518
- "type": "string",
519
- "const": "https://w3id.org/security/data-integrity/v2"
520
- },
521
- {
522
- "type": "array",
523
- "minItems": 1,
524
- "items": [
525
- {
526
- "type": "string",
527
- "const": "https://w3id.org/security/data-integrity/v2"
528
- }
529
- ],
530
- "additionalItems": {
531
- "type": "string"
532
- }
533
- }
534
- ],
535
- "description": "JSON-LD Context."
536
- },
537
- "type": {
538
- "type": "string",
539
- "const": "DataIntegrityProof",
540
- "description": "JSON-LD Type."
541
- },
542
- "cryptosuite": {
543
- "anyOf": [
544
- {
545
- "$ref": "#/components/schemas/DidCryptoSuites"
546
- },
547
- {
548
- "type": "string"
549
- }
550
- ],
551
- "description": "An identifier for the cryptographic suite that can be used to verify the proof."
552
- },
553
- "id": {
554
- "type": "string",
555
- "description": "The id of the proof."
556
- },
557
- "proofPurpose": {
558
- "type": "string",
559
- "description": "The reason the proof was created."
560
- },
561
- "proofValue": {
562
- "type": "string",
563
- "description": "Contains the base-encoded binary data necessary to verify the digital proof using the verificationMethod specified."
564
- },
565
- "verificationMethod": {
566
- "type": "string",
567
- "description": "The verification method of the proof."
568
- },
569
- "created": {
570
- "type": "string",
571
- "description": "The iso date of when the proof was created."
572
- },
573
- "expires": {
574
- "type": "string",
575
- "description": "The iso date of when the proof expires."
576
- },
577
- "domain": {
578
- "anyOf": [
579
- {
580
- "type": "string"
581
- },
582
- {
583
- "type": "array",
584
- "items": {
585
- "type": "string"
586
- }
587
- }
588
- ],
589
- "description": "One or more security domains in which the proof is meant to be used."
590
- },
591
- "challenge": {
592
- "anyOf": [
593
- {
594
- "type": "string"
595
- },
596
- {
597
- "type": "array",
598
- "items": {
599
- "type": "string"
600
- }
601
- }
602
- ],
603
- "description": "Provided to mitigate replay attacks on domains."
604
- },
605
- "previousProof": {
606
- "type": "string",
607
- "description": "Identifies another data integrity proof that MUST verify before the current proof is processed"
608
- },
609
- "nonce": {
610
- "type": "string",
611
- "description": "Use of this field is to increase privacy by decreasing linkability that is the result of deterministically generated signatures."
612
- }
613
- },
614
- "required": [
615
- "@context",
616
- "type",
617
- "cryptosuite",
618
- "proofPurpose",
619
- "proofValue"
620
- ],
621
- "additionalProperties": false,
622
- "description": "Interface describing a did proof. https://www.w3.org/TR/vc-data-integrity/"
623
- },
624
- "Error": {
625
- "type": "object",
626
- "properties": {
627
- "name": {
628
- "type": "string",
629
- "description": "The name for the error."
630
- },
631
- "message": {
632
- "type": "string",
633
- "description": "The message for the error."
634
- },
635
- "source": {
636
- "type": "string",
637
- "description": "The source of the error."
638
- },
639
- "properties": {
640
- "type": "object",
641
- "additionalProperties": {},
642
- "description": "Any additional information for the error."
643
- },
644
- "stack": {
645
- "type": "string",
646
- "description": "The stack trace for the error."
647
- },
648
- "inner": {
649
- "$ref": "#/components/schemas/Error"
650
- }
651
- },
652
- "required": [
653
- "name",
654
- "message"
655
- ],
656
- "additionalProperties": false,
657
- "description": "Model to describe serialized error."
658
- },
659
- "ImmutableProofCreateRequest": {
660
- "type": "object",
661
- "properties": {
662
- "proofObject": {
663
- "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
664
- }
665
- },
666
- "required": [
667
- "proofObject"
668
- ],
669
- "additionalProperties": false,
670
- "description": "The parameters from the body."
671
- },
672
- "ImmutableProofVerifyRequest": {
673
- "type": "object",
674
- "properties": {
675
- "proofObject": {
676
- "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
677
- }
678
- },
679
- "required": [
680
- "proofObject"
681
- ],
682
- "additionalProperties": false,
683
- "description": "The parameters from the body."
684
- },
685
- "NotFoundResponse": {
686
- "type": "object",
687
- "additionalProperties": false,
688
- "properties": {
689
- "notFoundId": {
690
- "type": "string",
691
- "description": "The id if the item that was not found."
692
- },
693
- "name": {
694
- "type": "string",
695
- "description": "The name for the error."
696
- },
697
- "message": {
698
- "type": "string",
699
- "description": "The message for the error."
700
- },
701
- "source": {
702
- "type": "string",
703
- "description": "The source of the error."
704
- },
705
- "properties": {
706
- "type": "object",
707
- "additionalProperties": {},
708
- "description": "Any additional information for the error."
709
- },
710
- "stack": {
711
- "type": "string",
712
- "description": "The stack trace for the error."
713
- },
714
- "inner": {
715
- "$ref": "#/components/schemas/Error"
716
- }
717
- },
718
- "required": [
719
- "message",
720
- "name"
721
- ],
722
- "description": "The body which contains the error."
723
- }
724
- },
725
- "securitySchemes": {
726
- "jwtBearerAuthScheme": {
727
- "type": "http",
728
- "scheme": "bearer",
729
- "bearerFormat": "JWT"
730
- }
731
- }
732
- }
733
- }
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "TWIN - Test Endpoints",
5
+ "description": "REST API for TWIN - Test Endpoints.",
6
+ "version": "1.0.0",
7
+ "license": {
8
+ "name": "Apache 2.0 License",
9
+ "url": "https://opensource.org/licenses/Apache-2.0"
10
+ }
11
+ },
12
+ "servers": [
13
+ {
14
+ "url": "https://localhost"
15
+ }
16
+ ],
17
+ "tags": [
18
+ {
19
+ "name": "Immutable Proof",
20
+ "description": "Endpoints which are modelled to access an immutable proof contract."
21
+ }
22
+ ],
23
+ "paths": {
24
+ "/immutable-proof": {
25
+ "post": {
26
+ "operationId": "immutableProofCreate",
27
+ "summary": "Create a proof",
28
+ "tags": [
29
+ "Immutable Proof"
30
+ ],
31
+ "security": [
32
+ {
33
+ "jwtBearerAuthScheme": []
34
+ }
35
+ ],
36
+ "requestBody": {
37
+ "description": "Create a proof.",
38
+ "required": true,
39
+ "content": {
40
+ "application/json": {
41
+ "schema": {
42
+ "$ref": "#/components/schemas/ImmutableProofCreateRequest"
43
+ },
44
+ "examples": {
45
+ "immutableProofCreateRequestExample": {
46
+ "value": {
47
+ "document": {
48
+ "@context": "https://schema.org",
49
+ "type": "Person",
50
+ "name": "John Smith"
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ },
58
+ "responses": {
59
+ "201": {
60
+ "description": "The rest request ended in created response.",
61
+ "headers": {
62
+ "location": {
63
+ "schema": {
64
+ "type": "string"
65
+ },
66
+ "description": "e.g. test:1234567890"
67
+ }
68
+ }
69
+ },
70
+ "400": {
71
+ "description": "The server cannot process the request, see the content for more details.",
72
+ "content": {
73
+ "application/json": {
74
+ "schema": {
75
+ "$ref": "#/components/schemas/Error"
76
+ },
77
+ "examples": {
78
+ "exampleResponse": {
79
+ "value": {
80
+ "name": "GeneralError",
81
+ "message": "component.error",
82
+ "properties": {
83
+ "foo": "bar"
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ },
91
+ "401": {
92
+ "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
93
+ "content": {
94
+ "application/json": {
95
+ "schema": {
96
+ "$ref": "#/components/schemas/Error"
97
+ },
98
+ "examples": {
99
+ "exampleResponse": {
100
+ "value": {
101
+ "name": "UnauthorizedError",
102
+ "message": "component.error"
103
+ }
104
+ }
105
+ }
106
+ }
107
+ }
108
+ },
109
+ "404": {
110
+ "description": "The resource you tried to access does not exist, see the content for more details.",
111
+ "content": {
112
+ "application/json": {
113
+ "schema": {
114
+ "$ref": "#/components/schemas/NotFoundResponse"
115
+ },
116
+ "examples": {
117
+ "exampleResponse": {
118
+ "value": {
119
+ "name": "NotFoundError",
120
+ "message": "component.error",
121
+ "properties": {
122
+ "notFoundId": "1"
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+ }
129
+ },
130
+ "500": {
131
+ "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
132
+ "content": {
133
+ "application/json": {
134
+ "schema": {
135
+ "$ref": "#/components/schemas/Error"
136
+ },
137
+ "examples": {
138
+ "exampleResponse": {
139
+ "value": {
140
+ "name": "InternalServerError",
141
+ "message": "component.error"
142
+ }
143
+ }
144
+ }
145
+ }
146
+ }
147
+ }
148
+ }
149
+ }
150
+ },
151
+ "/immutable-proof/{id}": {
152
+ "get": {
153
+ "operationId": "immutableProofGet",
154
+ "summary": "Get a proof",
155
+ "tags": [
156
+ "Immutable Proof"
157
+ ],
158
+ "parameters": [
159
+ {
160
+ "name": "id",
161
+ "description": "The id of the immutable proof to get.",
162
+ "in": "path",
163
+ "required": true,
164
+ "schema": {
165
+ "type": "string"
166
+ },
167
+ "style": "simple",
168
+ "example": "ais:1234567890"
169
+ },
170
+ {
171
+ "name": "accept",
172
+ "in": "header",
173
+ "required": true,
174
+ "schema": {
175
+ "type": "string"
176
+ },
177
+ "style": "simple",
178
+ "example": "application/json"
179
+ }
180
+ ],
181
+ "security": [
182
+ {
183
+ "jwtBearerAuthScheme": []
184
+ }
185
+ ],
186
+ "responses": {
187
+ "200": {
188
+ "description": "Response to getting an immutable proof.",
189
+ "content": {
190
+ "application/json": {
191
+ "schema": {
192
+ "$ref": "https://schema.twindev.org/immutable-proof/ImmutableProof"
193
+ },
194
+ "examples": {
195
+ "immutableProofGetResponseExample": {
196
+ "value": {
197
+ "@context": [
198
+ "https://schema.twindev.org/immutable-proof/",
199
+ "https://schema.twindev.org/common/"
200
+ ],
201
+ "type": "ImmutableProof",
202
+ "id": "ais:1234567890",
203
+ "nodeIdentity": "node-1",
204
+ "userIdentity": "user-1",
205
+ "proofObjectId": "test:1234567890",
206
+ "proofObjectHash": "EAOKyDN0mYQbBh91eMdVeroxQx1H4GfnRbmt6n/2L/Y=",
207
+ "proof": {
208
+ "@context": "https://www.w3.org/ns/credentials/v2",
209
+ "type": "DataIntegrityProof",
210
+ "cryptosuite": "eddsa-jcs-2022",
211
+ "created": "2024-08-22T11:56:56.272Z",
212
+ "proofPurpose": "assertionMethod",
213
+ "proofValue": "7DdiPPYtxLjCD3wA1po2rv..."
214
+ }
215
+ }
216
+ }
217
+ }
218
+ },
219
+ "application/ld+json": {
220
+ "schema": {
221
+ "$ref": "https://schema.twindev.org/immutable-proof/ImmutableProof"
222
+ },
223
+ "examples": {
224
+ "immutableProofJsonLdGetResponseExample": {
225
+ "value": {
226
+ "@context": [
227
+ "https://schema.twindev.org/immutable-proof/",
228
+ "https://schema.twindev.org/common/"
229
+ ],
230
+ "type": "ImmutableProof",
231
+ "id": "ais:1234567890",
232
+ "nodeIdentity": "node-1",
233
+ "userIdentity": "user-1",
234
+ "proofObjectId": "test:1234567890",
235
+ "proofObjectHash": "EAOKyDN0mYQbBh91eMdVeroxQx1H4GfnRbmt6n/2L/Y=",
236
+ "proof": {
237
+ "@context": "https://www.w3.org/ns/credentials/v2",
238
+ "type": "DataIntegrityProof",
239
+ "cryptosuite": "eddsa-jcs-2022",
240
+ "created": "2024-08-22T11:56:56.272Z",
241
+ "proofPurpose": "assertionMethod",
242
+ "proofValue": "7DdiPPYtxLjCD3wA1po2rv..."
243
+ }
244
+ }
245
+ }
246
+ }
247
+ }
248
+ },
249
+ "headers": {
250
+ "content-type": {
251
+ "schema": {
252
+ "type": "string"
253
+ },
254
+ "description": "e.g. application/ld+json"
255
+ }
256
+ }
257
+ },
258
+ "400": {
259
+ "description": "The server cannot process the request, see the content for more details.",
260
+ "content": {
261
+ "application/json": {
262
+ "schema": {
263
+ "$ref": "#/components/schemas/Error"
264
+ },
265
+ "examples": {
266
+ "exampleResponse": {
267
+ "value": {
268
+ "name": "GeneralError",
269
+ "message": "component.error",
270
+ "properties": {
271
+ "foo": "bar"
272
+ }
273
+ }
274
+ }
275
+ }
276
+ }
277
+ }
278
+ },
279
+ "401": {
280
+ "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
281
+ "content": {
282
+ "application/json": {
283
+ "schema": {
284
+ "$ref": "#/components/schemas/Error"
285
+ },
286
+ "examples": {
287
+ "exampleResponse": {
288
+ "value": {
289
+ "name": "UnauthorizedError",
290
+ "message": "component.error"
291
+ }
292
+ }
293
+ }
294
+ }
295
+ }
296
+ },
297
+ "404": {
298
+ "description": "The resource you tried to access does not exist, see the content for more details.",
299
+ "content": {
300
+ "application/json": {
301
+ "schema": {
302
+ "$ref": "#/components/schemas/NotFoundResponse"
303
+ },
304
+ "examples": {
305
+ "exampleResponse": {
306
+ "value": {
307
+ "name": "NotFoundError",
308
+ "message": "component.error",
309
+ "properties": {
310
+ "notFoundId": "1"
311
+ }
312
+ }
313
+ }
314
+ }
315
+ }
316
+ }
317
+ },
318
+ "500": {
319
+ "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
320
+ "content": {
321
+ "application/json": {
322
+ "schema": {
323
+ "$ref": "#/components/schemas/Error"
324
+ },
325
+ "examples": {
326
+ "exampleResponse": {
327
+ "value": {
328
+ "name": "InternalServerError",
329
+ "message": "component.error"
330
+ }
331
+ }
332
+ }
333
+ }
334
+ }
335
+ }
336
+ }
337
+ }
338
+ },
339
+ "/immutable-proof/{id}/verify": {
340
+ "get": {
341
+ "operationId": "immutableProofVerify",
342
+ "summary": "Verify a proof",
343
+ "tags": [
344
+ "Immutable Proof"
345
+ ],
346
+ "parameters": [
347
+ {
348
+ "name": "id",
349
+ "description": "The id of the immutable proof to verify.",
350
+ "in": "path",
351
+ "required": true,
352
+ "schema": {
353
+ "type": "string"
354
+ },
355
+ "style": "simple",
356
+ "example": "ais:1234567890"
357
+ },
358
+ {
359
+ "name": "accept",
360
+ "in": "header",
361
+ "required": true,
362
+ "schema": {
363
+ "type": "string"
364
+ },
365
+ "style": "simple"
366
+ }
367
+ ],
368
+ "security": [
369
+ {
370
+ "jwtBearerAuthScheme": []
371
+ }
372
+ ],
373
+ "responses": {
374
+ "200": {
375
+ "description": "Response to verifying an immutable proof.",
376
+ "content": {
377
+ "application/json": {
378
+ "schema": {
379
+ "$ref": "https://schema.twindev.org/immutable-proof/ImmutableProofVerification"
380
+ },
381
+ "examples": {
382
+ "immutableProofVerifyResponseExample": {
383
+ "value": {
384
+ "@context": "https://schema.twindev.org/immutable-proof/",
385
+ "type": "ImmutableProofVerification",
386
+ "verified": true
387
+ }
388
+ },
389
+ "immutableProofVerifyResponseFailExample": {
390
+ "value": {
391
+ "@context": "https://schema.twindev.org/immutable-proof/",
392
+ "type": "ImmutableProofVerification",
393
+ "verified": false,
394
+ "failure": "proofTypeMismatch"
395
+ }
396
+ }
397
+ }
398
+ }
399
+ }
400
+ },
401
+ "400": {
402
+ "description": "The server cannot process the request, see the content for more details.",
403
+ "content": {
404
+ "application/json": {
405
+ "schema": {
406
+ "$ref": "#/components/schemas/Error"
407
+ },
408
+ "examples": {
409
+ "exampleResponse": {
410
+ "value": {
411
+ "name": "GeneralError",
412
+ "message": "component.error",
413
+ "properties": {
414
+ "foo": "bar"
415
+ }
416
+ }
417
+ }
418
+ }
419
+ }
420
+ }
421
+ },
422
+ "401": {
423
+ "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
424
+ "content": {
425
+ "application/json": {
426
+ "schema": {
427
+ "$ref": "#/components/schemas/Error"
428
+ },
429
+ "examples": {
430
+ "exampleResponse": {
431
+ "value": {
432
+ "name": "UnauthorizedError",
433
+ "message": "component.error"
434
+ }
435
+ }
436
+ }
437
+ }
438
+ }
439
+ },
440
+ "404": {
441
+ "description": "The resource you tried to access does not exist, see the content for more details.",
442
+ "content": {
443
+ "application/json": {
444
+ "schema": {
445
+ "$ref": "#/components/schemas/NotFoundResponse"
446
+ },
447
+ "examples": {
448
+ "exampleResponse": {
449
+ "value": {
450
+ "name": "NotFoundError",
451
+ "message": "component.error",
452
+ "properties": {
453
+ "notFoundId": "1"
454
+ }
455
+ }
456
+ }
457
+ }
458
+ }
459
+ }
460
+ },
461
+ "500": {
462
+ "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
463
+ "content": {
464
+ "application/json": {
465
+ "schema": {
466
+ "$ref": "#/components/schemas/Error"
467
+ },
468
+ "examples": {
469
+ "exampleResponse": {
470
+ "value": {
471
+ "name": "InternalServerError",
472
+ "message": "component.error"
473
+ }
474
+ }
475
+ }
476
+ }
477
+ }
478
+ }
479
+ }
480
+ }
481
+ }
482
+ },
483
+ "components": {
484
+ "schemas": {
485
+ "DataIntegrityProof": {
486
+ "type": "object",
487
+ "properties": {
488
+ "@context": {
489
+ "anyOf": [
490
+ {
491
+ "type": "string",
492
+ "const": "https://www.w3.org/ns/credentials/v2"
493
+ },
494
+ {
495
+ "type": "array",
496
+ "minItems": 1,
497
+ "items": [
498
+ {
499
+ "type": "string",
500
+ "const": "https://www.w3.org/ns/credentials/v2"
501
+ }
502
+ ],
503
+ "additionalItems": {
504
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
505
+ }
506
+ }
507
+ ],
508
+ "description": "JSON-LD Context."
509
+ },
510
+ "type": {
511
+ "type": "string",
512
+ "const": "DataIntegrityProof",
513
+ "description": "JSON-LD Type."
514
+ },
515
+ "cryptosuite": {
516
+ "anyOf": [
517
+ {
518
+ "$ref": "#/components/schemas/DidCryptoSuites"
519
+ },
520
+ {
521
+ "type": "string"
522
+ }
523
+ ],
524
+ "description": "An identifier for the cryptographic suite that can be used to verify the proof."
525
+ },
526
+ "id": {
527
+ "type": "string",
528
+ "description": "The id of the proof."
529
+ },
530
+ "proofPurpose": {
531
+ "type": "string",
532
+ "description": "The reason the proof was created."
533
+ },
534
+ "proofValue": {
535
+ "type": "string",
536
+ "description": "Contains the base-encoded binary data necessary to verify the digital proof using the verificationMethod specified."
537
+ },
538
+ "verificationMethod": {
539
+ "type": "string",
540
+ "description": "The verification method of the proof."
541
+ },
542
+ "created": {
543
+ "type": "string",
544
+ "description": "The iso date of when the proof was created."
545
+ },
546
+ "expires": {
547
+ "type": "string",
548
+ "description": "The iso date of when the proof expires."
549
+ },
550
+ "domain": {
551
+ "anyOf": [
552
+ {
553
+ "type": "string"
554
+ },
555
+ {
556
+ "type": "array",
557
+ "items": {
558
+ "type": "string"
559
+ }
560
+ }
561
+ ],
562
+ "description": "One or more security domains in which the proof is meant to be used."
563
+ },
564
+ "challenge": {
565
+ "anyOf": [
566
+ {
567
+ "type": "string"
568
+ },
569
+ {
570
+ "type": "array",
571
+ "items": {
572
+ "type": "string"
573
+ }
574
+ }
575
+ ],
576
+ "description": "Provided to mitigate replay attacks on domains."
577
+ },
578
+ "previousProof": {
579
+ "type": "string",
580
+ "description": "Identifies another data integrity proof that MUST verify before the current proof is processed"
581
+ },
582
+ "nonce": {
583
+ "type": "string",
584
+ "description": "Use of this field is to increase privacy by decreasing linkability that is the result of deterministically generated signatures."
585
+ }
586
+ },
587
+ "required": [
588
+ "type",
589
+ "cryptosuite",
590
+ "proofPurpose"
591
+ ],
592
+ "additionalProperties": false,
593
+ "description": "Interface describing a did proof. https://www.w3.org/TR/vc-data-integrity/"
594
+ },
595
+ "DidCryptoSuites": {
596
+ "anyOf": [
597
+ {
598
+ "type": "string",
599
+ "const": "eddsa-jcs-2022",
600
+ "description": "The type for EdDSA crypto suite for JSON Canonicalization Scheme [RFC8785]. https://www.w3.org/TR/vc-di-eddsa/#eddsa-jcs-2022"
601
+ },
602
+ {
603
+ "type": "string",
604
+ "const": "eddsa-rdfc-2022",
605
+ "description": "The type for EdDSA crypto suite for RDF Dataset Canonicalization. https://www.w3.org/TR/vc-di-eddsa/#eddsa-rdfc-2022"
606
+ }
607
+ ],
608
+ "description": "The types for DID Proof crypto suites."
609
+ },
610
+ "Error": {
611
+ "type": "object",
612
+ "properties": {
613
+ "name": {
614
+ "type": "string",
615
+ "description": "The name for the error."
616
+ },
617
+ "message": {
618
+ "type": "string",
619
+ "description": "The message for the error."
620
+ },
621
+ "source": {
622
+ "type": "string",
623
+ "description": "The source of the error."
624
+ },
625
+ "properties": {
626
+ "type": "object",
627
+ "additionalProperties": {},
628
+ "description": "Any additional information for the error."
629
+ },
630
+ "stack": {
631
+ "type": "string",
632
+ "description": "The stack trace for the error."
633
+ },
634
+ "inner": {
635
+ "$ref": "#/components/schemas/Error"
636
+ }
637
+ },
638
+ "required": [
639
+ "name",
640
+ "message"
641
+ ],
642
+ "additionalProperties": false,
643
+ "description": "Model to describe serialized error."
644
+ },
645
+ "ImmutableProofCreateRequest": {
646
+ "type": "object",
647
+ "properties": {
648
+ "document": {
649
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
650
+ }
651
+ },
652
+ "required": [
653
+ "document"
654
+ ],
655
+ "additionalProperties": false,
656
+ "description": "The parameters from the body."
657
+ },
658
+ "NotFoundResponse": {
659
+ "type": "object",
660
+ "additionalProperties": false,
661
+ "properties": {
662
+ "notFoundId": {
663
+ "type": "string",
664
+ "description": "The id if the item that was not found."
665
+ },
666
+ "name": {
667
+ "type": "string",
668
+ "description": "The name for the error."
669
+ },
670
+ "message": {
671
+ "type": "string",
672
+ "description": "The message for the error."
673
+ },
674
+ "source": {
675
+ "type": "string",
676
+ "description": "The source of the error."
677
+ },
678
+ "properties": {
679
+ "type": "object",
680
+ "additionalProperties": {},
681
+ "description": "Any additional information for the error."
682
+ },
683
+ "stack": {
684
+ "type": "string",
685
+ "description": "The stack trace for the error."
686
+ },
687
+ "inner": {
688
+ "$ref": "#/components/schemas/Error"
689
+ }
690
+ },
691
+ "required": [
692
+ "message",
693
+ "name"
694
+ ],
695
+ "description": "The body which contains the error."
696
+ }
697
+ },
698
+ "securitySchemes": {
699
+ "jwtBearerAuthScheme": {
700
+ "type": "http",
701
+ "scheme": "bearer",
702
+ "bearerFormat": "JWT"
703
+ }
704
+ }
705
+ }
706
+ }