Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 469487cc

Přidáno uživatelem Jan Pašek před téměř 4 roky(ů)

Update swagger.yaml

Zobrazit rozdíly:

src/swagger.yaml
2 2
info:
3 3
  title: X.509 certificate management
4 4
  description: API for certificate management created for YOSO company
5
  version: 1.0.1
5
  version: 1.1.0
6 6
servers:
7
- url: https://virtserver.swaggerhub.com/janpasek97/X509_management/1.0.1
7
- url: https://virtserver.swaggerhub.com/janpasek97/X509_management/1.1.0
8 8
  description: X509 management API
9 9
tags:
10 10
- name: certificates
11 11
  description: API for creating and querying certificates
12 12
paths:
13
  /api/certificates:
14
    get:
15
      tags:
16
      - certificates
17
      summary: get list of certificates
18
      description: Lists certificates based on provided filtering options
19
      operationId: getCertificateList
20
      parameters:
21
      - name: filtering
22
        in: query
23
        description: Filter certificate type to be queried
24
        required: false
25
        style: form
26
        explode: true
27
        schema:
28
          $ref: '#/components/schemas/Filtering'
29
      responses:
30
        "200":
31
          description: returning results matching filtering criteria
32
          content:
33
            application/json:
34
              schema:
35
                $ref: '#/components/schemas/CertificateListResponse'
36
        "400":
37
          description: bad request
38
          content:
39
            application/json:
40
              schema:
41
                $ref: '#/components/schemas/ErrorResponse'
42
    post:
43
      tags:
44
      - certificates
45
      summary: create new certificate
46
      description: Create a new certificate based on given information
47
      operationId: createCertificate
48
      requestBody:
49
        description: Certificate data to be created
50
        content:
51
          application/json:
52
            schema:
53
              $ref: '#/components/schemas/CertificateRequest'
54
      responses:
55
        "201":
56
          description: item created
57
          content:
58
            application/json:
59
              schema:
60
                $ref: '#/components/schemas/CreatedResponse'
61
        "400":
62
          description: invalid input, object invalid
63
          content:
64
            application/json:
65
              schema:
66
                $ref: '#/components/schemas/ErrorResponse'
13 67
  /api/certificates/{id}:
14 68
    get:
15 69
      tags:
16 70
      - certificates
17 71
      summary: get certificate by ID
18 72
      description: Get certificate in PEM format by ID
19
      operationId: get_certificate_by_id
73
      operationId: getCertificateById
20 74
      parameters:
21 75
      - name: id
22 76
        in: path
......
33 87
            application/json:
34 88
              schema:
35 89
                $ref: '#/components/schemas/PemResponse'
36
        "204":
90
        "404":
37 91
          description: the certificate was not found
38 92
          content:
39 93
            application/json:
......
45 99
            application/json:
46 100
              schema:
47 101
                $ref: '#/components/schemas/ErrorResponse'
48
      x-openapi-router-controller: swagger_server.controllers.certificates_controller
102
    delete:
103
      tags:
104
      - certificates
105
      summary: delete certificate by ID
106
      description: Delete certificate by id. If the specified certificate is an issuer of some other certificate, whole subtree is delted.
107
      operationId: deleteCertificateById
108
      parameters:
109
      - name: id
110
        in: path
111
        description: ID of a certificate to be deleted
112
        required: true
113
        style: simple
114
        explode: false
115
        schema:
116
          $ref: '#/components/schemas/IdParameter'
117
      responses:
118
        "200":
119
          description: certificate deleted
120
          content:
121
            application/json:
122
              schema:
123
                $ref: '#/components/schemas/SuccessResponse'
124
        "400":
125
          description: bad request
126
          content:
127
            application/json:
128
              schema:
129
                $ref: '#/components/schemas/ErrorResponse'
130
        "404":
131
          description: Certificate was not found
132
          content:
133
            application/json:
134
              schema:
135
                $ref: '#/components/schemas/ErrorResponse'
136
    patch:
137
      tags:
138
      - certificates
139
      summary: revoke certificate by id
140
      description: Revoke a certificate specified by id
141
      operationId: revokeCertificateById
142
      parameters:
143
      - name: id
144
        in: path
145
        description: ID of a certificate to be deleted
146
        required: true
147
        style: simple
148
        explode: false
149
        schema:
150
          $ref: '#/components/schemas/IdParameter'
151
      requestBody:
152
        content:
153
          application/json:
154
            schema:
155
              $ref: '#/components/schemas/SetStatusRequest'
156
      responses:
157
        "200":
158
          description: Certificate status updated
159
          content:
160
            application/json:
161
              schema:
162
                $ref: '#/components/schemas/SuccessResponse'
163
        "400":
164
          description: bad request
165
          content:
166
            application/json:
167
              schema:
168
                $ref: '#/components/schemas/ErrorResponse'
169
        "404":
170
          description: Certificate was not found
171
          content:
172
            application/json:
173
              schema:
174
                $ref: '#/components/schemas/ErrorResponse'
49 175
  /api/certificates/{id}/chain:
50 176
    get:
51 177
      tags:
52 178
      - certificates
53 179
      summary: get certificate's trust chain by ID
54 180
      description: Get certificate trust chain in PEM format by ID
55
      operationId: get_certificate_trust_chain_by_id
181
      operationId: getCertificateTrustChainById
56 182
      parameters:
57 183
      - name: id
58 184
        in: path
......
69 195
            application/json:
70 196
              schema:
71 197
                $ref: '#/components/schemas/PemResponse'
72
        "204":
198
        "404":
73 199
          description: the certificate was not found
74 200
          content:
75 201
            application/json:
......
81 207
            application/json:
82 208
              schema:
83 209
                $ref: '#/components/schemas/ErrorResponse'
84
      x-openapi-router-controller: swagger_server.controllers.certificates_controller
85 210
  /api/certificates/{id}/root:
86 211
    get:
87 212
      tags:
88 213
      - certificates
89 214
      summary: get certificate's root of trust chain by ID
90 215
      description: Get certificate's root of trust chain in PEM format by ID
91
      operationId: get_certificate_root_by_id
216
      operationId: getCertificateRootById
92 217
      parameters:
93 218
      - name: id
94 219
        in: path
......
105 230
            application/json:
106 231
              schema:
107 232
                $ref: '#/components/schemas/PemResponse'
108
        "204":
233
        "404":
109 234
          description: the certificate was not found
110 235
          content:
111 236
            application/json:
......
117 242
            application/json:
118 243
              schema:
119 244
                $ref: '#/components/schemas/ErrorResponse'
120
      x-openapi-router-controller: swagger_server.controllers.certificates_controller
121 245
  /api/certificates/{id}/details:
122 246
    get:
123 247
      tags:
124 248
      - certificates
125 249
      summary: get certificate's details by ID
126 250
      description: Get certificate details by ID
127
      operationId: get_certificate_details_by_id
251
      operationId: getCertificateDetailsById
128 252
      parameters:
129 253
      - name: id
130 254
        in: path
......
141 265
            application/json:
142 266
              schema:
143 267
                $ref: '#/components/schemas/CertificateResponse'
144
        "204":
268
        "404":
145 269
          description: the certificate was not found
146 270
          content:
147 271
            application/json:
......
153 277
            application/json:
154 278
              schema:
155 279
                $ref: '#/components/schemas/ErrorResponse'
156
      x-openapi-router-controller: swagger_server.controllers.certificates_controller
157
  /api/certificates:
280
  /api/certificates/{id}/publickey:
158 281
    get:
159 282
      tags:
160 283
      - certificates
161
      summary: get list of certificates
162
      description: Lists certificates based on provided filtering options
163
      operationId: get_certificate_list
284
      summary: get public key of given certificate
285
      description: Get public key that belongs to the selected certificate
286
      operationId: getPublicKeyOfCertificateById
164 287
      parameters:
165
      - name: filtering
166
        in: query
167
        description: Filter certificate type to be queried
168
        required: false
169
        style: form
170
        explode: true
288
      - name: id
289
        in: path
290
        description: ID of a certificate whose public key is to be queried
291
        required: true
292
        style: simple
293
        explode: false
171 294
        schema:
172
          $ref: '#/components/schemas/Filtering'
295
          $ref: '#/components/schemas/IdParameter'
173 296
      responses:
174 297
        "200":
175
          description: returning results matching filtering criteria
298
          description: returning the certificate's public key
176 299
          content:
177 300
            application/json:
178 301
              schema:
179
                $ref: '#/components/schemas/CertificateListResponse'
180
        "204":
181
          description: no certificates found
302
                $ref: '#/components/schemas/PemResponse'
303
        "404":
304
          description: the certificate was not found
182 305
          content:
183 306
            application/json:
184 307
              schema:
......
189 312
            application/json:
190 313
              schema:
191 314
                $ref: '#/components/schemas/ErrorResponse'
192
      x-openapi-router-controller: swagger_server.controllers.certificates_controller
193
    post:
315
  /api/certificates/{id}/privatekey:
316
    get:
194 317
      tags:
195 318
      - certificates
196
      summary: create new certificate
197
      description: Create a new certificate based on given information
198
      operationId: create_certificate
199
      requestBody:
200
        description: Certificate data to be created
201
        content:
202
          application/json:
203
            schema:
204
              $ref: '#/components/schemas/CertificateRequest'
319
      summary: get private key of given certificate
320
      description: Get private key that belongs to the selected certificate
321
      operationId: getPrivateKeyOfCertificateById
322
      parameters:
323
      - name: id
324
        in: path
325
        description: ID of a certificate whose private key is to be queried
326
        required: true
327
        style: simple
328
        explode: false
329
        schema:
330
          $ref: '#/components/schemas/IdParameter'
205 331
      responses:
206
        "201":
207
          description: item created
332
        "200":
333
          description: returning the certificate's private key
208 334
          content:
209 335
            application/json:
210 336
              schema:
211
                $ref: '#/components/schemas/CreatedResponse'
212
        "400":
213
          description: "invalid input, object invalid"
337
                $ref: '#/components/schemas/PemResponse'
338
        "404":
339
          description: the certificate was not found
214 340
          content:
215 341
            application/json:
216 342
              schema:
217 343
                $ref: '#/components/schemas/ErrorResponse'
218
        "409":
219
          description: an existing item already exists
344
        "400":
345
          description: bad request
220 346
          content:
221 347
            application/json:
222 348
              schema:
223 349
                $ref: '#/components/schemas/ErrorResponse'
224
      x-openapi-router-controller: swagger_server.controllers.certificates_controller
225 350
components:
226 351
  schemas:
227 352
    CAUsage:
......
239 364
          type: boolean
240 365
        SSL:
241 366
          type: boolean
242
      example:
243
        digitalSignature: true
244
        SSL: true
245
        CA: true
246
        authentication: true
247 367
    IssuerListItem:
248 368
      required:
249 369
      - CN
......
255 375
        CN:
256 376
          type: string
257 377
          example: Root CA s.r.o.
258
      example:
259
        id: 547
260
        CN: Root CA s.r.o.
261 378
    CertificateListResponse:
262 379
      properties:
263 380
        success:
......
267 384
          type: array
268 385
          items:
269 386
            $ref: '#/components/schemas/CertificateListItem'
270
      example:
271
        data:
272
        - notAfter: 2021-07-01T00:00:00.000+00:00
273
          usage:
274
            digitalSignature: true
275
            SSL: true
276
            CA: true
277
            authentication: true
278
          id: 547
279
          CN: Root CA s.r.o.
280
          notBefore: 2021-03-31T00:00:00.000+00:00
281
          issuer:
282
            id: 547
283
            CN: Root CA s.r.o.
284
        - notAfter: 2021-07-01T00:00:00.000+00:00
285
          usage:
286
            digitalSignature: true
287
            SSL: true
288
            CA: true
289
            authentication: true
290
          id: 547
291
          CN: Root CA s.r.o.
292
          notBefore: 2021-03-31T00:00:00.000+00:00
293
          issuer:
294
            id: 547
295
            CN: Root CA s.r.o.
296
        success: true
297 387
    CertificateListItem:
298 388
      properties:
299 389
        id:
......
314 404
          $ref: '#/components/schemas/CAUsage'
315 405
        issuer:
316 406
          $ref: '#/components/schemas/IssuerListItem'
317
      example:
318
        notAfter: 2021-07-01T00:00:00.000+00:00
319
        usage:
320
          digitalSignature: true
321
          SSL: true
322
          CA: true
323
          authentication: true
324
        id: 547
325
        CN: Root CA s.r.o.
326
        notBefore: 2021-03-31T00:00:00.000+00:00
327
        issuer:
328
          id: 547
329
          CN: Root CA s.r.o.
330 407
    Filtering:
331 408
      properties:
332 409
        CA:
333 410
          type: boolean
411
        issuedby:
412
          type: integer
413
          example: 517
334 414
    Subject:
335 415
      required:
336 416
      - CN
......
363 443
          type: string
364 444
          description: Email Address
365 445
          example: root@ca.com
366
      example:
367
        ST: Pilsen Region
368
        emailAddress: root@ca.com
369
        C: CZ
370
        OU: IT department
371
        CN: Root CA s.r.o.
372
        L: Pilsen
373
        O: Root CA s.r.o.
374 446
    Certificate:
375 447
      required:
376 448
      - notAfter
......
394 466
          type: integer
395 467
          description: ID of the new item
396 468
          example: 547
397
      example:
398
        notAfter: 2021-07-01T00:00:00.000+00:00
399
        subject:
400
          ST: Pilsen Region
401
          emailAddress: root@ca.com
402
          C: CZ
403
          OU: IT department
404
          CN: Root CA s.r.o.
405
          L: Pilsen
406
          O: Root CA s.r.o.
407
        usage:
408
          digitalSignature: true
409
          SSL: true
410
          CA: true
411
          authentication: true
412
        notBefore: 2021-03-31T00:00:00.000+00:00
413
        CA: 547
414 469
    CertificateRequest:
415 470
      required:
416 471
      - subject
......
423 478
          type: integer
424 479
          example: 30
425 480
        usage:
426
          $ref: '#/components/schemas/CAUsage'
481
          type: array
482
          items:
483
            type: string
484
            enum:
485
            - CA
486
            - authentication
487
            - digitalSignature
488
            - SSL
427 489
        CA:
428 490
          type: integer
429 491
          description: ID of the new item
430 492
          example: 547
493
    SuccessResponse:
494
      required:
495
      - data
496
      - success
497
      properties:
498
        success:
499
          type: boolean
500
          example: true
501
        data:
502
          type: string
503
          example: Operation was successfull
504
      description: Operation successfull
431 505
    CreatedResponse:
432 506
      required:
433 507
      - data
......
440 514
          type: integer
441 515
          example: 457
442 516
      description: Item was created
443
      example:
444
        data: 457
445
        success: true
446 517
    ErrorResponse:
447 518
      required:
448 519
      - data
......
464 535
          example: true
465 536
        data:
466 537
          $ref: '#/components/schemas/Certificate'
467
      example:
468
        data:
469
          notAfter: 2021-07-01T00:00:00.000+00:00
470
          subject:
471
            ST: Pilsen Region
472
            emailAddress: root@ca.com
473
            C: CZ
474
            OU: IT department
475
            CN: Root CA s.r.o.
476
            L: Pilsen
477
            O: Root CA s.r.o.
478
          usage:
479
            digitalSignature: true
480
            SSL: true
481
            CA: true
482
            authentication: true
483
          notBefore: 2021-03-31T00:00:00.000+00:00
484
          CA: 547
485
        success: true
486 538
    PemResponse:
487 539
      required:
488 540
      - data
......
493 545
          example: true
494 546
        data:
495 547
          type: string
496
          description: Single PEM file or concatenation of multiple PEM formatted
497
            certificates
498
          example: '-----BEGIN CERTIFICATE-----MIICLDCCAdKgAwIBAgIBADAKBggqhkjOPQQDAjB9MQswCQYDVQQGEwJCRTEPMA0GA1UEChMGR251VExTMSUwIwYDVQQ...etc-----END
499
            CERTIFICATE-----'
500
      example:
501
        data: '-----BEGIN CERTIFICATE-----MIICLDCCAdKgAwIBAgIBADAKBggqhkjOPQQDAjB9MQswCQYDVQQGEwJCRTEPMA0GA1UEChMGR251VExTMSUwIwYDVQQ...etc-----END
502
          CERTIFICATE-----'
503
        success: true
548
          description: Single PEM file or concatenation of multiple PEM formatted certificates
549
          example: '-----BEGIN CERTIFICATE-----MIICLDCCAdKgAwIBAgIBADAKBggqhkjOPQQDAjB9MQswCQYDVQQGEwJCRTEPMA0GA1UEChMGR251VExTMSUwIwYDVQQ...etc-----END CERTIFICATE-----'
504 550
    IdParameter:
505 551
      required:
506 552
      - id
......
508 554
        id:
509 555
          type: integer
510 556
          example: 444
511

  
557
    SetStatusRequest:
558
      required:
559
      - status
560
      properties:
561
        status:
562
          type: string
563
          enum:
564
          - revoked
565
          - valid
566
        reason:
567
          type: string
568
          enum:
569
          - unspecified
570
          - keyCompromise
571
          - CACompromise
572
          - affiliationChanged
573
          - superseded
574
          - cessationOfOperation
575
          - certificateHold
576
          - removeFromCRL

Také k dispozici: Unified diff