-
Notifications
You must be signed in to change notification settings - Fork 47
/
exchanges.yml
444 lines (444 loc) · 16.6 KB
/
exchanges.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
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 Exchanges and Workflows 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:
/workflows:
post:
summary: Creates a new workflow and returns its information in the response body.
tags:
- Credentials
security:
- networkAuth: []
- oAuth2: []
- zCap: []
operationId: createWorkflow
description: Creates a new workflow and returns workflowId in the response body.
x-expectedCaller: Administrators
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateWorkflowRequest"
responses:
"200":
description: Workflow successfully created!
content:
application/json:
schema:
$ref: "#/components/schemas/CreateWorkflowResponse"
"400":
description: Invalid input
"401":
description: Not Authorized
"500":
description: Internal Error
/workflows/{localWorkflowId}:
get:
summary: Gets the configuration of an existing workflow and returns it in the response body.
tags:
- Credentials
security:
- networkAuth: []
- oAuth2: []
- zCap: []
operationId: getWorkflowConfiguration
description: Gets the configuration of an existing workflow and returns it in the response body.
x-expectedCaller: Administrators
parameters:
- $ref: "./components/parameters/path/LocalWorkflowId.yml"
responses:
"200":
description: Workflow configuration retrieved!
content:
application/json:
schema:
$ref: "#/components/schemas/GetWorkflowResponse"
"400":
description: Invalid input
"401":
description: Not Authorized
"500":
description: Internal Error
/workflows/{localWorkflowId}/exchanges:
post:
summary: Creates a new exchange and returns exchangeId and time to live in the response body.
tags:
- Credentials
security:
- networkAuth: []
- oAuth2: []
- zCap: []
operationId: createExchange
description: Creates a new exchange and returns exchangeId and time to live in the response body.
x-expectedCaller: Owner Coordinator
parameters:
- $ref: "./components/parameters/path/LocalWorkflowId.yml"
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateExchangeRequest"
responses:
"200":
description: Exchange successfully created!
content:
application/json:
schema:
$ref: "#/components/schemas/CreateExchangeResponse"
"400":
description: Invalid input
"401":
description: Not Authorized
"500":
description: Internal Error
/workflows/{localWorkflowId}/exchanges/{localExchangeId}:
get:
summary: Gets the state of an existing exchange and returns it in the response body.
tags:
- Credentials
security:
- networkAuth: []
- oAuth2: []
- zCap: []
operationId: getExchangeConfiguration
description: Gets the configuration of an existing exchange and returns it in the response body.
x-expectedCaller: Owner Coordinator
parameters:
- $ref: "./components/parameters/path/LocalWorkflowId.yml"
- $ref: "./components/parameters/path/LocalExchangeId.yml"
responses:
"200":
description: Exchange configuration retrieved!
content:
application/json:
schema:
$ref: "#/components/schemas/GetExchangeResponse"
"400":
description: Invalid input
"401":
description: Not Authorized
"500":
description: Internal Error
post:
summary: Participate in an exchange. Posting an empty body will start the exchange or return
what the exchange is expecting to complete the next step. Posting a Verifiable Presentation Request
will result in either a 4xx error or one of the following - a Verifiable Presentation
or Verifiable Presentation Request that conforms to the client's request. If a Verifiable Presentation
is sent, an additional Verifiable Presentation Request may also be sent to continue the exchange.
tags:
- Credentials
security:
- networkAuth: []
- oAuth2: []
- zCap: []
operationId: participateInExchange
description: Participate in an exchange. Posting an empty body will start the exchange or return what the exchange is expecting to complete the next step.
x-expectedCaller: Anyone
parameters:
- $ref: "./components/parameters/path/LocalWorkflowId.yml"
- $ref: "./components/parameters/path/LocalExchangeId.yml"
requestBody:
content:
application/json:
schema:
oneOf:
- type: object
properties:
verifiablePresentationRequest:
$ref: "./components/VerifiablePresentationRequest.yml#/components/schemas/VerifiablePresentationRequest"
- type: object
properties:
verifiablePresentation:
$ref: "./components/VerifiablePresentation.yml#/components/schemas/VerifiablePresentation"
responses:
"200":
description: Exchange progressed.
content:
application/json:
schema:
$ref: "#/components/schemas/ExchangeParticipationResponse"
"400":
description: Invalid input
"401":
description: Not Authorized
"500":
description: Internal Error
components:
securitySchemes:
$ref: "./components/SecuritySchemes.yml#/components/securitySchemes"
schemas:
CreateWorkflowRequest:
type: object
additionalProperties: false
description: Object containing information for creating a workflow.
properties:
config:
type: object
additionalProperties: false
description: Object containing information for creating a workflow.
properties:
steps:
type: object
description: One or more steps required to complete an exchange on the workflow. Passing the steps object is REQUIRED.
properties:
stepName:
type: object
description: The name of the step.
properties:
step:
$ref: "#/components/schemas/WorkflowStep"
initialStep:
type: string
description: The step from the above set that the exchange starts on. Passing intialStep is REQUIRED.
controller:
type: string
description: The controller of the instance. Passing controller is OPTIONAL.
authorization:
type: string
description: Authorization scheme information (e.g., OAuth2 configuration). Passing authorization is OPTIONAL.
credentialTemplates:
type: array
description: One or more VC templates for issuance. Passing credentialTemplates is OPTIONAL.
items:
type: object
properties:
type:
type: string
template:
type: string
id:
type: string
description: The ID that will be used for the created workflow. Passing an ID is OPTIONAL.
CreateWorkflowResponse:
type: object
additionalProperties: false
description: Response containing the created workflow config Object.
properties:
config:
type: object
additionalProperties: false
description: Object containing information about a created workflow.
properties:
id:
type: string
description: The URL that uniquely identifies the created workflow.
steps:
type: object
description: One or more steps required to complete an exchange on the workflow.
properties:
stepName:
type: object
description: The name of the step.
properties:
step:
$ref: "#/components/schemas/WorkflowStep"
initialStep:
type: string
description: The step from the above set that the exchange starts on.
controller:
type: string
description: The controller of the instance. Returning controller is OPTIONAL.
authorization:
type: object
description: Authorization scheme information (e.g., OAuth2 configuration). Returning authorization is OPTIONAL.
credentialTemplates:
type: array
description: One or more VC templates for issuance. Returning credentialTemplates is OPTIONAL.
items:
type: object
properties:
type:
type: string
description: The type of template.
template:
type: string
description: The template itself.
GetWorkflowResponse:
type: object
additionalProperties: false
description: Object containing information about a workflow.
properties:
config:
type: object
additionalProperties: false
description: Object containing information about a created workflow.
properties:
exchanges:
type: array
description: The identifiers of the current exchanges associated with the workflow instance.
items:
type: string
steps:
type: object
description: One or more steps required to complete an exchange on the workflow.
properties:
stepName:
type: object
description: The name of the step.
properties:
step:
$ref: "#/components/schemas/WorkflowStep"
initialStep:
type: string
description: The step from the above set that the exchange starts on.
controller:
type: string
description: The controller of the instance. Returning controller is OPTIONAL.
authorization:
type: object
description: Authorization scheme information (e.g., OAuth2 configuration). Returning authorization is OPTIONAL.
credentialTemplates:
type: array
description: One or more VC templates for issuance. Returning credentialTemplates is OPTIONAL.
items:
type: object
properties:
type:
type: string
description: The type of template.
template:
type: string
description: The template itself.
CreateExchangeRequest:
type: object
description: Object containing information about the exchange to be created.
properties:
exchangeInformation:
type: object
properties:
ttl:
type: string
description: Time to live for the exchange (ms).
variables:
type: array
description: Template variables to be used in the exchange.
items:
type: object
properties:
type:
type: string
description: The type of template.
template:
type: string
description: The template itself.
CreateExchangeResponse:
type: object
additionalProperties: false
description: Object containing information about a created exchange.
properties:
exchangeId:
type: string
description: The URL that uniquely identifies the exchange.
sequence:
type: string
description: A sequence number for the exchange. Set to "0" on creation.
ttl:
type: string
description: The time to live for the created exchange.
variables:
type: array
description: Template variables to be used in the exchange.
items:
type: object
properties:
type:
type: string
description: The type of template.
template:
type: string
description: The template itself.
state:
type: string
description: The status ("pending" | "complete" | "invalid") of the exchange, set to "pending" on creation.
step:
type: string
description: The semantic string ID for the current step.
ExchangeParticipationResponse:
type: object
description: Either what the exchange is expecting next or a result of the exchange.
oneOf:
- type: object
properties:
verifiablePresentationRequest:
$ref: "./components/VerifiablePresentationRequest.yml#/components/schemas/VerifiablePresentationRequest"
- type: object
properties:
verifiablePresentation:
$ref: "./components/VerifiablePresentation.yml#/components/schemas/VerifiablePresentation"
- type: object
properties:
redirectUrl:
type: string
description: The URL the exchange wishes to redirect the client to.
GetExchangeResponse:
type: object
additionalProperties: false
description: Object containing information about an active exchange.
properties:
exchangeId:
type: string
description: The URL that uniquely identifies the exchange.
ttl:
type: string
description: The time to live for the exchange.
nextStep:
type: string
description: The interaction the exchange is expecting to happen next.
completedSteps:
type: array
description: The steps completed by the exchange previously.
items:
type: string
WorkflowStep:
type: object
description: Object containing information about a workflow step.
oneOf:
- $ref: "#/components/schemas/StepData"
- type: object
properties:
stepTemplate:
$ref: "#/components/schemas/StepTemplate"
StepTemplate:
type: object
additionalProperties: false
description: A template for a workflow step. Either this must be present or the other step data must be present, but not both sets.
properties:
type:
type: string
description: The type of template.
template:
type: string
description: The step template.
StepData:
type: object
additionalProperties: false
description: Step data to be included if a template is not used.
properties:
createChallenge:
type: string
description: An optional step directive that tells the exchange to handle challenge management via a VC API verifier service it has a zcap for.
verifiablePresentationRequest:
$ref: "./components/VerifiablePresentationRequest.yml#/components/schemas/VerifiablePresentationRequest"
nextStep:
type: string
description: The name of the next step in the sequence.
openId:
type: object
description: Optional information to trigger OID4VP
properties:
createAuthorizationRequest:
type: string
description: If present, auto-generate the OID4VP authorization request from the VPR. Either this or authorizationRequest must be present, but not both.
authorizationRequest:
type: object