@@ -10,12 +10,30 @@ mod prelude {
10
10
}
11
11
use self :: prelude:: * ;
12
12
#[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
13
+ pub struct GatewayAddress {
14
+ #[ serde( default , skip_serializing_if = "Option::is_none" , rename = "type" ) ]
15
+ pub r#type : Option < String > ,
16
+ pub value : String ,
17
+ }
18
+ #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
19
+ pub struct GatewayInfrastructureParametersRef {
20
+ pub group : String ,
21
+ pub kind : String ,
22
+ pub name : String ,
23
+ }
24
+ #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
25
+ pub struct Kind {
26
+ #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
27
+ pub group : Option < String > ,
28
+ pub kind : String ,
29
+ }
30
+ #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
13
31
pub struct HTTPHeader {
14
32
pub name : String ,
15
33
pub value : String ,
16
34
}
17
35
#[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
18
- pub struct MirrorBackendRef {
36
+ pub struct RequestMirrorRef {
19
37
#[ serde( default , skip_serializing_if = "Option::is_none" ) ]
20
38
pub group : Option < String > ,
21
39
#[ serde( default , skip_serializing_if = "Option::is_none" ) ]
@@ -27,18 +45,6 @@ pub struct MirrorBackendRef {
27
45
pub port : Option < i32 > ,
28
46
}
29
47
#[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
30
- pub struct Kind {
31
- #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
32
- pub group : Option < String > ,
33
- pub kind : String ,
34
- }
35
- #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
36
- pub struct GatewayAddress {
37
- #[ serde( default , skip_serializing_if = "Option::is_none" , rename = "type" ) ]
38
- pub r#type : Option < String > ,
39
- pub value : String ,
40
- }
41
- #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
42
48
pub struct RouteRef {
43
49
#[ serde( default , skip_serializing_if = "Option::is_none" ) ]
44
50
pub group : Option < String > ,
@@ -52,40 +58,6 @@ pub struct RouteRef {
52
58
#[ serde( default , skip_serializing_if = "Option::is_none" , rename = "sectionName" ) ]
53
59
pub section_name : Option < String > ,
54
60
}
55
- #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
56
- pub struct ExtensionBackendRef {
57
- pub group : String ,
58
- pub kind : String ,
59
- pub name : String ,
60
- }
61
- /// GRPCHeaderMatch describes how to select a gRPC route by matching gRPC request
62
- /// headers.
63
- #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , PartialEq ) ]
64
- pub enum HeaderMatchesType {
65
- Exact ,
66
- RegularExpression ,
67
- }
68
- /// Path defines parameters used to modify the path of the incoming request.
69
- /// The modified path is then used to construct the `Location` header. When
70
- /// empty, the request path is used as-is.
71
- ///
72
- /// Support: Extended
73
- #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , PartialEq ) ]
74
- pub enum HTTPPathType {
75
- ReplaceFullPath ,
76
- ReplacePrefixMatch ,
77
- }
78
- /// RequestRedirect defines a schema for a filter that responds to the
79
- /// request with an HTTP redirection.
80
- ///
81
- /// Support: Core
82
- #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , PartialEq ) ]
83
- pub enum RedirectStatusCode {
84
- #[ serde( rename = "301" ) ]
85
- r#_301,
86
- #[ serde( rename = "302" ) ]
87
- r#_302,
88
- }
89
61
/// HTTPRouteFilter defines processing steps that must be completed during the
90
62
/// request or response lifecycle. HTTPRouteFilters are meant as an extension
91
63
/// point to express processing that may be done in Gateway implementations. Some
@@ -102,17 +74,6 @@ pub enum HTTPFilterType {
102
74
UrlRewrite ,
103
75
ExtensionRef ,
104
76
}
105
- /// RequestRedirect defines a schema for a filter that responds to the
106
- /// request with an HTTP redirection.
107
- ///
108
- /// Support: Core
109
- #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , PartialEq ) ]
110
- pub enum HTTPRedirectScheme {
111
- #[ serde( rename = "http" ) ]
112
- Http ,
113
- #[ serde( rename = "https" ) ]
114
- Https ,
115
- }
116
77
/// GRPCRouteFilter defines processing steps that must be completed during the
117
78
/// request or response lifecycle. GRPCRouteFilters are meant as an extension
118
79
/// point to express processing that may be done in Gateway implementations. Some
@@ -126,17 +87,47 @@ pub enum GRPCFilterType {
126
87
RequestMirror ,
127
88
ExtensionRef ,
128
89
}
129
- #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
130
- pub struct ParentsRouteStatus {
131
- #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
132
- pub conditions : Option < Vec < Condition > > ,
133
- #[ serde( rename = "controllerName" ) ]
134
- pub controller_name : String ,
135
- #[ serde( rename = "parentRef" ) ]
136
- pub parent_ref : RouteRef ,
90
+ /// RequestRedirect defines a schema for a filter that responds to the
91
+ /// request with an HTTP redirection.
92
+ ///
93
+ /// Support: Core
94
+ #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , PartialEq ) ]
95
+ pub enum RequestRedirectScheme {
96
+ #[ serde( rename = "http" ) ]
97
+ Http ,
98
+ #[ serde( rename = "https" ) ]
99
+ Https ,
100
+ }
101
+ /// GRPCHeaderMatch describes how to select a gRPC route by matching gRPC request
102
+ /// headers.
103
+ #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , PartialEq ) ]
104
+ pub enum HeaderMatchType {
105
+ Exact ,
106
+ RegularExpression ,
107
+ }
108
+ /// Path defines parameters used to modify the path of the incoming request.
109
+ /// The modified path is then used to construct the `Location` header. When
110
+ /// empty, the request path is used as-is.
111
+ ///
112
+ /// Support: Extended
113
+ #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , PartialEq ) ]
114
+ pub enum RequestOperationType {
115
+ ReplaceFullPath ,
116
+ ReplacePrefixMatch ,
117
+ }
118
+ /// RequestRedirect defines a schema for a filter that responds to the
119
+ /// request with an HTTP redirection.
120
+ ///
121
+ /// Support: Core
122
+ #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , PartialEq ) ]
123
+ pub enum RedirectStatusCode {
124
+ #[ serde( rename = "301" ) ]
125
+ r#_301,
126
+ #[ serde( rename = "302" ) ]
127
+ r#_302,
137
128
}
138
129
#[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
139
- pub struct HTTPPathModifier {
130
+ pub struct RequestRedirectPath {
140
131
#[ serde(
141
132
default ,
142
133
skip_serializing_if = "Option::is_none" ,
@@ -150,54 +141,74 @@ pub struct HTTPPathModifier {
150
141
) ]
151
142
pub replace_prefix_match : Option < String > ,
152
143
#[ serde( rename = "type" ) ]
153
- pub r#type : HTTPPathType ,
144
+ pub r#type : RequestOperationType ,
154
145
}
155
146
#[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
156
- pub struct HeaderModifier {
157
- #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
158
- pub add : Option < Vec < HTTPHeader > > ,
159
- #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
160
- pub remove : Option < Vec < String > > ,
161
- #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
162
- pub set : Option < Vec < HTTPHeader > > ,
147
+ pub struct MatchingHeaders {
148
+ pub name : String ,
149
+ #[ serde( default , skip_serializing_if = "Option::is_none" , rename = "type" ) ]
150
+ pub r#type : Option < HeaderMatchType > ,
151
+ pub value : String ,
163
152
}
164
153
#[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
165
- pub struct RequestMirrorModifier {
154
+ pub struct RequestMirror {
166
155
#[ serde( rename = "backendRef" ) ]
167
- pub backend_ref : MirrorBackendRef ,
156
+ pub backend_ref : RequestMirrorRef ,
168
157
}
169
158
#[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
170
- pub struct HTTPRequestRewrite {
159
+ pub struct ParentRouteStatus {
171
160
#[ serde( default , skip_serializing_if = "Option::is_none" ) ]
172
- pub hostname : Option < String > ,
161
+ pub conditions : Option < Vec < Condition > > ,
162
+ #[ serde( rename = "controllerName" ) ]
163
+ pub controller_name : String ,
164
+ #[ serde( rename = "parentRef" ) ]
165
+ pub parent_ref : RouteRef ,
166
+ }
167
+ #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
168
+ pub struct HeaderModifier {
173
169
#[ serde( default , skip_serializing_if = "Option::is_none" ) ]
174
- pub path : Option < HTTPPathModifier > ,
170
+ pub add : Option < Vec < HTTPHeader > > ,
171
+ #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
172
+ pub remove : Option < Vec < String > > ,
173
+ #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
174
+ pub set : Option < Vec < HTTPHeader > > ,
175
175
}
176
176
#[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
177
- pub struct HTTPRequestRedirect {
177
+ pub struct HTTPRouteRequestRedirect {
178
178
#[ serde( default , skip_serializing_if = "Option::is_none" ) ]
179
179
pub hostname : Option < String > ,
180
180
#[ serde( default , skip_serializing_if = "Option::is_none" ) ]
181
- pub path : Option < HTTPPathModifier > ,
181
+ pub path : Option < RequestRedirectPath > ,
182
182
#[ serde( default , skip_serializing_if = "Option::is_none" ) ]
183
183
pub port : Option < i32 > ,
184
184
#[ serde( default , skip_serializing_if = "Option::is_none" ) ]
185
- pub scheme : Option < HTTPRedirectScheme > ,
185
+ pub scheme : Option < RequestRedirectScheme > ,
186
186
#[ serde( default , skip_serializing_if = "Option::is_none" , rename = "statusCode" ) ]
187
187
pub status_code : Option < i64 > ,
188
188
}
189
189
#[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
190
+ pub struct RouteStatus {
191
+ pub parents : Vec < ParentRouteStatus > ,
192
+ }
193
+ #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
194
+ pub struct HTTPRouteUrlRewrite {
195
+ #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
196
+ pub hostname : Option < String > ,
197
+ #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
198
+ pub path : Option < RequestRedirectPath > ,
199
+ }
200
+ #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
190
201
pub struct GRPCRouteFilter {
191
202
#[ serde( default , skip_serializing_if = "Option::is_none" , rename = "extensionRef" ) ]
192
- pub extension_ref : Option < ExtensionBackendRef > ,
203
+ pub extension_ref : Option < GatewayInfrastructureParametersRef > ,
193
204
#[ serde(
194
205
default ,
195
206
skip_serializing_if = "Option::is_none" ,
196
207
rename = "requestHeaderModifier"
197
208
) ]
198
209
pub request_header_modifier : Option < HeaderModifier > ,
199
210
#[ serde( default , skip_serializing_if = "Option::is_none" , rename = "requestMirror" ) ]
200
- pub request_mirror : Option < RequestMirrorModifier > ,
211
+ pub request_mirror : Option < RequestMirror > ,
201
212
#[ serde(
202
213
default ,
203
214
skip_serializing_if = "Option::is_none" ,
@@ -211,32 +222,3 @@ pub struct GRPCRouteFilter {
211
222
212
223
// Next attempt
213
224
214
- #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema , Default , PartialEq ) ]
215
- pub struct HTTPRouteFilter {
216
- #[ serde( default , skip_serializing_if = "Option::is_none" , rename = "extensionRef" ) ]
217
- pub extension_ref : Option < ExtensionBackendRef > ,
218
- #[ serde(
219
- default ,
220
- skip_serializing_if = "Option::is_none" ,
221
- rename = "requestHeaderModifier"
222
- ) ]
223
- pub request_header_modifier : Option < HeaderModifier > ,
224
- #[ serde( default , skip_serializing_if = "Option::is_none" , rename = "requestMirror" ) ]
225
- pub request_mirror : Option < RequestMirrorModifier > ,
226
- #[ serde(
227
- default ,
228
- skip_serializing_if = "Option::is_none" ,
229
- rename = "requestRedirect"
230
- ) ]
231
- pub request_redirect : Option < HTTPRequestRedirect > ,
232
- #[ serde(
233
- default ,
234
- skip_serializing_if = "Option::is_none" ,
235
- rename = "responseHeaderModifier"
236
- ) ]
237
- pub response_header_modifier : Option < HeaderModifier > ,
238
- #[ serde( rename = "type" ) ]
239
- pub r#type : HTTPFilterType ,
240
- #[ serde( default , skip_serializing_if = "Option::is_none" , rename = "urlRewrite" ) ]
241
- pub url_rewrite : Option < HTTPRequestRewrite > ,
242
- }
0 commit comments