forked from viperproject/VerifiedSCION
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdaemon.gen.yml
658 lines (658 loc) · 17.8 KB
/
daemon.gen.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
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
# GENERATED FILE DO NOT EDIT
openapi: 3.0.2
info:
title: SCION Daemon API
description: Service API for the SCION Daemon
version: 0.0.1
servers:
- url: http://{host}:{port}/api/v1
variables:
host:
default: localhost
port:
default: '31152'
tags:
- name: common
description: Common API exposed by SCION services.
- name: segment
description: Everything related to SCION path segments.
- name: cppki
description: Everything related to SCION CPPKI material.
paths:
/info:
get:
tags:
- common
summary: Basic information page about the control service process.
operationId: get-info
responses:
'200':
description: Successful Operation
content:
text/plain:
schema:
type: string
'400':
$ref: '#/components/responses/BadRequest'
/log/level:
get:
tags:
- common
summary: Get logging level
operationId: get-log-level
responses:
'200':
description: Successful Operation
content:
application/json:
schema:
$ref: '#/components/schemas/LogLevel'
'400':
$ref: '#/components/responses/BadRequest'
put:
tags:
- common
summary: Set logging level
operationId: set-log-level
requestBody:
description: Logging Level
content:
application/json:
schema:
$ref: '#/components/schemas/LogLevel'
required: true
responses:
'200':
description: Successful Operation
content:
application/json:
schema:
$ref: '#/components/schemas/LogLevel'
'400':
$ref: '#/components/responses/BadRequest'
/config:
get:
tags:
- common
summary: Prints the TOML configuration file.
operationId: get-config
responses:
'200':
description: Successful Operation
content:
text/plain:
schema:
type: string
'400':
$ref: '#/components/responses/BadRequest'
/segments:
get:
tags:
- segment
summary: List the SCION path segments
description: >-
List the SCION path segments that are known to the service. The results
can be filtered by the start and end AS of the segment. Inspect the
individual segments for a more detailed view.
operationId: get-segments
parameters:
- in: query
description: Start ISD-AS of segment.
name: start_isd_as
example: 1-ff00:0:110
schema:
$ref: '#/components/schemas/IsdAs'
- in: query
description: Terminal AS of segment.
name: end_isd_as
example: 2-ff00:0:210
schema:
$ref: '#/components/schemas/IsdAs'
responses:
'200':
description: List of matching SCION path segments.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SegmentBrief'
'400':
description: Invalid request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/segments/{segment-id}:
get:
tags:
- segment
summary: Get the SCION path segment description
description: Get the description of a specific SCION path segment.
operationId: get-segment
parameters:
- in: path
name: segment-id
required: true
schema:
$ref: '#/components/schemas/SegmentID'
style: simple
explode: false
responses:
'200':
description: SCION path segment information.
content:
application/json:
schema:
$ref: '#/components/schemas/Segment'
'400':
description: Invalid request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/segments/{segment-id}/blob:
get:
tags:
- segment
summary: Get the SCION path segment blob
description: Get the SCION path segment encoded as PEM bytes blob.
operationId: get-segment-blob
parameters:
- in: path
name: segment-id
required: true
schema:
$ref: '#/components/schemas/SegmentID'
style: simple
explode: false
responses:
'200':
description: SCION path segment blob
content:
application/x-pem-file:
example: |
-----BEGIN PATH SEGMENT-----
SCIONPathSegment ...
-----END PATH SEGMENT-----
'400':
description: Invalid request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/trcs:
get:
tags:
- cppki
summary: List the TRCs
description: >-
List the latest SCION Trust Root Configurations for each ISD that are
known to the control service. The result can be filtered by ISD.
Optionally, all TRCs can be requested instead of only the latest ones.
operationId: get-trcs
parameters:
- in: query
name: isd
schema:
type: array
items:
type: integer
style: form
explode: false
- in: query
name: all
schema:
type: boolean
responses:
'200':
description: List of applicable TRCs.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/TRCBrief'
'400':
$ref: '#/components/responses/BadRequest'
/trcs/isd{isd}-b{base}-s{serial}:
get:
tags:
- cppki
summary: Get the TRC
description: |
Get the SCION Trust Root Configuration.
operationId: get-trc
parameters:
- in: path
name: isd
required: true
schema:
type: integer
example: 42
- in: path
name: base
required: true
schema:
type: integer
example: 1
- in: path
name: serial
required: true
schema:
type: integer
example: 3
responses:
'200':
description: TRC.
content:
application/json:
schema:
$ref: '#/components/schemas/TRC'
'400':
$ref: '#/components/responses/BadRequest'
/trcs/isd{isd}-b{base}-s{serial}/blob:
get:
tags:
- cppki
summary: Get the TRC blob
description: |
Get the SCION Trust Root Configuration as PEM encoded byte blob.
operationId: get-trc-blob
parameters:
- in: path
name: isd
required: true
schema:
type: integer
example: 42
- in: path
name: base
required: true
schema:
type: integer
example: 1
- in: path
name: serial
required: true
schema:
type: integer
example: 3
responses:
'200':
description: TRC blob
content:
application/x-pem-file:
example: |
-----BEGIN TRC-----
ZjAwOjA6MTEwI ...
-----END TRC-----
'400':
$ref: '#/components/responses/BadRequest'
/certificates:
get:
tags:
- cppki
summary: List the certificate chains
description: |
List the currently active certificate chains that are known to the
control service. The result can be filtered by ISD-AS. Furthermore,
one can pass a particular point in time at which the certificate
chains are valid as input. A boolean can be provided to return all
certificates, regardless of their period of vailidity.
operationId: get-certificates
parameters:
- in: query
name: isd_as
schema:
$ref: '#/components/schemas/IsdAs'
- in: query
name: valid_at
schema:
type: string
format: date-time
- in: query
name: all
schema:
type: boolean
responses:
'200':
description: List of certificate chains
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ChainBrief'
'400':
description: Invalid request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/certificates/{chain-id}:
get:
tags:
- cppki
summary: Get the certificate chain
description: |
Get the certificate chain for a given ChainID.
operationId: get-certificate
parameters:
- in: path
name: chain-id
required: true
schema:
$ref: '#/components/schemas/ChainID'
responses:
'200':
description: Certificate chain
content:
application/json:
schema:
$ref: '#/components/schemas/Chain'
'400':
description: Invalid request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/certificates/{chain-id}/blob:
get:
tags:
- cppki
summary: Get the certificate chain blob
description: |
Get the certificate chain encoded as PEM bytes blob for a given ChainID.
operationId: get-certificate-blob
parameters:
- in: path
name: chain-id
required: true
schema:
$ref: '#/components/schemas/ChainID'
responses:
'200':
description: Certificate chain blob
content:
application/x-pem-file:
example: |
-----BEGIN CERTIFICATE-----
ASCertificate ...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
CACertificate ...
-----END CERTIFICATE-----
'400':
description: Invalid request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
components:
schemas:
StandardError:
type: object
properties:
error:
type: string
description: Error message
required:
- error
LogLevel:
type: object
properties:
level:
type: string
example: info
description: Logging level
enum:
- debug
- info
- error
required:
- level
IsdAs:
title: ISD-AS Identifier
type: string
pattern: ^\d+-([a-f0-9]{1,4}:){2}([a-f0-9]{1,4})|\d+$
example: 1-ff00:0:110
SegmentID:
title: Segment Identifier
type: string
example: fb45d44d
format: hex-string
SegmentBrief:
title: Brief SCION path segment description
type: object
required:
- id
- start_isd_as
- end_isd_as
- length
properties:
id:
$ref: '#/components/schemas/SegmentID'
start_isd_as:
$ref: '#/components/schemas/IsdAs'
end_isd_as:
$ref: '#/components/schemas/IsdAs'
length:
description: Length of the segment.
type: integer
example: 1
Problem:
type: object
required:
- status
- title
properties:
type:
type: string
format: uri-reference
description: >-
A URI reference that uniquely identifies the problem type only in
the context of the provided API. Opposed to the specification in
RFC-7807, it is neither recommended to be dereferencable and point
to a human-readable documentation nor globally unique for the
problem type.
default: about:blank
example: /problem/connection-error
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
description: >-
The HTTP status code generated by the origin server for this
occurrence of the problem.
minimum: 100
maximum: 599
example: 503
detail:
type: string
description: >-
A human readable explanation specific to this occurrence of the
problem that is helpful to locate the problem and give advice on how
to proceed. Written in English and readable for engineers, usually
not suited for non technical stakeholders and not localized.
example: Connection to database timed out
instance:
type: string
format: uri-reference
description: >-
A URI reference that identifies the specific occurrence of the
problem, e.g. by adding a fragment identifier or sub-path to the
problem type. May be used to locate the root of this problem in the
source code.
example: /problem/connection-error#token-info-read-timed-out
Hop:
title: Path segment hop
type: object
required:
- isd_as
- interface
properties:
isd_as:
$ref: '#/components/schemas/IsdAs'
interface:
type: integer
example: 42
Segment:
title: SCION path segment description
type: object
required:
- id
- timestamp
- expiration
- last_updated
- hops
properties:
id:
$ref: '#/components/schemas/SegmentID'
timestamp:
type: string
format: date-time
expiration:
type: string
format: date-time
last_updated:
type: string
format: date-time
hops:
type: array
items:
$ref: '#/components/schemas/Hop'
TRCID:
title: TRC Identifier
type: object
required:
- isd
- base_number
- serial_number
properties:
isd:
type: integer
example: 42
base_number:
type: integer
example: 1
serial_number:
type: integer
example: 3
TRCBrief:
title: Brief TRC description
type: object
required:
- id
properties:
id:
$ref: '#/components/schemas/TRCID'
Validity:
title: Validity period
type: object
required:
- not_before
- not_after
properties:
not_before:
type: string
format: date-time
example: '2021-01-04T09:59:33Z'
not_after:
type: string
format: date-time
example: '2022-01-04T09:59:33Z'
TRC:
title: TRC description
type: object
required:
- id
- validity
- core_ases
- authoritative_ases
- description
properties:
id:
$ref: '#/components/schemas/TRCID'
validity:
$ref: '#/components/schemas/Validity'
core_ases:
type: array
items:
$ref: '#/components/schemas/IsdAs'
authoritative_ases:
type: array
items:
$ref: '#/components/schemas/IsdAs'
description:
type: string
ChainID:
title: Certificate chain Identifier
type: string
example: fa53a04a
format: hex-string
ChainBrief:
title: Brief certificate chain description
type: object
required:
- id
- subject
- issuer
- validity
properties:
id:
$ref: '#/components/schemas/ChainID'
subject:
$ref: '#/components/schemas/IsdAs'
issuer:
$ref: '#/components/schemas/IsdAs'
validity:
$ref: '#/components/schemas/Validity'
SubjectKeyID:
type: string
format: spaced-hex-string
example: 89 B9 49 C2 2F 2F 9C DD 0D 2A 57 A9 DE 8E 2F 95 F3 09 10 D1
Certificate:
title: Certificate description
type: object
required:
- distinguished_name
- isd_as
- validity
- subject_key_algo
- subject_key_id
properties:
distinguished_name:
type: string
isd_as:
$ref: '#/components/schemas/IsdAs'
validity:
$ref: '#/components/schemas/Validity'
subject_key_algo:
type: string
example: ECDSA
subject_key_id:
$ref: '#/components/schemas/SubjectKeyID'
Chain:
title: Certificate chain description
type: object
required:
- subject
- issuer
properties:
subject:
$ref: '#/components/schemas/Certificate'
issuer:
$ref: '#/components/schemas/Certificate'
responses:
BadRequest:
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/StandardError'