forked from maxarvo/api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapiary.apib
395 lines (269 loc) · 11 KB
/
apiary.apib
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
FORMAT: 1A
HOST: https://arvo.computer
# AR.VO SPEC
## Authority [/api/authority]
Certificate AR.VO Authority service is AR.VO public API to
internal X.509 identity fabrique enrollment facilities
that include CA, СMP, OCSP, TSP servers
with CMC/EST enrollment ASN.1 protocols
hidden behind simple and clean HTTP AR.VO API.
<b>Data Structures</b>: CSR, Certificate, Person, Avatar, Computer, Service, Network.
### Enroll Certificate [POST]
+ Request (application/json)
+ Attributes (object)
+ `subject`: `arvo.computer` (array)
+ `csr`: `MIIBXzCB5gIBADBAMQswCQYDVQQGEwJVQTE...` (string, required) - Base64 CSR in ASN.1 DER
+ `abac`: *.merchant.abac,*.vagrant.abac,*.freelancer.abac,*.iva.community (array)
+ Response 201 (application/json)
+ Attributes (`Certificate`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
### Validate Certificate [GET /api/authority/{id}/validate]
+ Request (application/json)
+ Attributes
+ `certificate`: (`Certificate`, required) - ASN.1 DER encoded Certificate
+ Response 201 (application/json)
+ Attributes (`Certificate`)
+ Response 400
+ Attributes (`Error`)
### Update Certificate [PATCH /api/authority/{id}/update]
+ Request (application/json)
+ Attributes
+ `serial`: `6978096864956557546` (string, required) - serial of certificate
+ `alt_names`: `arvo.computer` (array)
+ `csr`: (string, required) - CSR in ASN.1 DER Base64 encoded
+ `abac`: abac:merchant:*,abac:vagrant:*,abac:freelancer:* (array)
+ Response 201 (application/json)
+ Attributes (`Certificate`)
+ Response 204
### Revoke Certificate [DELETE /api/authority/{id}/revoke]
+ Request (application/json)
+ Attributes
+ `serial`: `6978096864956557546` (string, required) - serial of certificate
+ Response 200 (application/json)
+ Response 400
+ Attributes (`Error`)
## Memory [/api/memory]
AR.VO Memory is a distributed storage that can persist
objects in JSON Schema Draft-07 verifiable format. Each type of objects
can be handled on diffferent nodes with different backends. Universality
is done in ISO/HL7 FHIR fashion based on AR.VO Schema.
<b>Data Structures</b>: Asset, File, Message, Document, License, Product, Service, Application.
### Register Schema [POST /api/memory/schema]
+ Request (application/json)
+ Attributes (object)
+ `id`: `7017480851` (number, required) - Identifier of person that is accosiated with user who initiated access token generation
+ `resourceType` (string, required) - AR.VO Schema Object
+ `status` (string, required)
+ `signature` (string, required)
+ Response 201 (application/json)
+ Attributes (`Resource`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
### Allocate Resource [POST /api/memory]
+ Request (application/json)
+ Attributes (object)
+ `id`: `7017480851` (number, required) - Identifier of person that is accosiated with user who initiated access token generation
+ `resourceType` (string, required) - AR.VO Schema Object
+ `status` (string, required)
+ `signature` (string, required)
+ Response 201 (application/json)
+ Attributes (`Resource`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
### Retrieve Resource [GET /api/memory/{id}/get]
+ Request (application/json)
+ Attributes
+ `id`: `a48cc83a-7aad-47c6-9487-2a566dc669a7` (string, required)
+ `status` (string, required)
+ `changed_at` (string, required)
+ Response 200 (application/json)
+ Attributes (`Certificate`)
+ Response 204
### Modify Resource [PATCH /api/memory/{id}/modify]
+ Request (application/json)
+ Attributes (`Resource`)
+ Response 200 (application/json)
+ Attributes (`Resource`)
+ Response 204
### Deallocate Resource [DELETE /api/memory/{id}/deallocate]
+ Request (application/json)
+ Attributes (object)
+ `id`: `7017480851` (number, required) - Identifier of the process
+ Response 201 (application/json)
+ Attributes (`Resource`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
## Logic [/api/logic]
Distributed process pattern than should be described and managed
as ISO 19510 BPMN model in correspondence to <a HREF="https://bpmn.io">bpmn.io</a> and Camunda
presented as AR.VO Logic API. All predefined and user contracts are managed as XML defined BPMN processes.
<b>Data Structures</b>: Contract, Process, Document, Edge, Node.
### Register Contract [POST /api/logic/contract]
+ Request (application/json)
+ Attributes (`Contract`)
+ Response 201 (application/json)
+ Attributes (`Contract`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
### Spawn Process [POST /api/logic]
+ Request (application/json)
+ Attributes (`Process`)
+ Response 201 (application/json)
+ Attributes (`Process`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
### Process Edge [PUT /api/logic/{id}/next]
+ Request (application/json)
+ Attributes (`Process`)
+ Response 201 (application/json)
+ Attributes (`Edge`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
### Retrieve Process [GET /api/logic/{id}/get]
+ Request (application/json)
+ Attributes (object)
+ `id`: `7017480851` (number, required) - Identifier of the process
+ Response 201 (application/json)
+ Attributes (`Process`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
### Amend Process [PATCH /api/logic/{id}/amend]
+ Request (application/json)
+ Attributes (object)
+ `id`: `7017480851` (number, required) - Identifier of the process
+ Response 201 (application/json)
+ Attributes (`Process`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
### Terminate Process [DELETE /api/logic/{id}/terminate]
+ Request (application/json)
+ Attributes (object)
+ `id`: `7017480851` (number, required) - Identifier of the process
+ Response 201 (application/json)
+ Attributes (`Process`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
## Space [/api/space]
Virtual environments that represent spaces contains interactive
gems that represent published works in context-aware spatial Geo container of 3D-space.
The laws of gem interactions are defined by logic of space, its contracts. Each space
may be managed by different authority.
<b>Data Structures</b>: Space, Gem, Network, Service, Avatar.
### Enter Space [GET /api/space]
+ Request (application/json)
+ Attributes (object)
+ `id`: `IVA` (string, required) - Identifier of the space
+ Response 201 (application/json)
+ Attributes (`Gem`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
### Publish Gem [POST /api/space/publish]
+ Request (application/json)
+ Attributes (object)
+ `id`: `7017480851` (number, required) - Identifier of the process
+ Response 201 (application/json)
+ Attributes (`Gem`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
### Search Gems [GET /api/space/search]
+ Request (application/json)
+ Attributes (object)
+ `id`: `7017480851` (number, required) - Identifier of the process
+ Response 201 (application/json)
+ Attributes (`Gem`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
### Retrieve Gem [GET /api/space/{id}/get]
+ Request (application/json)
+ Attributes (object)
+ `id`: `7017480851` (number, required) - Identifier of the process
+ Response 201 (application/json)
+ Attributes (`Gem`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
### Connect Event Stream [GET /api/space/{id}/stream]
+ Request (application/json)
+ Response 101 (application/json)
+ Response 400 (application/json)
### Gem Interaction [PUT /api/space/{id}/activate]
+ Request (application/json)
+ Attributes (object)
+ `id`: `7017480851` (number, required) - Identifier of the process
+ Response 201 (application/json)
+ Attributes (`Process`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
### Retire Gem [DELETE /api/space/{id}/retire]
+ Request (application/json)
+ Attributes (object)
+ `id`: `7017480851` (number, required) - Identifier of the process
+ Response 201 (application/json)
+ Attributes (`Gem`)
+ Response 400 (application/json)
+ Attributes (`Error`)
+ Response 422 (application/json)
+ Attributes (`ValidationError`)
# Data Structures
## Certificate (object)
+ `serial`: `6978096864956557546` (number, required) - serial of certificate
+ `subject`: `arvo.computer` (array) - domain scope (subject)
+ `cn`: `/C=UA/L=Київ/O=AR.VO/CN=CA` (string, required) - CA CN
+ `certificate`: `MIICQzCCAcqgAwIBAgIIYNcuIIw...` (string, required) - ASN.1 DER encoded certificate
## Resource (object)
+ `id`: `984375` (number, required) - Identifier of person that is accosiated with user who initiated access token generation
+ `status` (string, required)
+ `parent` (string, required)
## Process (object)
+ `id`: `984375` (number, required) - Identifier of person that is accosiated with user who initiated access token generation
+ `status` (string, required)
+ `parent` (string, required)
## Edge (object)
+ `id`: `984375` (number, required) - Identifier of person that is accosiated with user who initiated access token generation
+ `status` (string, required)
+ `parent` (string, required)
## Gem (object)
+ `id`: `984375` (number, required) - Identifier of person that is accosiated with user who initiated access token generation
+ `status` (string, required)
+ `parent` (string, required)
## Contract (object)
+ `id`: `984375` (number, required) - Identifier of person that is accosiated with user who initiated access token generation
+ `status` (string, required)
+ `parent` (string, required)
## ValidationError (Error)
- `type`: `validation_error` (fixed)
- `message`: `Validation failed` (string, required)
- `errors` (object, required)
## Error (object)
+ `type`: `example_error` (string, required) - Machine-readable error type
+ `message`: `Example error message` (string, required) - Human-readable error description