-
Notifications
You must be signed in to change notification settings - Fork 15
/
schemas.yaml
779 lines (744 loc) · 23.3 KB
/
schemas.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
---
components:
schemas:
# Common
InternalServerError:
required:
- msg
type: object
properties:
msg:
type: string
NotFound:
required:
- msg
type: object
properties:
msg:
type: string
BadRequest:
required:
- msg
type: object
properties:
msg:
type: string
errors:
type: array
items:
type: string
# Schema Registry
Proof:
required:
- type
- created
- verificationMethod
- proofPurpose
- proofValue
type: object
properties:
type:
type: string
created:
type: string
format: date-time
verificationMethod:
type: string
proofPurpose:
type: string
proofValue:
type: string
domain:
type: string
VerifiableCredentialSchema:
required:
- id
- name
- version
- author
- authored
type: object
properties:
id:
type: string
format: uuid
name:
type: string
version:
type: string
tags:
type: array
items:
type: string
description:
type: string
attributes:
type: array
items:
type: string
author:
type: string
authored:
type: string
format: date-time
proof:
$ref: "#/components/schemas/Proof"
VerifiableCredentialSchemaPage:
required:
- self
- kind
- pageOf
type: object
properties:
self:
type: string
kind:
type: string
pageOf:
type: string
next:
type: string
previous:
type: string
contents:
type: array
items:
$ref: "#/components/schemas/VerifiableCredentialSchema"
VerificationPolicyConstraint:
required:
- schemaId
type: object
properties:
schemaId:
type: string
trustedIssuers:
type: array
items:
type: string
VerificationCredentialSchemaInput:
required:
- name
- version
type: object
properties:
id:
type: string
format: uuid
name:
type: string
version:
type: string
description:
type: string
attributes:
type: array
items:
type: string
authored:
type: string
format: date-time
tags:
type: array
items:
type: string
VerificationPolicy:
required:
- self
- kind
- id
- nonce
- name
- description
- createdAt
- updatedAt
type: object
properties:
self:
type: string
kind:
type: string
id:
type: string
format: uuid
nonce:
type: integer
format: int32
name:
type: string
description:
type: string
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
constraints:
type: array
items:
$ref: "#/components/schemas/VerificationPolicyConstraint"
VerificationPolicyInput:
required:
- name
- description
type: object
properties:
id:
type: string
format: uuid
name:
type: string
description:
type: string
constraints:
type: array
items:
$ref: "#/components/schemas/VerificationPolicyConstraint"
VerificationPolicyPage:
required:
- self
- kind
- pageOf
type: object
properties:
self:
type: string
kind:
type: string
pageOf:
type: string
next:
type: string
previous:
type: string
contents:
type: array
items:
$ref: "#/components/schemas/VerificationPolicy"
# Issue Credential Protocol
IssueCredentialRecordBase:
required:
- subjectId
- claims
properties:
schemaId:
type: string
description: Identifier of the VC Schema associated with this object
subjectId:
type: string
description: Subject DID of the verifiable credentials object
example: did:prism:subjectofverifiablecredentials
validityPeriod:
type: number
description: The validity period in seconds of the verifiable credential
example: 3600
claims:
type: object
description: Claims that will be associated with given verifiable credentials
additionalProperties:
type: string
automaticIssuance:
type: boolean
default: true
awaitConfirmation:
type: boolean
default: true
CreateIssueCredentialRecordRequest:
description: A request to create a new "issue credential record"
type: object
allOf:
- $ref: "#/components/schemas/IssueCredentialRecordBase"
- type: object
required:
- issuingDID
- connectionId
properties:
issuingDID:
type: string
description: Issuer DID of the verifiable credentials object
example: did:prism:issuerofverifiablecredentials
connectionId:
type: string
description: A connection ID between issuer and holder.
IssueCredentialRecord:
description: An issue credential record to store the state of the protocol execution
type: object
allOf:
- $ref: "#/components/schemas/IssueCredentialRecordBase"
- type: object
required:
- recordId
- createdAt
- role
- protocolState
properties:
recordId:
type: string
format: uuid
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
role:
type: string
enum:
- Issuer
- Holder
protocolState:
type: string
enum:
- OfferPending
- OfferSent
- OfferReceived
- RequestPending
- RequestSent
- RequestReceived
- ProblemReportPending
- ProblemReportSent
- ProblemReportReceived
- CredentialPending
- CredentialSent
- CredentialReceived
publicationState:
type: string
enum:
- PublicationPending
- PublicationQueued
- Published
jwtCredential:
type: string
issuingDID:
type: string
description: Issuer DID of the verifiable credentials object
example: did:prism:issuerofverifiablecredentials
IssueCredentialRecordCollection:
description: A collection of issue credential records
required:
- items
- offset
- limit
- count
properties:
items:
type: array
items:
$ref: "#/components/schemas/IssueCredentialRecord"
offset:
type: integer
limit:
type: integer
count:
type: integer
#
W3CCredentialInput:
description: |-
Credential input object based on which the new instance of the verifiable credentials is created.
Object contains the minimal set of the fields required to create the credentials for the given subject.
All other required fields of the verifiable credential depend on the context of the cloud agent
required:
- subjectId
- claims
properties:
schemaId:
type: string
description: "Identity of the Verifiable Credentials Schema associated with this object"
example: "did:example:MDP8AsFhHzhwUvGNuYkX7T;id=06e126d1-fa44-4882-a243-1e326fbe21db;version=1.0"
subjectId:
type: string
description: "Subject DID of the verifiable credentials object"
example: "did:prism:subjectofverifiablecredentials"
validityPeriod:
type: number
description: "The validity period in seconds of the verifiable credential"
example: 3600
claims:
type: object
additionalProperties:
type: string
description: "Clams associated with given credentials object (for now it's just a key/value, later should be more complex"
W3CCredential:
description: "Verifiable Credential Object according to W3C specification"
required: ["id", "type", "issuer", "issuanceDate", "credentialSubject"]
properties:
id:
type: string
description: "Credential id or url that can be used to get the status of revoke the credential"
example: "http://example.edu/credentials/1872"
type:
type: string
description: "Credential type according to W3C specification. Must include VerifiableCredentials and type of concrete credentials"
example: '["VerifiableCredential", "AlumniCredential"]'
issuer:
type: string
description: "Issuer DID"
example: "did:prism:issuerdid"
issuanceDate:
type: string
description: "Datetime in ISO format that corresponds to the date of issuance"
example: "2010-01-01T19:23:24Z"
credentialSubject:
type: object
description: "Credentials subject DID and claims according to the schema object"
additionalProperties:
type: string
example:
id: "did:prism:subject12345"
alumni_of: "University"
degree: "master of openapi specification"
proof:
$ref: "#/components/schemas/W3CProof"
W3CCredentialsPaginated:
description: "Paginated response that contains an array of the credential objects"
properties:
data:
type: array
items:
$ref: "#/components/schemas/W3CCredential"
offset:
type: integer
limit:
type: integer
count:
type: integer
W3CIssuanceBatch:
description: "An issuance batch object that is associated with thelist of verifiable credentials"
properties:
id:
type: string
description: "Issuance batch id"
count:
type: integer
description: "Count of the verifiable credentials object in the batch"
actions:
type: array
items:
$ref: "#/components/schemas/W3CIssuanceBatchAction"
W3CIssuanceBatchAction:
description: "Action performed on the list of credentials associated with the issuance batch"
properties:
action:
description: "Action name"
type: string
enum: ["sign", "issue", "send"]
example: "issue"
id:
description: "Action id for tracking"
type: string
example: "uid"
status:
description: "Action status"
type: string
enum: ["scheduled", "pending", "completed", "failed"]
W3CIssuanceBatchPaginated:
description: "Paginated response that contains an array of the issuance-batch objects"
properties:
data:
type: array
items:
$ref: "#/components/schemas/W3CIssuanceBatch"
offset:
type: integer
limit:
type: integer
count:
type: integer
W3CCredentialStatus:
description: Verifiable Credential revocation status
required:
- status
properties:
status:
description: Status name
type: string
enum:
- issued
- revoked
example: "issued"
description:
type: string
description: Description about the status
example: "Issued by did:prism:issuer12354 on 2022-02-01"
W3CCredentialRevocationRequest:
description: Credential revocation request. Contain credential id and other information required for revocation
required:
- credentialId
additionalProperties: false
properties:
credentialId:
type: string
description: Credential identity
example: "abcde-12345"
W3CCredentialRevocationResponse:
description: Credential revocation response. Contain credential id and revocation operation for tracing the completion
required:
- credentialId
- operationId
- status
properties:
credentialId:
type: string
description: Credential identity
example: "abcde-12345"
operation:
$ref: "#/components/schemas/RevocationStatus"
RevocationStatus:
description: Revocation status record
properties:
id:
type: string
description: Operation id
example: "operation1235"
status:
type: string
description: Operation status
enum:
- scheduled
- pending
- completed
- failed
ProofRequestAux:
required: [schemaId, trustIssuers]
properties:
schemaId:
description: Ex ID card or driving licence
type: string
example: "https://schema.org/Person"
trustIssuers:
description: Issuer that the verifier trust trust
example:
[
"did:web:atalaprism.io/users/testUser",
"did.prism:123",
"did:prism:...",
]
type: array
items:
type: string
Options:
required: [challenge, domain]
properties:
challenge:
description: The challenge should be a randomly generated string.
type: string
example: "11c91493-01b3-4c4d-ac36-b336bab5bddf"
domain:
description: The domain value can be any string or URI
example: "https://example-verifier.com"
type: string
RequestPresentationInput:
description: Request Presentation Input
required: [connectionId, proofs]
properties:
connectionId:
type: string
options:
type: object
$ref: "#/components/schemas/Options"
proofs:
type: array
items:
$ref: "#/components/schemas/ProofRequestAux"
RequestPresentationOutput:
description: Request Presentation Output
required: [presentationId]
properties:
presentationId:
description: Ref to the id on the presentation (db ref)
type: string
PresentationStatus:
description: Presentation Status
required: [presentationId, status, proofs, data]
properties:
presentationId:
type: string
status:
type: string
proofs:
type: array
items:
$ref: "#/components/schemas/ProofRequestAux"
data:
type: array
items:
type: string
connectionId:
type: string
RequestPresentationAction:
# RequestPresentationActionAccept:
description: Actions on presetations (to update)
required: [action]
properties:
action:
type: string
enum:
- request-accept
- request-reject
- presentation-accept
- presentation-reject
proofId:
description: This is to choose what VCs to use
type: array
items:
type: string
W3CPresentationPaginated:
description: "Paginated response that contains an array of the presentation objects"
properties:
data:
type: array
items:
$ref: "#/components/schemas/W3CPresentation"
offset:
type: integer
limit:
type: integer
count:
type: integer
JWTCompactSerialisation:
description: "Verifiable Credentials or Presentation encoded as JWT token"
type: string
externalDocs:
url: "https://w3c.github.io/vc-jwt/#example-verifiable-credential-using-jwt-compact-serialization-non-normative"
example:
"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImRpZDpleGF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KXE94fz_QpYfg
--7kLsyBAfQGbg"
JWTHeader:
description: "JWT Header for Verifiable Credentials or Verifiable Presentation"
required:
- alg
- type
- kid
externalDocs:
url: "https://www.rfc-editor.org/rfc/rfc7519"
properties:
alg:
type: string
description: -|
Must be set for digital signatures.
If only the proof property is needed for the chosen signature method, the alg header MUST be set to none
example: RS256
type:
type: string
description: if present, MUST be set to JWT
kid:
type: string # TODO: clarify the better type for DID key id
description: -|
MAY be used if there are multiple keys associated with the issuer of the JWT.
The key discovery is out of the scope of this specification.
For example, the kid can refer to a key in a DID document, or can be the identifier of a key inside a JWKS
JWTCredential:
description: "Verifiable Credential Object according to JWT specification"
externalDocs:
url: "https://w3c.github.io/vc-jwt/"
required: ["exp", "iss", "nbf", "jti", "sub"]
properties:
exp:
type: string
description: MUST represent the expirationDate property, encoded as a UNIX timestamp (NumericDate).
example: "2022-07-12T16:51:22.000Z" # TODO: exp field is required according to the spec, but looks like it's not required in VC data model
iss:
type: string
description: -|
MUST represent the issuer property of a verifiable credential or the holder property of a verifiable presentation.
In JSON or JSON-LD formats it's 'issuer' field
example: "did:prism:issuerdid"
nbf:
type: string
description: -|
MUST represent issuanceDate, encoded as a UNIX timestamp (NumericDate).
Datetime in ISO format that corresponds to the date of issuance
example: "2022-01-01T19:23:24Z"
jti:
type: string
description: -|
MUST represent the id property of the verifiable credential or verifiable presentation.
example: "http://example.edu/credentials/1872"
sub:
type: string
description: MUST represent the id property contained in the credentialSubject.
example: "did:holder:abdce1234"
aud:
type: string
description: MUST represent (i.e., identify) the intended audience of the verifiable presentation (i.e., the verifier intended by the presenting holder to receive and verify the verifiable presentation).
example: "did:verifier:asdfkj"
vc:
type: object
description: Content of Verifiable Credentials object in JSON format. Contains 'type', 'credentialsSubject' and claims
required:
- type
- credentialsSubject
additionalProperties: true
properties:
type:
type: array
items:
type: string
description: "Credential type according to W3C specification. Must include VerifiableCredentials and type of concrete credentials"
example:
- VerifiableCredential
- UniversityDegreeCredential
credentialSubject:
type: object
additionalProperties: true
required: ["id"]
description: "Credentials subject DID and claims according to the schema object"
example:
id: "did:prism:subject12345"
alumni_of: "University"
degree: "master of openapi specification"
properties:
id:
type: string
description: "DID of the subject of the credential"
proof:
$ref: "#/components/schemas/Proof"
ErrorResponse:
type: object
description: An RFC-7807 compliant data structure for reporting errors to the client
required:
- type
- title
- status
- instance
properties:
type:
type: string
description: A URI reference that identifies the problem type.
example: https://example.org/doc/#model-MalformedEmail
title:
type: string
example: "Malformed email"
description: |-
A short, human-readable summary of the problem type. It does not
change from occurrence to occurrence of the problem.
status:
type: integer
format: int32
example: 400
description: |-
The HTTP status code for this occurrence of the problem.
detail:
type: string
description: |-
A human-readable explanation specific to this occurrence of the problem.
example: "The received '{}à!è@!.b}' email does not conform to the email format"
instance:
type: string
example: "/problems/d914e"
description: |-
A URI reference that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced.