forked from w3c-ccg/vc-issuer-http-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.yml
273 lines (273 loc) · 12.2 KB
/
api.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
openapi: 3.0.0
# Added by API Auto Mocking Plugin
servers:
- description: SwaggerHub API Auto Mocking
url: https://virtserver.swaggerhub.com/danubetech/credential-issuer/0.0.1
info:
description: This is an open API specification for issuing digital credentials based on standards such as the Verifiable Credentials Data Model (https://www.w3.org/TR/vc-data-model/), JWT (https://tools.ietf.org/html/rfc7519), and Open Badges (https://openbadges.org/). Implementations of this API may differ in terms of which data formats or proof formats they do or do not support. Also, implementations may choose to not support certain parts of this API (e.g. optional parts include changing and retrieving the status of a credential, or refreshing a credential).
version: "0.0.1"
title: Credential Issuer API
contact:
email: [email protected]
license:
name: All documents in this Repository are licensed by contributors under the [W3C Software and Document License](http://www.w3.org/Consortium/Legal/copyright-software).
tags:
- name: internal
description: Internal APIs facing the Issuer.
- name: public
description: Public APIs facing the Holder and Verifier.
paths:
/credential:
post:
tags:
- internal
summary: Issues a credential and returns it in the response body.
operationId: issueCredential
description: Issues a credential and returns it in the response body. Support of this part of the API is REQUIRED for implementations.
parameters:
- in: query
required: false
name: templateReference
schema:
type: string
description: Optional internal reference to a credential template. If this is present, it may be used to automatically pre-populate certain fields in the request body.
example: 67466513-67a0-4812-8f26-995dd78c5aa6
- in: query
required: false
name: subjectReference
schema:
type: string
description: Optional internal reference to the subject for which to issue a credential. If this is present, it may be used to pre-populate certain fields in the request body (e.g. "claims" and/or "subject").
example: 73b32334-81f3-4f4c-911e-710c7aadd4d8
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/IssueRequest'
description: Parameters for issuing the credential.
responses:
'201':
description: credential successfully issued!
content:
application/json:
schema:
type: object
description: The issued credential. This SHOULD include a reference or ID that can be used later for other parts of the API, e.g. changing and retrieving the status of the credential, or refreshing the credential.
'400':
description: invalid input!
'500':
description: error!
/credential/{credentialReference}:
get:
tags:
- internal
summary: Retrieves a credential that has already been issued, and returns it in the response body.
operationId: retrieveCredential
description: Retrieves a credential that has already been issued, and returns it in the response body. The retrieved credential MUST be identical to the original credential when it was first issued. This can not be used for refreshing an expired credential. Support of this part of the API is OPTIONAL for implementations.
parameters:
- in: path
required: true
name: credentialReference
schema:
type: string
description: Reference to a credential that has been issued.
responses:
'200':
description: credential successfully retrieved!
content:
application/json:
schema:
type: object
description: The retrieved credential.
'400':
description: invalid input!
'404':
description: credential not found!
'500':
description: error!
'501':
description: not supported by this implementation!
/credential/{credentialReference}/status:
post:
tags:
- internal
summary: Changes the credential status.
operationId: changeCredentialStatus
description: Changes the credential status. Support of this part of the API is OPTIONAL for implementations.
parameters:
- in: path
required: true
name: credentialReference
schema:
type: string
description: Reference to a credential that has been issued.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ChangeStatusRequest'
description: Parameters for changing the credential status.
responses:
'200':
description: credential status successfully changed!
'400':
description: invalid input!
'404':
description: credential not found!
'500':
description: error!
'501':
description: not supported by this implementation!
get:
tags:
- public
summary: Retrieves the credential status and returns it in the response body.
operationId: retrieveCredentialStatus
description: Retrieves the credential status and returns it in the response body. Support of this part of the API is OPTIONAL for implementations. WARNING - this type of "phone home" functionality is problematic from a privacy perspective, therefore this is likely to be removed in a future version.
parameters:
- in: path
required: true
name: credentialReference
schema:
type: string
description: Reference to a credential that has been issued.
responses:
'200':
description: credential status successfully retrieved!
content:
application/json:
schema:
type: object
description: The credential status.
'400':
description: invalid input!
'404':
description: credential not found!
'500':
description: error!
'501':
description: not supported by this implementation!
/credential/{credentialReference}/refresh:
post:
tags:
- public
summary: Refreshes a credential and returns it in the response body.
operationId: refreshCredential
description: Refreshes a credential and returns it in the response body. Support of this part of the API is OPTIONAL for all implementations. WARNING - it may not make sense to model this functionality as a public API, instead the processes for "refreshing" may be more complex and use case specific, therefore this is likely to be removed in a future version.
parameters:
- in: path
required: true
name: credentialReference
schema:
type: string
description: Reference to a credential that has been issued.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RefreshRequest'
description: Parameters for refreshing the credential.
responses:
'200':
description: credential successfully refreshed!
content:
application/json:
schema:
type: object
description: The refreshed credential.
'400':
description: invalid input!
'404':
description: credential not found!
'500':
description: error!
'501':
description: not supported by this implementation!
components:
schemas:
IssueRequest:
type: object
properties:
issuer:
type: string
description: Optional identifier for the issuer of the credential. If this is missing, it may be pre-configured or implied by other values in the request.
example: did:example:76e12ec712ebc6f1c221ebfeb1f
subject:
type: string
description: Optional identifier for the subject of the credential. If this is missing, it may be pre-configured or implied by other values in the request, or there may not be an identifier for the subject of the credential.
example: did:example:ebfeb1f712ebc6f1c276e12ec21
types:
type: array
items:
type: string
description: Optional value for the type(s) of a credential. If this is missing, it may be pre-configured or implied by other values in the request.
example: UniversityDegreeCredential
issuanceDate:
type: string
format: date-time
description: Optional value for the issuance date and time of the credential, to be used only when this value should not be automatically set to the current date and time.
example: '2010-01-01T19:23:24Z'
expirationDate:
type: string
format: date-time
description: Optional value for the expiration date and time of the credential. If this is missing, it may be pre-configured or implied by other values in the request, or the credential may not have an expiration date and time.
example: '2011-01-01T19:23:24Z'
claims:
type: object
additionalProperties: true
description: Optional object containing claims and their values.
example: {"name": "Jayden Doe"}
evidence:
type: object
additionalProperties: true
description: Optional object containing evidence of the credential.
example: {}
termsOfUse:
type: object
additionalProperties: true
description: Optional object containing terms of use of the credential.
example: {}
credentialFormat:
type: string
description: Optional value to specify the credential format. Well-known values are "jsonld", "jwt", "blockcerts". Other values MAY be supported. If this is missing, it may be pre-configured, and a default credential format will be used.
example: jsonld
proofFormat:
type: string
description: Optional value to specify the proof format. Well-known values are "ld-proof", "jws", "blockcerts". Other values MAY be supported. If this is missing, it may be pre-configured or implied by other values in the request (e.g. "credentialFormat"), and a default proof format will be used.
example: jws
credentialFormatOptions:
type: object
additionalProperties: true
description: Optional object containing additional options specific to the chosen credential format. E.g. for the "jsonld" credential format, this could contain JSON-LD context(s) to be included in the credential.
example: {"@context": "https://www.w3.org/2018/credentials/examples/v1"}
proofFormatOptions:
type: object
additionalProperties: true
description: Optional object containing additional options specific to the chosen proof format. E.g. for the "jws" proof format, this could specify a key identifier to be used for the proof.
example: {"kid": "did:example:abfe13f712120431c276e12ecab#keys-1"}
ChangeStatusRequest:
type: object
required:
- status
properties:
status:
type: string
description: New status of the credential. Well-known values are "revoked", "suspended", "active". Other values MAY be supported.
example: revoked
reason:
type: string
description: Optional reason statement for the new status of the credential.
example: Disciplinary action
options:
type: object
additionalProperties: true
description: Optional object containing additional options for the new status of the credential.
example: {}
RefreshRequest:
type: object
properties:
options:
type: object
additionalProperties: true
description: Optional object containing additional options for refreshing the credential.
example: {}