This repository has been archived by the owner on Apr 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
swagger.yaml
676 lines (674 loc) · 15.7 KB
/
swagger.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
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
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
# Copyright 2020 Intel Corporation
# SPDX-License-Identifier: Apache 2.0
---
swagger: "2.0"
info:
description: The API For Ops to Ocs communications
version: 1.0.0
title: owner-configuration-api
host: virtserver.swaggerhub.com
basePath: /rftemple/OwnerCompanion/1.0.0
schemes:
- https
paths:
/v1/devices/{deviceId}/voucher:
get:
tags:
- OCS
summary: Gets the owner voucher for the device
operationId: getDeviceVoucher
produces:
- application/json
parameters:
- name: deviceId
in: path
required: true
type: string
responses:
200:
description: the voucher as a string
schema:
type: string
404:
description: Not found
500:
description: Server error
/v1/devices/voucher:
post:
tags:
- OCS
summary: sets owner voucher for the device
operationId: postDeviceVoucher
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: voucher
required: false
schema:
type: string
responses:
200:
description: response
500:
description: Server error
503:
description: Temporarily Unaviable
/v1/devices/{deviceId}/blob:
delete:
tags:
- Optional
summary: Deletes the entire device blob and all of its related data.
operationId: deleteDeviceBlob
parameters:
- name: deviceId
in: path
required: true
type: string
responses:
200:
description: Device was deleted
404:
description: Not found
500:
description: Server error
/v1/devices/{deviceId}/msgs:
get:
tags:
- OCS
summary: Retrieves all serviceInfo Messages to be sent to the device
operationId: getServiceInfo
produces:
- application/json
parameters:
- name: deviceId
in: path
required: true
type: string
responses:
200:
description: response
schema:
$ref: '#/definitions/ArrayOfSviMessage'
404:
description: The device not found
500:
description: Server error
post:
tags:
- OCS
summary: Posts a deviceServiceInfo message recieved from the device
operationId: postDeviceServiceInfo
consumes:
- application/json
produces:
- application/json
parameters:
- name: deviceId
in: path
required: true
type: string
- in: body
name: messages
required: false
schema:
$ref: '#/definitions/ModuleMessage'
responses:
200:
description: response
put:
tags:
- Optional
summary: Updates all service info messages to be sent to the device
operationId: putServiceInfo
consumes:
- application/json
produces:
- application/json
parameters:
- name: deviceId
in: path
required: true
type: string
- name: valueId
in: path
description: The Id of the ServiceInfo value to update
required: true
type: string
- in: body
name: messages
required: false
schema:
$ref: '#/definitions/ModuleMessage'
responses:
200:
description: response
/v1/devices/{deviceId}/values/{valueId}:
get:
tags:
- OCS
summary: Gets the value of a ServiceInfo message or a range of bytes within the value
operationId: getSviValue
produces:
- application/octet-stream
parameters:
- name: deviceId
in: path
required: true
type: string
- name: valueId
in: path
description: The Id of the ServiceInfo value to retrieve
required: true
type: string
- name: start
in: query
description: Starting index is inclusive
required: true
type: integer
- name: end
in: query
description: Ending index is exclusive
required: true
type: integer
responses:
200:
description: value of a module message message
schema:
type: file
404:
description: Not found
500:
description: Server error
put:
tags:
- Optional
summary: Updates a service info value for a device
operationId: putSviValue
consumes:
- application/octet-stream
produces:
- application/json
parameters:
- name: deviceId
in: path
required: true
type: string
- name: valueId
in: path
description: The Id of the ServiceInfo value to update
required: true
type: string
- in: body
name: messages
required: false
schema:
$ref: '#/definitions/ModuleMessage'
responses:
200:
description: response
/v1/devices/{deviceId}/psi:
get:
tags:
- OCS
summary: Gets the pre-service messages to send to the device
operationId: getPsi
produces:
- application/json
parameters:
- name: deviceId
in: path
required: true
type: string
responses:
200:
description: response
schema:
$ref: '#/definitions/ArrayOfModuleMessage'
/v1/devices/{deviceId}/setupinfo:
get:
tags:
- OCS
summary: Get the replacement credentials for the device
operationId: getSetupInfo
produces:
- application/json
parameters:
- name: deviceId
in: path
required: true
type: string
responses:
200:
description: response
schema:
$ref: '#/definitions/SetupInfoResponse'
/v1/devices/{deviceId}/errors:
post:
tags:
- OCS
summary: logs error for the
operationId: postErrors
consumes:
- application/json
produces:
- application/json
parameters:
- name: deviceId
in: path
required: true
type: string
- in: body
name: messages
required: false
schema:
$ref: '#/definitions/ProtocolError'
responses:
200:
description: response
/v1/devices/{deviceId}/state:
get:
tags:
- OCS
summary: the state of the device
operationId: getDeviceState
parameters:
- name: deviceId
in: path
required: true
type: string
responses:
200:
description: response
schema:
$ref: '#/definitions/DeviceState'
post:
tags:
- OCS
summary: logs error for the
operationId: postState
consumes:
- application/json
produces:
- application/json
parameters:
- name: deviceId
in: path
required: true
type: string
- in: body
name: The updated state of the device
required: false
schema:
$ref: '#/definitions/DeviceState'
responses:
200:
description: response
/v1/devices/{deviceId}/sessioninfo:
get:
tags:
- OCS
summary: Gets the session info stored for the decive
operationId: getDeviceSessionInfo
parameters:
- name: deviceId
in: path
required: true
type: string
responses:
200:
description: response
schema:
$ref: '#/definitions/SessionInfo'
post:
tags:
- OCS
summary: Updates the session info for the device
operationId: postDeviceSessionInfo
consumes:
- application/json
produces:
- application/json
parameters:
- name: deviceId
in: path
required: true
type: string
- in: body
name: The updated session info that needs to be stored
required: false
schema:
$ref: '#/definitions/SessionInfo'
responses:
200:
description: response
delete:
tags:
- OCS
summary: Deletes the session info for the device
operationId: deleteDeviceSessionInfo
consumes:
- application/json
produces:
- application/json
parameters:
- name: deviceId
in: path
required: true
type: string
responses:
200:
description: response
/v1/signatures/{deviceId}:
post:
tags:
- OCS
summary: Owner Signature operations
operationId: postSignature
consumes:
- application/json
produces:
- application/json
parameters:
- name: deviceId
in: path
required: true
type: string
- in: body
name: message
required: true
description: Message to sign
schema:
type: string
responses:
200:
description: response
schema:
$ref: '#/definitions/SignatureResponse'
/v1/ciphers/{deviceId}:
post:
tags:
- OCS
summary: Perform the cipher operation on input array of bytes and return the resulting array of bytes
operationId: postCiphers
consumes:
- application/octet-stream
produces:
- application/octet-stream
parameters:
- name: deviceId
in: path
required: true
type: string
- name: operation
in: path
required: true
type: string
enum: [encipher, decipher]
description: The name of the cipher operation
- in: body
name: message
required: true
description: The message to perform cipher the operation on
schema:
type: string
responses:
200:
description: the result of the cipher operation
definitions:
ArrayOfSviMessage:
type: array
items:
$ref: '#/definitions/SviMessage'
SviMessage:
type: object
properties:
module:
type: string
example: sdo_sys
description: The name of the module sending the message
msg:
example: exec, filedesc, write, etc
description: The name of the messenge being sent
valueLen:
type: integer
description: the total length of the value of the message
enc:
type: string
description: the intened encoding expected to use when sending the value
enum:
- base64
- ascii
valueId:
type: string
description: the id to use when retrieving the value of the message
ArrayOfModuleMessage:
type: array
description: An array of Device service info messages
items:
$ref: '#/definitions/ModuleMessage'
ModuleMessage:
type: object
properties:
module:
description: The module sending the message
type: string
msg:
description: The name of the messenge being sent
type: string
value:
type: string
description: The value of the message
ProtocolError:
type: object
properties:
ec:
type: integer
description: error code
em:
type: string
description: String message
emsg:
type: integer
description: String message
SignatureResponse:
type: object
properties:
pk:
type: string
description: The public key to verify the signature
alg:
type: string
description: The name of the agorithm used to generate the signature
sg:
type: string
description: The signature value encoded as ASN.1 for EC keys or RAW encoding for RSA keys
DeviceState:
type: object
properties:
to2State:
type: string
description: The to2State of the device
enum:
- to2begin
- to2end
- to2error
to2Timestamp:
type: string
description: ISO 8601 date format last state change
to2Error:
$ref: '#/definitions/ProtocolError'
to0Ws:
type: integer
description: The wait seconds recived from To0
to0Timestamp:
type: string
description: ISO 8601 timestamp of the To0
to0Error:
$ref: '#/definitions/ProtocolError'
g3:
type: string
description: replacement guid
SetupInfoResponse:
type: object
properties:
g3:
type: string
description: guid for setup credential
r3:
type: array
description: rendezvous instructions for replacement credential
items:
$ref: '#/definitions/RendezvousInfo'
pub2:
type: string
description: public key for replacement credential
RendezvousInfo:
type: object
properties:
only:
type: string
description: only for
ip:
type: string
description: ip addess
po:
type: integer
description: port used by the device T02
pow:
type: integer
description: port used by the owner for T0
dn:
type: string
description: Domain name
sch:
type: string
description: Server Certificate Hash
cch:
type: string
description: CA Certificate Hash
ui:
type: integer
description: User Input requred
ss:
type: string
description: Wireless SSID
pw:
type: string
description: Wireless Password
wsp:
type: string
description: Wireless Security Password
me:
type: string
description: Medium
pr:
type: string
description: Protocol
delaysec:
type: integer
description: delay seconds
SessionInfo:
type: object
properties:
message41Store:
$ref: '#/definitions/Message41Store'
message45Store:
$ref: '#/definitions/Message45Store'
message47Store:
$ref: '#/definitions/Message47Store'
deviceCryptoInfo:
$ref: '#/definitions/DeviceCryptoInfo'
Message41Store:
type: object
properties:
n6:
type: string
kx:
type: string
ownershipProxy:
type: string
cs:
type: string
kxEcdhPublicKey:
type: string
kxEcdhPrivateKey:
type: string
kxEcdhRandom:
type: string
kxDhPublicKey:
type: string
kxDhPrivateKey:
type: string
asymRandom:
type: string
Message45Store:
type: object
properties:
n7:
type: string
nn:
type: integer
xb:
type: string
Message47Store:
type: object
properties:
newOwnershipProxy:
type: string
DeviceCryptoInfo:
type: object
properties:
ctrNonce:
type: string
ctrCounter:
type: number
OwnerVoucher:
type: object
required:
- en
- hmac
- oh
- sz
properties:
sz:
type: integer
oh:
$ref: '#/definitions/OwnerVoucherHeader'
hmac:
type: array
items: {}
dc:
type: array
items: {}
en:
type: array
items: {}
OwnerVoucherHeader:
type: object
properties:
pv:
type: integer
description: protocol version
pe:
type: integer
description: public key encoding
r:
type: array
description: rendezvous instructions
items: {}
g:
type: string
description: base64 encoded guid (deviceID)
d:
type: string
description: deviceinfo
pk:
type: array
description: mfg public Key
items: {}
hdc:
type: array
items: {}