-
Notifications
You must be signed in to change notification settings - Fork 1
/
swagger.yaml
executable file
·178 lines (176 loc) · 4.51 KB
/
swagger.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
swagger: "2.0"
info:
version: "0.0.5"
title: curl2shell.io
host: curl2shell.io
basePath: /v1
schemes:
- http
- https
consumes:
- application/json
produces:
- application/json
x-a127-config: {}
x-a127-services: {}
paths:
/command:
x-swagger-router-controller: commands
x-a127-apply: {}
get:
description: Returns a random command to the user
operationId: getRandomCommand
parameters:
- name: category
in: query
description: What categor(ies) of commands to consider
required: false
type: string
- name: shell
in: query
description: Which shell(s) to consider for commands
required: false
type: string
- name: risk
in: query
description: Which risk level(s) to consider for commands
required: false
type: string
- name: count
in: query
description: Which risk level(s) to consider for commands
required: false
type: integer
responses:
"200":
description: Success
schema:
$ref: "#/definitions/CommandResponse"
default:
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
/command/risk/{risk}:
x-swagger-router-controller: commands
x-a127-apply: {}
get:
description: Returns all commands with risk {risk} to the user
operationId: getCommandsByRisk
parameters:
- name: risk
in: path
description: The risk of the commands to return
required: true
type: string
- name: count
in: query
description: The max number of commands to return
required: false
type: integer
default: 0
minimum: 0
responses:
200:
description: Success
schema:
$ref: "#/definitions/CommandResponse"
default:
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
/command/category/{category}:
x-swagger-router-controller: commands
x-a127-apply: {}
get:
description: Returns all commands with category {category} to the user
operationId: getCommandsByCategory
parameters:
- name: category
in: path
description: The category of the commands to return
required: true
type: string
- name: count
in: query
description: The max number of commands to return
required: false
type: integer
default: 0
minimum: 0
responses:
200:
description: Success
schema:
$ref: "#/definitions/CommandResponse"
default:
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
/command/{id}:
x-swagger-router-controller: commands
x-a127-apply: {}
get:
description: Returns the command with {id} to the user
operationId: getCommandById
parameters:
- name: id
in: path
description: The Id of the command to return
required: true
type: integer
responses:
200:
description: Success
schema:
$ref: "#/definitions/Command"
default:
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
definitions:
CommandResponse:
required:
- commands
properties:
commands:
type: array
items:
$ref: "#/definitions/Command"
ErrorResponse:
required:
- message
properties:
message:
type: string
Command:
type: object
required:
- id
- shortName
- shell
- risk
- category
- command
properties:
id:
type: integer
shortName:
type: string
example: echoHello
description: A short identifier for the command
shell:
type: string
example: bash
description: Which shell the command was designed for
risk:
type: string
example: low
description: How great a risk the command poses to a system
category:
type: string
example: fun
description: A broad categorization of the command
command:
type: string
example: echo 'hello world'
description: The actual command to execute