blob: cee5a402c6e73d338d62ac6cb050d14f3e40133d [file] [log] [blame]
Bartosz Gardziejewski73331082020-02-25 10:50:55 +01001openapi: 3.0.1
2info:
3 title: CertService Documentation
Bartosz Gardziejewski08558462020-03-10 16:05:09 +01004 description: Certification service API documentation
5 version: 1.0.0
Bartosz Gardziejewski73331082020-02-25 10:50:55 +01006servers:
Bartosz Gardziejewski08558462020-03-10 16:05:09 +01007 - url: http://localhost:8080
Bartosz Gardziejewski73331082020-02-25 10:50:55 +01008 description: Generated server url
9tags:
10 - name: Actuator
11 description: Monitor and interact
12 externalDocs:
13 description: Spring Boot Actuator Web API Documentation
Bartosz Gardziejewski08558462020-03-10 16:05:09 +010014 url: https://docs.spring.io/spring-boot/docs/current/actuator-api/html/
Bartosz Gardziejewski73331082020-02-25 10:50:55 +010015paths:
Bartosz Gardziejewski08558462020-03-10 16:05:09 +010016 /v1/certificate/{caName}:
Bartosz Gardziejewski73331082020-02-25 10:50:55 +010017 get:
18 tags:
Bartosz Gardziejewski08558462020-03-10 16:05:09 +010019 - CertificationService
20 summary: sign certificate
21 description: Web endpoint for requesting certificate signing. Used by system
22 components to gain certificate signed by CA.
23 operationId: signCertificate
Bartosz Gardziejewski73331082020-02-25 10:50:55 +010024 parameters:
25 - name: caName
26 in: path
Bartosz Gardziejewski08558462020-03-10 16:05:09 +010027 description: Name of certification authority that will sign CSR.
Bartosz Gardziejewski73331082020-02-25 10:50:55 +010028 required: true
29 schema:
30 type: string
31 - name: CSR
32 in: header
Bartosz Gardziejewski08558462020-03-10 16:05:09 +010033 description: Certificate signing request in form of PEM object encoded in
34 Base64 (with header and footer).
Bartosz Gardziejewski73331082020-02-25 10:50:55 +010035 required: true
36 schema:
37 type: string
38 - name: PK
39 in: header
Bartosz Gardziejewski08558462020-03-10 16:05:09 +010040 description: Private key in form of PEM object encoded in Base64 (with header
41 and footer).
Bartosz Gardziejewski73331082020-02-25 10:50:55 +010042 required: true
43 schema:
44 type: string
45 responses:
Bartosz Gardziejewski08558462020-03-10 16:05:09 +010046 "200":
47 description: certificate successfully signed
48 content:
49 application/json; charset=utf-8:
50 schema:
51 $ref: '#/components/schemas/CertificationModel'
52 "500":
53 description: something went wrong during connecting to cmp client
54 content:
55 application/json; charset=utf-8:
56 schema:
57 $ref: '#/components/schemas/ErrorResponseModel'
58 "404":
59 description: CA not found for given name
60 content:
61 application/json; charset=utf-8:
62 schema:
63 $ref: '#/components/schemas/ErrorResponseModel'
64 "400":
65 description: given CSR or/and PK is incorrect
66 content:
67 application/json; charset=utf-8:
68 schema:
69 $ref: '#/components/schemas/ErrorResponseModel'
70 /ready:
71 get:
72 tags:
73 - CertificationService
74 summary: check is container is ready
75 description: Web endpoint for checking if service is ready to be used.
76 operationId: checkReady
77 responses:
78 "200":
79 description: configuration is loaded and service is ready to use
Bartosz Gardziejewski73331082020-02-25 10:50:55 +010080 content:
81 application/json; charset=utf-8:
82 schema:
83 type: string
Bartosz Gardziejewski08558462020-03-10 16:05:09 +010084 "503":
85 description: configuration loading failed and service is unavailable
Bartosz Gardziejewski73331082020-02-25 10:50:55 +010086 content:
87 application/json; charset=utf-8:
88 schema:
89 type: string
Bartosz Gardziejewski08558462020-03-10 16:05:09 +010090 /reload:
91 get:
92 tags:
93 - CertificationService
94 summary: reload service configuration from file
95 description: Web endpoint for performing configuration reload. Used to reload
96 configuration file from file.
97 operationId: reloadConfiguration
98 responses:
99 "200":
100 description: configuration has been successfully reloaded
Bartosz Gardziejewski73331082020-02-25 10:50:55 +0100101 content:
102 application/json; charset=utf-8:
103 schema:
104 type: string
Bartosz Gardziejewski08558462020-03-10 16:05:09 +0100105 "500":
106 description: something went wrong during configuration loading
107 content:
108 application/json; charset=utf-8:
109 schema:
110 $ref: '#/components/schemas/ErrorResponseModel'
Bartosz Gardziejewski73331082020-02-25 10:50:55 +0100111 /actuator/health:
112 get:
113 tags:
114 - Actuator
Bartosz Gardziejewski73331082020-02-25 10:50:55 +0100115 summary: Actuator web endpoint 'health'
Bartosz Gardziejewski08558462020-03-10 16:05:09 +0100116 operationId: handle_0
Bartosz Gardziejewski73331082020-02-25 10:50:55 +0100117 responses:
Bartosz Gardziejewski08558462020-03-10 16:05:09 +0100118 "200":
119 description: default response
Bartosz Gardziejewski73331082020-02-25 10:50:55 +0100120 content: {}
Bartosz Gardziejewski08558462020-03-10 16:05:09 +0100121 /actuator/health/**:
122 get:
Bartosz Gardziejewski73331082020-02-25 10:50:55 +0100123 tags:
124 - Actuator
Bartosz Gardziejewski08558462020-03-10 16:05:09 +0100125 summary: Actuator web endpoint 'health-path'
126 operationId: handle_1
Bartosz Gardziejewski73331082020-02-25 10:50:55 +0100127 responses:
Bartosz Gardziejewski08558462020-03-10 16:05:09 +0100128 "200":
129 description: default response
Bartosz Gardziejewski73331082020-02-25 10:50:55 +0100130 content: {}
Bartosz Gardziejewski08558462020-03-10 16:05:09 +0100131 /actuator:
132 get:
133 tags:
134 - Actuator
135 summary: Actuator root web endpoint
136 operationId: links_2
137 responses:
138 "200":
139 description: default response
Bartosz Gardziejewski73331082020-02-25 10:50:55 +0100140 content: {}
Bartosz Gardziejewski08558462020-03-10 16:05:09 +0100141components:
142 schemas:
143 ErrorResponseModel:
144 type: object
145 properties:
146 errorMessage:
147 type: string
148 CertificationModel:
149 type: object
150 properties:
151 certificateChain:
152 type: array
153 items:
154 type: string
155 trustedCertificates:
156 type: array
157 items:
158 type: string