-
Notifications
You must be signed in to change notification settings - Fork 35
/
gateleen_hooking_schema_hook
193 lines (193 loc) · 4.4 KB
/
gateleen_hooking_schema_hook
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
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Hook",
"properties": {
"methods": {
"type": "array",
"items": {
"type": "string",
"enum": [
"OPTIONS",
"GET",
"HEAD",
"POST",
"PUT",
"DELETE",
"PATCH"
]
}
},
"filter": {
"type": "string"
},
"staticHeaders": {
"type": "object",
"additionalProperties": {
"description": "we should only accept string - but for backward compatibility we must also accept other types (which are converted to stings in HookHandler)",
"type": ["string", "boolean", "number", "integer"]
}
},
"headers": {
"description": "Manipulate (set / remove / replace) request headers - option to reference other header vales",
"type": "array",
"items": {
"$ref": "#/definitions/HeaderFunction"
}
},
"headersFilter": {
"description": "Also filter requests based on header values (besides url and http methods). RegEx can be used to define a filter",
"type": "string",
"minLength": 1
},
"destination": {
"type": "string"
},
"translateStatus": {
"description": "Mapping to transform backend HTTP status.",
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
"expireAfter": {
"description": "DEPRECATED - Hooks don't manipulate or set the x-expire-after header any more. Use HeaderFunctions instead",
"type": "integer",
"minimum": -1
},
"queueExpireAfter": {
"type": "integer",
"minimum": -1
},
"type": {
"type": "string",
"enum": [
"before",
"after"
]
},
"fullUrl": {
"type": "boolean"
},
"queueingStrategy": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"discardPayload",
"reducedPropagation"
]
},
"intervalMs": {
"type": "integer",
"minimum": 1
}
},
"additionalProperties": false
},
"connectionPoolSize": {
"description": "The maximum number of concurrent connections to the destination.",
"type": "integer",
"default": 50
},
"maxWaitQueueSize": {
"description": "The maximum number of requests allowed in the wait queue.",
"type": "integer",
"default": -1
},
"timeout": {
"description": "The request timeout applied in seconds.",
"type": "integer",
"default": 30
},
"collection": {
"description": "only used for route hook",
"type": "boolean"
},
"listable": {
"description": "only used for route hook",
"type": "boolean"
},
"proxyOptions": {
"description": "Custom proxy options for this rule (forwarding)",
"$ref": "#/definitions/ProxyOptions"
}
},
"additionalProperties": false,
"required": [
"destination"
],
"not": {
"title": "Disallows use of deprecated 'staticHeaders' and new 'headers' at the same time",
"description": "Disallows use of deprecated 'staticHeaders' and new 'headers' at the same time",
"anyOf": [
{
"required": [
"staticHeaders",
"headers"
]
}
]
},
"definitions": {
"HeaderFunction": {
"properties": {
"header": {
"description": "the request-header name to manupulate (set, remove or conditional set)",
"type": "string",
"minLength": 1
},
"value": {
"description": "the value to be set. null and empty string means 'remove the header'. value can contain other header names between single angular brackets which resolves to their values accordingly",
"type": [
"null",
"string"
]
},
"mode": {
"description": "define a condition-mode. 'complete' sets the header value only if this header is not yet present. 'overwrite' sets the header value only if the header is already present. Ignored if value is null or empty string",
"type": "string",
"enum": [
"complete",
"override"
]
}
},
"required": [
"header",
"value"
]
},
"ProxyOptions": {
"properties": {
"type": {
"type": "string",
"enum": [
"HTTP",
"SOCKS4",
"SOCKS5"
]
},
"host": {
"type": "string"
},
"port": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"username": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": [
"host",
"port"
],
"additionalProperties": false
}
}
}