@@ -148,6 +148,7 @@ type GRPCExtAuthService struct {
148148// +kubebuilder:validation:XValidation:message="backendRef or backendRefs needs to be set",rule="has(self.backendRef) || self.backendRefs.size() > 0"
149149// +kubebuilder:validation:XValidation:message="BackendRefs only supports Service, ServiceImport, and Backend kind.",rule="has(self.backendRefs) ? self.backendRefs.all(f, f.kind == 'Service' || f.kind == 'ServiceImport' || f.kind == 'Backend') : true"
150150// +kubebuilder:validation:XValidation:message="BackendRefs only supports Core, multicluster.x-k8s.io, and gateway.envoyproxy.io groups.",rule="has(self.backendRefs) ? (self.backendRefs.all(f, f.group == \"\" || f.group == 'multicluster.x-k8s.io' || f.group == 'gateway.envoyproxy.io')) : true"
151+ // +kubebuilder:validation:XValidation:message="only one of path or pathOverride can be specified",rule="!(has(self.path) && has(self.pathOverride))"
151152type HTTPExtAuthService struct {
152153 // Only Service kind is supported for now.
153154 BackendCluster `json:",inline"`
@@ -160,9 +161,19 @@ type HTTPExtAuthService struct {
160161 // For example, if the original request path is "/hello", and the path specified here is "/auth",
161162 // then the path of the authorization request will be "/auth/hello". If the path is not specified,
162163 // the path of the authorization request will be "/hello".
164+ // Only one of Path or PathOverride can be set.
163165 // +optional
164166 Path * string `json:"path,omitempty"`
165167
168+ // PathOverride replaces the original request path in the authorization request.
169+ // If set, the path will be overridden to this value during authorization.
170+ // For example, if the original request path is "/hello", and PathOverride is set to "/auth",
171+ // then the path of the authorization request will be "/auth".
172+ // Only one of Path or PathOverride can be set.
173+ //
174+ // +optional
175+ PathOverride * string `json:"pathOverride,omitempty"`
176+
166177 // HeadersToBackend are the authorization response headers that will be added
167178 // to the original client request before sending it to the backend server.
168179 // Note that coexisting headers will be overridden.
0 commit comments