@@ -51,7 +51,6 @@ import (
5151 "google.golang.org/protobuf/types/known/anypb"
5252 "google.golang.org/protobuf/types/known/structpb"
5353
54- v3corepb "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
5554 v3procfilterpb "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3"
5655 v3procservicegrpc "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3"
5756 v3procservicepb "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3"
@@ -110,15 +109,6 @@ func validateBodyProcessingMode(mode *v3procfilterpb.ProcessingMode) error {
110109 return nil
111110}
112111
113- // parseGRPCService parses the GrpcService proto identifying the external
114- // processor server. The gRFC A102 trust policy — honoring the proto's
115- // credentials only when the delivering xDS management server is trusted, and
116- // requiring an untrusted server's target to be present in the bootstrap
117- // allowed_grpc_services map — is applied by grpcservice.Parse.
118- func parseGRPCService (gs * v3corepb.GrpcService , opts httpfilter.ParseOptions ) (* grpcservice.Config , error ) {
119- return grpcservice .Parse (gs , opts .BootstrapConfig , opts .ServerConfig )
120- }
121-
122112// ParseFilterConfig parses the provided filter configuration. The GrpcService
123113// identifying the external processor server is validated against the provided
124114// parse options, as per gRFC A102.
@@ -168,7 +158,7 @@ func (builder) ParseFilterConfig(cfg proto.Message, opts httpfilter.ParseOptions
168158 if msg .GetGrpcService () == nil {
169159 return nil , fmt .Errorf ("extproc: empty grpc_service provided in config %v" , cfg )
170160 }
171- server , err := parseGRPCService (msg .GetGrpcService (), opts )
161+ server , err := grpcservice . Parse (msg .GetGrpcService (), opts . BootstrapConfig , opts . ServerConfig )
172162 if err != nil {
173163 return nil , fmt .Errorf ("extproc: failed to parse grpc_service: %v" , err )
174164 }
@@ -218,8 +208,8 @@ func (builder) ParseFilterConfigOverride(ov proto.Message, opts httpfilter.Parse
218208 // Parse the GrpcService last, so that no error path can drop the built
219209 // credentials: the caller owns them from here on.
220210 var serverOpt optional.Optional [* grpcservice.Config ]
221- if override .GetGrpcService () != nil {
222- server , err := parseGRPCService ( override . GetGrpcService () , opts )
211+ if gs := override .GetGrpcService (); gs != nil {
212+ server , err := grpcservice . Parse ( gs , opts . BootstrapConfig , opts . ServerConfig )
223213 if err != nil {
224214 return nil , fmt .Errorf ("extproc: failed to parse grpc_service: %v" , err )
225215 }
0 commit comments