@@ -171,6 +171,7 @@ type GRPCExtAuthService struct {
171171// +kubebuilder:validation:XValidation:message="backendRef or backendRefs needs to be set",rule="has(self.backendRef) || self.backendRefs.size() > 0"
172172// +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"
173173// +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"
174+ // +kubebuilder:validation:XValidation:message="only one of path or pathOverride can be specified",rule="!(has(self.path) && has(self.pathOverride))"
174175type HTTPExtAuthService struct {
175176 // Only Service kind is supported for now.
176177 BackendCluster `json:",inline"`
@@ -183,9 +184,19 @@ type HTTPExtAuthService struct {
183184 // For example, if the original request path is "/hello", and the path specified here is "/auth",
184185 // then the path of the authorization request will be "/auth/hello". If the path is not specified,
185186 // the path of the authorization request will be "/hello".
187+ // Only one of Path or PathOverride can be set.
186188 // +optional
187189 Path * string `json:"path,omitempty"`
188190
191+ // PathOverride replaces the original request path in the authorization request.
192+ // If set, the path will be overridden to this value during authorization.
193+ // For example, if the original request path is "/hello", and PathOverride is set to "/auth",
194+ // then the path of the authorization request will be "/auth".
195+ // Only one of Path or PathOverride can be set.
196+ //
197+ // +optional
198+ PathOverride * string `json:"pathOverride,omitempty"`
199+
189200 // HeadersToBackend are the authorization response headers that will be added
190201 // to the original client request before sending it to the backend server.
191202 // Note that coexisting headers will be overridden.
0 commit comments