Skip to content

Commit 07adceb

Browse files
committed
CEL for HTTP header values
Signed-off-by: Norwin Schnyder <[email protected]>
1 parent 3222422 commit 07adceb

File tree

5 files changed

+329
-54
lines changed

5 files changed

+329
-54
lines changed

apis/v1/httproute_types.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,14 @@ type HTTPHeaderMatch struct {
612612
Name HTTPHeaderName `json:"name"`
613613

614614
// Value is the value of HTTP Header to be matched.
615+
// <gateway:experimental:description>
616+
// Must consist of printable US-ASCII characters, optionally separated
617+
// by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
618+
// </gateway:experimental:description>
615619
//
616620
// +kubebuilder:validation:MinLength=1
617621
// +kubebuilder:validation:MaxLength=4096
622+
// <gateway:experimental:validation:XValidation:message="must only contain printable ASCII characters, optionally separated by single tabs or spaces",rule="self.matches('^[!-~]+([\\t ]?[!-~]+)*$')">
618623
Value string `json:"value"`
619624
}
620625

@@ -981,9 +986,14 @@ type HTTPHeader struct {
981986
Name HTTPHeaderName `json:"name"`
982987

983988
// Value is the value of HTTP Header to be matched.
989+
// <gateway:experimental:description>
990+
// Must consist of printable US-ASCII characters, optionally separated
991+
// by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
992+
// </gateway:experimental:description>
984993
//
985994
// +kubebuilder:validation:MinLength=1
986995
// +kubebuilder:validation:MaxLength=4096
996+
// <gateway:experimental:validation:XValidation:message="must only contain printable ASCII characters, optionally separated by single tabs or spaces",rule="self.matches('^[!-~]+([\\t ]?[!-~]+)*$')">
987997
Value string `json:"value"`
988998
}
989999

config/crd/experimental/gateway.networking.k8s.io_grpcroutes.yaml

Lines changed: 80 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)