-
Notifications
You must be signed in to change notification settings - Fork 10
/
toip.trustregistry.api.yaml
346 lines (345 loc) · 11.9 KB
/
toip.trustregistry.api.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
openapi: 3.0.0
servers:
# Added by API Auto Mocking Plugin
- description: SwaggerHub API Auto Mocking
url: https://virtserver.swaggerhub.com/darrellodonnell/ToIP.TrustRegistry/0.1.0
info:
description: This is a simple Trust Registry
version: "0.1.0"
title: Trust Over IP Trust Registry Protocol (RESTful API)
contact:
email: [email protected]
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
tags:
# - name: admins
# description: Secured Admin-only calls
- name: developers
description: Operations available to regular developers
paths:
# /Governance:
# get:
# tags:
# - developers
# summary: returns link to governance frameworks that this Trust Registry supports
/query/issuer:
get:
tags:
- developers
summary: Queries for Verifier
operationId: validateIssuer
description: |
Allows querying to determine the status of an Issuer, as identified by their Identifier (unique), credential type, and EGF that they are operating under.
parameters:
- in: query
name: identifier
required: true
schema:
$ref: '#/components/schemas/Uri'
description: The URI-based identifier of a DID or X.509 Issuer. Allows reserved characters per RFC3986. Do not escape the URI.
allowReserved: true
- in: query
name: credentialType
required: true
schema:
type: string
- in: query
name: egfURI
required: true
schema:
type: string
format: URI
allowReserved: true # allow reserved characters per RFC3986
description: The URI that points to the Ecosystem Governance Framework. Allows reserved characters per RFC3986. Do not escape the URI.
responses:
'200':
description: search results matching criteria
content:
application/json:
schema:
$ref: '#/components/schemas/IdentifierResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
/query/verifier:
get:
tags:
- developers
summary: Queries for Verifier
operationId: validateVerifier
description: |
Allows querying to determine the status of a Verifier, as identified by their Identifier (unique), credential type, and EGF that they are operating under.
parameters:
- in: query
name: identifier
required: true
schema:
$ref: '#/components/schemas/Uri'
description: The URI-based identifier of a DID or X.509 Issuer. Allows reserved characters per RFC3986. Do not escape the URI.
allowReserved: true # allow reserved characters per RFC3986
- in: query
name: credentialType
required: true
schema:
type: string
- in: query
name: egfURI
required: true
schema:
type: string
format: URI
allowReserved: true # allow reserved characters per RFC3986
description: The URI that points to the Ecosystem Governance Framework. Allows reserved characters per RFC3986. Do not escape the URI.
responses:
'200':
description: search results matching criteria
content:
application/json:
schema:
$ref: '#/components/schemas/IdentifierResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
/query/trustregistry:
get:
tags:
- developers
summary: Queries for Trust Registry
operationId: validateTrustRegistry
description: |
Allows querying to get an answer if this Trust Registry has a trust relationship with the identified Trust Registry.
If one exists the returned status provides indicator of the trust relationship.
parameters:
- in: query
name: identifier
required: true
schema:
$ref: '#/components/schemas/Uri'
description: The URI-based identifier of a DID or X.509 Issuer. Allows reserved characters per RFC3986. Do not escape the URI.
allowReserved: true
- in: query
name: credentialType
required: true
schema:
type: string
- in: query
name: egfURI
required: true
schema:
type: string
format: URI
allowReserved: true # allow reserved characters per RFC3986
description: The URI that points to the Ecosystem Governance Framework. Allows reserved characters per RFC3986. Do not escape the URI.
responses:
'200':
description: search results matching criteria
content:
application/json:
schema:
$ref: '#/components/schemas/IdentifierResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
/query/getofflinefile:
get:
tags:
- developers
summary: Access a full data file that can be used offline.
operationId: getOfflineFile
description: |
Allows querying to determine the status of an Issuer, as identified by their Identifier (unique), credential type, and EGF that they are operating under.
responses:
'200':
description: JSON file array of offline list of Issuers
content:
application/json:
schema:
$ref: '#/components/schemas/OfflineCopy'
'401':
$ref: '#/components/responses/Unauthorized'
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
responses:
BadRequest:
description: Bad Request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
Unauthorized:
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
Forbidden:
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
NotFound:
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
NotAcceptable:
description: Not Acceptable
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
Conflict:
description: Conflict
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
InternalServerError:
description: Internal Server Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
ServiceUnavailable:
description: Service Unavailable
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
default:
description: Generic Error
schemas:
# IdentifierCheck:
# type: object
# required:
# - identifier
# - credentialType
# - governanceFrameworkURI
# properties:
# identifier:
# type: string
# format: URI
# example: 'did:example:123'
# credentialType:
# type: string
# governanceFrameworkURI:
# type: string
# format: URI
# example: 'did:example:456'
# validAt:
# type: string
# format: date-time
Uri:
type: string
format: uri
description: string providing an URI formatted according to IETF RFC 3986.
IdentifierResponse:
type: object
required:
- identifier
- credentialType
- governanceFrameworkURI
- status
- validFromDT
properties:
identifier:
type: string
format: URI
example: 'did:example:123'
entityType:
type: string
enum: [issuer, verifier, trustregistry]
description: 'Indicates the entity type that the identifier applies to.
Principally intended for the offline use case to indicate type.'
credentialType:
type: string
governanceFrameworkURI:
type: string
format: URI
example: 'did:example:456'
DIDDocument:
type: string
format: URI
description: 'Provides a URI that resolves to the DID Document for the Identifier.'
validFromDT:
type: string
format: date-time
description: 'Indicates that the Identifier status applies at the indicated time. A time in the past indicates when the last status change was recorded in the Trust Registry.'
validUntilDT:
type: string
format: date-time
description: 'Indicates the Issuers validity ends/ended at this date and time. A time in the past indicates when the last status change was recorded in the Trust Registry.'
status:
type: string
enum: [current, expired, terminated, revoked]
description: |
Provides a current status for entity (issuer or verifier)
- current - the entity is currently authorized, as of time of the query.
- expired - entity rights have expired.
- terminated - entity has voluntarily ceased Issuer role under the specific EGF.
- revoked - entity authority under specific EGF was terminated by the governing authority.
statusDetail:
type: string
description: "Optional free text that expands on the status parameter."
OfflineCopy:
type: object
required:
- validAtDT
- items
properties:
validAtDT:
type: string
format: date-time
description: The date-time that the extraction file is current as of. This may be the date-time of the data extraction
items:
type: array
items:
$ref: '#/components/schemas/IdentifierResponse'
ProblemDetails:
description: A Problem Details object (RFC 7807)
type: object
properties:
type:
type: string
format: uri
description: An absolute URI that identifies the problem type
default: about:blank # kept for backwards-compatibility, type will be mandatory in problem-v2
title:
type: string
description: A short summary of the problem type. Written in English and readable for engineers (usually not suited for non technical stakeholders and not localized).
example: Service Unavailable
status:
type: integer
format: int32
description: The HTTP status code generated by the origin server for this occurrence of the problem.
minimum: 400
maximum: 600
exclusiveMaximum: true
detail:
type: string
description: A human-readable explanation specific to this occurrence of the problem
instance:
type: string
format: uri
description: An absolute URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
security:
- bearerAuth: [] # apply to full API
#ADJUST - remove prescriptive - and add verbiage to support
# future use of VC/DIDAuth/etc.
#