-
Notifications
You must be signed in to change notification settings - Fork 47
/
holder.yml
523 lines (513 loc) · 18 KB
/
holder.yml
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
openapi: 3.0.0
servers:
- url: https://verifier.qa.veres.app/verifiers/z1A45ZhWEGMeibHrB15nv8Gk6
description: Veres Verifier (Quality Assurance)
info:
version: "0.0.3-unstable"
title: VC Holder API
description: This is an Experimental Open API Specification for the [VC Data Model](https://www.w3.org/TR/vc-data-model/).
license:
name: W3C Software and Document License
url: http://www.w3.org/Consortium/Legal/copyright-software.
contact:
name: GitHub Source Code
url: https://github.com/w3c-ccg/vc-api
paths:
/credentials/{id}:
get:
tags:
- Credentials
security:
- networkAuth: []
- oAuth2: []
- zCap: []
summary: Gets a credential or verifiable credential by ID. To get a credential that does not have credential.id set but has an associated credentialId value, pass credentialId instead.
x-expectedCaller: "Issuer Coordinator"
operationId: getCredential
parameters:
- $ref: "./components/parameters/path/ObjectId.yml"
responses:
"200":
description: Credential retrieved
content:
application/json:
schema:
oneOf:
- $ref: "./components/Credential.yml#/components/schemas/Credential"
- $ref: "./components/VerifiableCredential.yml#/components/schemas/VerifiableCredential"
"400":
description: Bad Request
"401":
description: Not Authorized
"404":
description: Credential not found
"410":
description: Gone! There is no data here
"418":
description: I'm a teapot - MUST not be returned outside of pre-arranged scenarios between both parties
delete:
tags:
- Credentials
security:
- networkAuth: []
- oAuth2: []
- zCap: []
summary: Deletes a credential or verifiable credential by ID. To delete a credential that does not have credential.id set but has an associated credentialId value, pass credentialId instead.
x-expectedCaller: "Issuer Coordinator"
operationId: deleteCredential
parameters:
- $ref: "./components/parameters/path/ObjectId.yml"
responses:
"202":
description: Credential deleted - this is a 202 by default as soft deletes and processing time are assumed
"400":
description: Bad Request
"401":
description: Not Authorized
"404":
description: Credential not found
"410":
description: Gone! There is no data here
/credentials:
get:
tags:
- Credentials
security:
- networkAuth: []
- oAuth2: []
- zCap: []
summary: Gets list of credentials or verifiable credentials
operationId: getCredentials
x-expectedCaller: "Holder Coordinator or Issuer Coordinator"
parameters:
- in: query
name: type
schema:
type: array
items:
type: string
pattern: "(credentials|verifiablecredentials|all)"
responses:
"200":
description: Credentials retrieved
content:
application/json:
schema:
type: array
description: The Credentials
items:
anyOf:
- $ref: "./components/VerifiableCredential.yml#/components/schemas/VerifiableCredential"
- $ref: "./components/Credential.yml#/components/schemas/Credential"
"400":
description: Bad Request
"401":
description: Not Authorized
"410":
description: Gone! There is no data here
/credentials/derive:
post:
tags:
- Credentials
security:
- networkAuth: []
- oAuth2: []
- zCap: []
summary: Derives a credential and returns it in the response body.
operationId: deriveCredential
description: Derives a credential and returns it in the response body.
x-expectedCaller: "Holder Coordinator"
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/DeriveCredentialRequest"
description: Parameters for deriving the credential.
responses:
"201":
description: Credential derived successfully.
content:
application/json:
schema:
$ref: "#/components/schemas/DeriveCredentialResponse"
"400":
description: Invalid Request
/presentations/{id}:
get:
tags:
- Presentations
summary: Gets a presentation or verifiable presentation by ID
security:
- networkAuth: []
- oAuth2: []
- zCap: []
operationId: getPresentation
x-expectedCaller: "Holder Coordinator"
parameters:
- $ref: "./components/parameters/path/ObjectId.yml"
responses:
"200":
description: Credential retrieved
content:
application/json:
schema:
oneOf:
- $ref: "./components/Presentation.yml#/components/schemas/Presentation"
- $ref: "./components/VerifiablePresentation.yml#/components/schemas/VerifiablePresentation"
"400":
description: Bad Request
"401":
description: Not Authorized
"404":
description: Presentation not found
"410":
description: Gone! There is no data here
delete:
tags:
- Presentations
summary: Deletes a presentation or verifiable presentation by ID
security:
- networkAuth: []
- oAuth2: []
- zCap: []
operationId: deletePresentation
x-expectedCaller: "Holder Coordinator"
parameters:
- $ref: "./components/parameters/path/ObjectId.yml"
responses:
"202":
description: Presentation deleted - this is a 202 by default as soft deletes and processing time are assumed
"400":
description: Bad Request
"401":
description: Not Authorized
"404":
description: Presentation not found
"410":
description: Gone! There is no data here
/presentations:
get:
tags:
- Presentations
summary: Gets list of presentations or verifiable presentations
security:
- networkAuth: []
- oAuth2: []
- zCap: []
operationId: getPresentations
x-expectedCaller: "Holder Coordinator"
parameters:
- in: query
name: type
schema:
type: array
items:
type: string
pattern: "(presentations|verifiablepresentations|all)"
responses:
"200":
description: Presentations retrieved
content:
application/json:
schema:
type: array
description: The Presentations
items:
anyOf:
- $ref: "./components/Presentation.yml#/components/schemas/Presentation"
- $ref: "./components/VerifiablePresentation.yml#/components/schemas/VerifiablePresentation"
"400":
description: Bad Request
"401":
description: Not Authorized
"410":
description: Gone! There is no data here
post:
summary: Creates a presentation and returns it in the response body.
tags:
- Presentations
security:
- networkAuth: []
- oAuth2: []
- zCap: []
operationId: createPresentation
x-expectedCaller: "Holder Coordinator"
description: Creates a presentation and returns it in the response body.
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreatePresentationRequest"
description: Parameters for creating the presentation.
responses:
"201":
description: Presentation successfully created!
content:
application/json:
schema:
$ref: "#/components/schemas/CreatePresentationResponse"
"400":
description: invalid input!
/exchanges:
get:
summary: Provides a discovery endpoint for the exchanges supported by this server endpoint.
tags:
- Exchanges
security:
- networkAuth: []
- oAuth2: []
- zCap: []
operationId: discoverExchanges
description:
This endpoint returns an array of the exchange-ids (path endpoints) supported by this server,
and the associated protocol supported by each exchange endpoint. The list supports pagination.
Clients consuming this list and wishing to use an exchange endpoint MUST recognize and support
the protocol identified in the value field. Clients are not expected to dynamically process
the protocol specified.
parameters:
- name: index
in: query
description:
The starting index for the list that is meaningful to the server.
If omitted, the server must assume the start of the list.
required: false
schema:
type: string
- name: limit
in: query
description:
The maximum number of items to return in the response. If omitted, the service should
return all remaining items from the start index.
required: false
schema:
type: number
responses:
"200":
description: A map of the exchange-id endpoints to protocols those exchanges support.
content:
application/json:
schema:
required:
- count
- index
- total
- exchanges
properties:
count:
type: number
description: The number of elements returned in the array.
total:
type: number
description: The total number of elements available.
exchanges:
type: array
items:
type: object
properties:
id:
type: string
description: the path name of the exchange endpoint. May be a UUID.
type:
type: string
description: MUST be a string that references the protocol supported on that endpoint.
index:
type: object
properties:
self:
type: string
description:
The index position of the start of the returned list. Examples could be a numerical value,
a URL, or a value meaningful to the server.
next:
type: string
description:
The index position for the next set of results (i.e., index of the end of this list).
Examples could be a numerical value, a URL, or a value meaningful to the server.
example:
{
"count": 3,
"total": 8,
"exchanges" : [
{
"id" : "credential-refresh",
"type": "CredentialRefresh2020"
},
{
"id": "34901-18388409-1939",
"type" : "PresentationExchange1.0",
},
{
"id" : "salad",
"type" : "https://example.com/oas/my-salad.yml"
}],
"index": {
"self": "0",
"next" : "3"
}
}
"400":
description: invalid input
/exchanges/{exchange-id}:
post:
summary: Initiates an exchange of information.
tags:
- Exchanges
security:
- networkAuth: []
- oAuth2: []
- zCap: []
operationId: initiateExchange
description:
A client can use this endpoint to initiate an exchange of a particular
type. The client can include HTTP POST information related to the
details of exchange it would like to initiate. If the server understands
the request, it returns a Verifiable Presentation Request. A request
that the server cannot understand results in an error.
parameters:
- $ref: "./components/parameters/path/ExchangeId.yml"
requestBody:
description:
Information related to the type of exchange the client would like
to start.
content:
application/json:
schema:
anyOf:
-
{
"type": "object",
"description": "Data necessary to initiate the exchange."
}
-
$ref: "#/components/schemas/NotifyPresentationAvailableRequest"
responses:
"200":
description: Proceed with exchange.
content:
application/json:
schema:
$ref: "#/components/schemas/VerifiablePresentationRequestBody"
"400":
description: Request is malformed.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/exchanges/{exchange-id}/{transaction-id}:
post:
summary: Receives information related to an existing exchange.
tags:
- Exchanges
security:
- networkAuth: []
- oAuth2: []
- zCap: []
- didAuth: []
operationId: receiveExchangeData
description:
A client can use this endpoint to continue the exchange of information
associated with an initiated exchange by sending a Verifiable Presentation
with information requested by the server to this endpoint.
parameters:
- $ref: "./components/parameters/path/ExchangeId.yml"
- $ref: "./components/parameters/path/TransactionId.yml"
requestBody:
description:
A Verifiable Presentation.
content:
application/json:
schema:
$ref: "#/components/schemas/VerifiablePresentationBody"
responses:
"200":
description: Received data was accepted.
content:
application/json:
schema:
anyOf:
- $ref: "#/components/schemas/VerifiablePresentationBody"
- $ref: "#/components/schemas/VerifiablePresentationRequestBody"
"400":
description: Received data is malformed.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"404":
description: The associated exchange or transaction was not found.
components:
securitySchemes:
$ref: "./components/SecuritySchemes.yml#/components/securitySchemes"
schemas:
DeriveCredentialRequest:
type: object
properties:
verifiableCredential:
$ref: "./components/VerifiableCredential.yml#/components/schemas/VerifiableCredential"
options:
$ref: "./components/DeriveCredentialOptions.yml#/components/schemas/DeriveCredentialOptions"
DeriveCredentialResponse:
$ref: "./components/VerifiableCredential.yml#/components/schemas/VerifiableCredential"
CreatePresentationRequest:
type: object
properties:
presentation:
$ref: "./components/Presentation.yml#/components/schemas/Presentation"
options:
$ref: "./components/PresentCredentialOptions.yml#/components/schemas/PresentCredentialOptions"
CreatePresentationResponse:
type: object
properties:
verifiablePresentation:
type: object
description: A JSON-LD Verifiable Presentation with a proof.
oneOf:
- $ref: "./components/VerifiablePresentation.yml#/components/schemas/VerifiablePresentation"
- $ref: "./components/EnvelopedVerifiablePresentation.yml#/components/schemas/EnvelopedVerifiablePresentation"
NotifyPresentationAvailableRequest:
type: object
properties:
query:
type: object
description: See https://w3c-ccg.github.io/vp-request-spec/#format
properties:
type:
type: string
description: "The type of query the server should reply with."
credentialQuery:
type: object
description: "Details of the client's available presentation"
example:
{
"query":
[
{
"type": "RequestQueryByFrame",
"credentialQuery":
[
{
"type":
[
"VerifiableCredential",
"CommercialInvoiceCertificate",
],
"reason": "Wallet XYZ is ready to selectively disclose new credentials.",
},
],
},
],
}
ErrorResponse:
$ref: "./components/ErrorResponse.yml#/components/schemas/ErrorResponse"
StorePresentationRequest:
$ref: "./components/VerifiablePresentation.yml#/components/schemas/VerifiablePresentation"
VerifiablePresentationRequestBody:
type: object
properties:
verifiablePresentationRequest:
$ref: "./components/VerifiablePresentationRequest.yml#/components/schemas/VerifiablePresentationRequest"
VerifiablePresentationBody:
type: object
properties:
verifiablePresentation:
$ref: "./components/VerifiablePresentation.yml#/components/schemas/VerifiablePresentation"