forked from gchq/CyberChef-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yml
102 lines (92 loc) · 2.56 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
openapi: 3.0.0
info:
title: CyberChef API
description: Some API
version: 1.0.0
paths:
/bake:
post:
summary: Bakes a recipe
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:
type: "string"
example: "62 61 6b 65 20 73 6f 6d 65 74 68 69 6e 67"
'400':
description: Bad request
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
required: true
args:
oneOf:
- $ref: "#/components/schemas/ArgArray"
- $ref: "#/components/schemas/ArgObject"
OperationArray:
type: array
items:
$ref: "#/components/schemas/Operation"
ArgArray:
type: array
items:
type: {}
example:
- 16
- true
- false
ArgObject:
type: object
additionalProperties: true
example:
width: 16
upperCaseHex: true
includeFinalLength: false