-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
241 lines (234 loc) · 6.1 KB
/
openapi.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
openapi: 3.0.0
info:
title: API Conformance Scan Jobs Manager for Kubernetes
description: >
API Conformance Scan Jobs Manager provides a convenient way
to run 42Crunch API Conformance Scan on-premises as a Kubernetes Job
in your Kubernetes cluster.
version: 1.0.0
x-42c-no-authentication: true
servers:
- description: Local server
url: http://localhost:8090/
paths:
/api/job:
get:
description: Get status of all jobs
operationId: ListJobs
tags:
- jobs
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Jobs"
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
post:
description: Create a new job
operationId: CreateJob
tags:
- jobs
requestBody:
content:
application/json:
examples:
simple:
value:
token: 00000000-0000-0000-0000-000000000000
extended:
value:
token: 00000000-0000-0000-0000-000000000000
name: scand-foo
expirationTime: 777
platformService: protection.dev.42crunch.com:8001
scandImage: 42crunch/scand-agent:latest
env:
SECURITY_FOO: bar
SECURITY_BAZ: bam
schema:
$ref: "#/components/schemas/JobSpec"
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/JobStatus"
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/api/job/{name}:
get:
description: Read job status
operationId: GetJob
tags:
- jobs
parameters:
- in: path
required: true
name: name
schema:
$ref: "#/components/schemas/JobName"
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/JobStatus"
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
delete:
description: Delete job
operationId: DeleteJob
tags:
- jobs
parameters:
- in: path
required: true
name: name
schema:
$ref: "#/components/schemas/JobName"
responses:
"200":
description: OK
content:
application/json:
examples:
success:
value:
name: scand-48340c78-a76c-475f-aa4a-36fc834b3c02
status: deleted
schema:
$ref: "#/components/schemas/JobStatus"
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/api/logs/{name}:
get:
description: Read job logs
operationId: GetLogs
tags:
- logs
parameters:
- in: path
required: true
name: name
schema:
$ref: "#/components/schemas/JobName"
responses:
"200":
description: OK
content:
text/plain:
schema:
type: string
minLength: 0
maxLength: 104857600
"400":
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
schemas:
JobName:
type: string
pattern: ^scand-[0-9a-zA-Z-]{1,36}$
maxLength: 42
minLength: 7
Jobs:
type: object
properties:
jobs:
type: array
items:
$ref: "#/components/schemas/JobStatus"
maxItems: 1024
additionalProperties: false
JobSpec:
type: object
properties:
token:
description: On-premises scan token
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
maxLength: 36
minLength: 36
name:
$ref: "#/components/schemas/JobName"
expirationTime:
description: Expiration time for a job (in seconds)
type: integer
maximum: 604800
minimum: 0
format: int32
platformService:
description: Hostname and port for connecting to 42 Crunch Platform
type: string
pattern: ^\P{Cc}+$
maxLength: 128
minLength: 3
scandImage:
description: Docker image for scand-agent
type: string
pattern: ^\P{Cc}+$
maxLength: 128
minLength: 1
env:
description: Environment variables for scand-agent (must start with 'SECURITY_, SCAN42C_, or set HTTP proxies)
type: object
additionalProperties:
type: string
pattern: ^\P{Cc}+$
minLength: 0
maxLength: 512
additionalProperties: false
required:
- token
JobStatus:
type: object
properties:
name:
$ref: "#/components/schemas/JobName"
status:
type: string
enum:
- started
- active
- succeeded
- failed
- unknown
additionalProperties: false
required:
- name
- status
Error:
type: object
properties:
error:
type: string
maxLength: 1024
minLength: 1
pattern: ^\P{Cc}+$
additionalProperties: false
required:
- error