@@ -270,6 +270,23 @@ const (
270
270
HeaderMatchImplementationSpecific HeaderMatchType = "ImplementationSpecific"
271
271
)
272
272
273
+ // QueryParamMatchType specifies the semantics of how HTTP query parameter
274
+ // values should be compared. Valid QueryParamMatchType values are:
275
+ //
276
+ // * "Exact"
277
+ // * "RegularExpression"
278
+ // * "ImplementationSpecific"
279
+ //
280
+ // +kubebuilder:validation:Enum=Exact;RegularExpression;ImplementationSpecific
281
+ type QueryParamMatchType string
282
+
283
+ // QueryParamMatchType constants.
284
+ const (
285
+ QueryParamMatchExact QueryParamMatchType = "Exact"
286
+ QueryParamMatchRegularExpression QueryParamMatchType = "RegularExpression"
287
+ QueryParamMatchImplementationSpecific QueryParamMatchType = "ImplementationSpecific"
288
+ )
289
+
273
290
// HTTPPathMatch describes how to select a HTTP route by matching the HTTP request path.
274
291
type HTTPPathMatch struct {
275
292
// Type specifies how to match against the path Value.
@@ -326,6 +343,38 @@ type HTTPHeaderMatch struct {
326
343
Values map [string ]string `json:"values"`
327
344
}
328
345
346
+ // HTTPQueryParamMatch describes how to select a HTTP route by matching HTTP
347
+ // query parameters.
348
+ type HTTPQueryParamMatch struct {
349
+ // Type specifies how to match against the value of the query parameter.
350
+ //
351
+ // Support: Extended (Exact)
352
+ //
353
+ // Support: Custom (RegularExpression, ImplementationSpecific)
354
+ //
355
+ // Since RegularExpression QueryParamMatchType has custom conformance,
356
+ // implementations can support POSIX, PCRE or any other dialects of regular
357
+ // expressions. Please read the implementation's documentation to determine
358
+ // the supported dialect.
359
+ //
360
+ // HTTP query parameter matching MUST be case-sensitive for both keys and
361
+ // values.
362
+ //
363
+ // +optional
364
+ // +kubebuilder:default=Exact
365
+ Type * QueryParamMatchType `json:"type,omitempty"`
366
+
367
+ // Values is a map of HTTP query parameters to be matched. It MUST contain
368
+ // at least one entry.
369
+ //
370
+ // The query parameter name to match is the map key, and the value of the
371
+ // query parameter is the map value.
372
+ //
373
+ // Multiple match values are ANDed together, meaning, a request must match
374
+ // all the specified query parameters to select the route.
375
+ Values map [string ]string `json:"values"`
376
+ }
377
+
329
378
// HTTPRouteMatch defines the predicate used to match requests to a given
330
379
// action. Multiple match types are ANDed together, i.e. the match will
331
380
// evaluate to true only if all conditions are satisfied.
@@ -354,6 +403,11 @@ type HTTPRouteMatch struct {
354
403
// +optional
355
404
Headers * HTTPHeaderMatch `json:"headers,omitempty"`
356
405
406
+ // QueryParams specifies a HTTP query parameter matcher.
407
+ //
408
+ // +optional
409
+ QueryParams * HTTPQueryParamMatch `json:"queryParams,omitempty"`
410
+
357
411
// ExtensionRef is an optional, implementation-specific extension to the
358
412
// "match" behavior. For example, resource "myroutematcher" in group
359
413
// "networking.acme.io". If the referent cannot be found, the rule is not
0 commit comments