-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathswagger.yml
347 lines (317 loc) · 10.4 KB
/
swagger.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
openapi: 3.0.0
info:
title: CyberChef API
description: A HTTP API that exposes some of CyberChef's functionality.
version: 1.1.0
paths:
/health:
get:
summary: Server healthcheck
tags:
- Health
description: >
If the server is up, returns a 200 response and some basic info about uptime
responses:
'200':
description: Server is alive and healthy
content:
application/json:
schema:
$ref: "#/components/schemas/HealthResponse"
example:
uptime: 1138.00
message: "OK"
timestamp: "Thu Dec 17 2017 19:23:54 GMT+0000"
'503':
description: Server error
content:
application/json:
schema:
$ref: "#/components/schemas/HealthResponse"
example:
uptime: 1138.00
message: "Internal Server Error: Not enough biscuits"
timestamp: "Thu Dec 19 2019 19:23:54 GMT+0000"
/bake:
post:
summary: Bakes a recipe
tags:
- Single Operations
description: >
Bake a recipe defined in JSON. For an example JSON recipe, build a recipe on
[CyberChef](https://gchq.github.io/CyberChef/) and click save. Select "clean JSON".
The Recipe property in the payload is designed so that you only need to provide
arguments for operations if they are required, or you want to change them from the default.
For more information on accepted recipe formats, see the [bake section of the Node API docs](https://github.com/gchq/CyberChef/wiki/Node-API#bake)
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/SingleOpRecipe"
- $ref: "#/components/schemas/MultiOpRecipe"
example:
input: "some input"
recipe:
- op: toHex
- op: toBase64
- op: toBinary
args:
delimiter: "Comma"
responses:
'200':
description: Recipe baked successfully
content:
application/json:
schema:
$ref: "#/components/schemas/BakeResponse"
example:
type: "string"
value: "01001110,01111010,01001101,01100111,01001110,01101101,01011001,01100111,01001110,01101101,01010001,01100111,01001110,01101010,01010101,01100111,01001101,01101010,01000001,01100111,01001110,01101010,01101011,01100111,01001110,01101101,01010101,01100111,01001110,01111010,01000001,01100111,01001110,01111010,01010101,01100111,01001110,01111010,01010001,00111101"
'400':
description: Bad request
/magic:
post:
summary: Performs magic on some input
tags:
- Single Operations
description: >
Take some input data and optional arguments for the [Magic operation](https://github.com/gchq/CyberChef/wiki/Automatic-detection-of-encoded-data-using-CyberChef-Magic) and return JSON of results of automatic encoding detection of the inputted data.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/MagicInput"
example:
input: "WUagwsiae6mP8gNtCCLUFpCpCB26RmBDoDD8PacdAmzAzBVjkK2QstFXaKhpC6iUS7RHqXrJtFisoRSgoJ4whjm1arm864qaNq4RcfUmLHrcsAaZc5TXCYifNdgS83gDeejGX46gaiMyuBV6EskHt1scgJ88x2tNSotQDwbGY1mmCob2ARGFvCKYNqiN9ipMq1ZU1mgkdbNuGcb76aRtYWhCGUc8g93UJudhb8htsheZnwTpgqhx83SVJSZXMXUjJT2zmpC7uXWtumqokbdSi88YtkWDAc1Toouh2oH4D4ddmNKJWUDpMwmngUmK14xwmomccPQE9hM172APnSqwxdKQ172RkcAsysnmj5gGtRmVNNh2s359wr6mS2QRP"
args:
depth: 1
responses:
'200':
description: Magic operation ran successfully
content:
application/json:
schema:
$ref: "#/components/schemas/MagicResponse"
example:
type: 6
value:
- recipe:
- op: "From Base58"
args:
- "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
- false
data: "x^Ü^Í^ÒÑqÃ0\fCWá\b^ÉcKò8mâì?B\u001eA^ÊUûÕ»^ÜOb@\u0010^ÀxìÖ^Ƶö^Ûµ§µ»õ^Çõ]×ÃzÓwÓ\u0015äÛ1^Ý3-§µKõ^×0t=¼½õdë\u001cÄ^Ö^ØS\u0000uÁ\u001f´Pñõ³*^ÌppuÝÅ\u0003"
languageScores:
- lang: zh
score: 215110.97112616687
probability: 0
fileType: null
isUTF8: true
entropy: 5.6887987925007035
matchingOps:
- op: "From Base58"
pattern: {}
args:
- 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz
- false
useful: false
/batch/bake:
post:
summary: Bakes a batch of data with a recipe
tags:
- Batch Operations
description: >
Bake a recipe defined in JSON over an array of input data. To obtain a JSON-formatted recipe, build a recipe on
[CyberChef](https://gchq.github.io/CyberChef/) and click save. Select "clean JSON" and copy the output.
Input data must be in the form of an array. All items will be baked individually
and an individual result object provided for each in the response
The Recipe property in the payload is designed so that you only need to provide
arguments for operations if they are required, or you want to change them from the default.
For more information on accepted recipe formats, see the [bake section of the Node API docs](https://github.com/gchq/CyberChef/wiki/Node-API#bake)
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/SingleOpBatchRecipe"
- $ref: "#/components/schemas/MultiOpBatchRecipe"
example:
input: ["some input", "some more input"]
recipe:
- op: toHex
- op: toBase64
- op: toBinary
args:
delimiter: "Comma"
responses:
'200':
description: Inputs were syntactically valid, individual bakes may or may not have succeeded
content:
application/json:
schema:
$ref: "#/components/schemas/BatchBakeResponse"
example:
- type: "string"
value: "01001110"
success: true
- error: "Spline reticulation exception"
success: false
'400':
description: Bad request, most often a syntactically invalid recipe
components:
schemas:
SingleOpRecipe:
type: object
properties:
input:
type: string
example: "bake this"
recipe:
$ref: "#/components/schemas/Operation"
example:
op: "toHex"
MultiOpRecipe:
type: object
properties:
input:
type: string
example: "input for recipe"
recipe:
type: array
items:
$ref: "#/components/schemas/Operation"
Operation:
type: object
properties:
op:
type: string
args:
oneOf:
- $ref: "#/components/schemas/ArgArray"
- $ref: "#/components/schemas/ArgObject"
required:
- op
SingleOpBatchRecipe:
type: object
properties:
input:
type: object
example: "bake this"
recipe:
$ref: "#/components/schemas/Operation"
example:
op: "toHex"
MultiOpBatchRecipe:
type: object
properties:
input:
type: array
items: string
example: "input for recipe"
recipe:
type: array
items:
$ref: "#/components/schemas/Operation"
OperationArray:
type: array
items:
$ref: "#/components/schemas/Operation"
InputArray:
type: array
items:
type: string
BatchBakeResponse:
type: array
items:
oneOf:
- $ref: "#/components/schemas/SuccessfulBakeResult"
- $ref: "#/components/schemas/UnsuccessfulBakeResult"
SuccessfulBakeResult:
type: object
properties:
success:
type: boolean
value:
type: string
type:
type: string
UnsuccessfulBakeResult:
type: object
properties:
success:
type: boolean
error:
type: string
ArgArray:
type: array
items:
type: object
example:
- 16
- true
- false
ArgObject:
type: object
additionalProperties: true
example:
width: 16
upperCaseHex: true
includeFinalLength: false
BakeResponse:
type: object
properties:
type:
type: string
value:
oneOf:
- type: string
- type: number
MagicInput:
type: object
properties:
input: {}
args:
oneOf:
- $ref: "#/components/schemas/ArgArray"
- $ref: "#/components/schemas/ArgObject"
MagicResponse:
type: object
properties:
type:
type: integer
value:
type: array
items:
$ref: "#/components/schemas/MagicResponseItem"
MagicResponseItem:
type: object
properties:
recipe:
type: array
items:
type: object
data:
type: string
languageScores:
type: array
items:
type: object
matchingOps:
type: array
items:
type: object
useful:
type: boolean
HealthResponse:
type: object
properties:
uptime:
type: number
message:
type: string
timestamp:
type: string