-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathschema.json
More file actions
213 lines (213 loc) · 6.16 KB
/
schema.json
File metadata and controls
213 lines (213 loc) · 6.16 KB
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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/Semior001/groxy/pkg/discovery/fileprovider/config",
"$ref": "#/$defs/Config",
"$defs": {
"Config": {
"properties": {
"version": {
"type": "string",
"title": "Config Version",
"description": "The version of the config schema."
},
"not-matched": {
"$ref": "#/$defs/Respond",
"title": "Default Response",
"description": "The default response to return when no rules match."
},
"rules": {
"items": {
"$ref": "#/$defs/Rule"
},
"type": "array",
"title": "Rules",
"description": "A list of rules to match incoming requests against."
},
"upstreams": {
"additionalProperties": {
"$ref": "#/$defs/Upstream"
},
"type": "object",
"title": "Upstreams",
"description": "A map of upstream services that can be forwarded to."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"version",
"rules"
]
},
"Forward": {
"properties": {
"rewrite": {
"type": "string",
"title": "Rewrite",
"description": "An optional URI to rewrite the request to when forwarding. Uses regexp replace syntax."
},
"upstream": {
"type": "string",
"title": "Upstream",
"description": "The name of the upstream service to forward the request to."
},
"header": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"title": "Header",
"description": "A map of headers to add to the request when forwarding."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"upstream"
]
},
"Respond": {
"properties": {
"wait": {
"type": "string",
"title": "Wait",
"description": "An optional duration to wait before sending the response."
},
"body": {
"type": "string",
"title": "Body",
"description": "The body to include in the response."
},
"metadata": {
"properties": {
"header": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"title": "Header",
"description": "A map of headers to include in the response."
},
"trailer": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"title": "Trailer",
"description": "A map of trailers to include in the response."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"header",
"trailer"
],
"title": "Metadata",
"description": "Additional metadata to include in the response."
},
"status": {
"properties": {
"code": {
"type": "string",
"title": "Code",
"description": "The gRPC status code to include in the response."
},
"message": {
"type": "string",
"title": "Message",
"description": "The gRPC status message to include in the response."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"code",
"message"
],
"title": "Status",
"description": "The gRPC status to include in the response. Mutually exclusive with 'body'."
}
},
"additionalProperties": false,
"type": "object"
},
"Rule": {
"properties": {
"match": {
"properties": {
"uri": {
"type": "string",
"title": "URI",
"description": "The URI to match against."
},
"header": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"title": "Header",
"description": "A map of headers to match against."
},
"body": {
"type": "string",
"title": "Body",
"description": "The body to match against."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"uri"
],
"title": "Match",
"description": "The criteria to match incoming requests against."
},
"respond": {
"$ref": "#/$defs/Respond",
"title": "Respond",
"description": "How to respond to the request if it matches. Mutually exclusive with 'forward'."
},
"forward": {
"$ref": "#/$defs/Forward",
"title": "Forward",
"description": "How to forward the request if it matches. Mutually exclusive with 'respond'."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"match"
]
},
"Upstream": {
"properties": {
"address": {
"type": "string",
"title": "Address",
"description": "The address of the upstream service"
},
"tls": {
"type": "boolean",
"title": "TLS",
"description": "Whether to use TLS when connecting to the upstream service."
},
"serve-reflection": {
"type": "boolean",
"title": "Serve Reflection",
"description": "Whether to include the reflection from the upstream service."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"address",
"tls",
"serve-reflection"
]
}
},
"type": "object",
"title": "gRoxy Configuration Schema",
"description": "JSON schema for gRoxy proxy configuration files"
}