From d81ad39685b70e19814b5cbc6f66cf8ee85b0944 Mon Sep 17 00:00:00 2001 From: pweiber Date: Wed, 14 Aug 2024 11:55:02 -0300 Subject: [PATCH 01/10] Adding eval, request and response for ext_proc --- envoyextproc/evaluation.go | 192 +++++++++++++++++ envoyextproc/request.go | 79 +++++++ envoyextproc/response.go | 425 +++++++++++++++++++++++++++++++++++++ 3 files changed, 696 insertions(+) create mode 100644 envoyextproc/evaluation.go create mode 100644 envoyextproc/request.go create mode 100644 envoyextproc/response.go diff --git a/envoyextproc/evaluation.go b/envoyextproc/evaluation.go new file mode 100644 index 000000000..9468291fc --- /dev/null +++ b/envoyextproc/evaluation.go @@ -0,0 +1,192 @@ +package envoyextproc + +import ( + "context" + "fmt" + "sync" + + "github.com/open-policy-agent/opa/ast" + "github.com/open-policy-agent/opa/bundle" + "github.com/open-policy-agent/opa/config" + "github.com/open-policy-agent/opa/logging" + "github.com/open-policy-agent/opa/metrics" + "github.com/open-policy-agent/opa/rego" + "github.com/open-policy-agent/opa/storage" + "github.com/open-policy-agent/opa/topdown/builtins" + iCache "github.com/open-policy-agent/opa/topdown/cache" + "github.com/open-policy-agent/opa/topdown/print" + "github.com/open-policy-agent/opa/tracing" +) + +// ExtProcEvalContext defines the interface for the evaluation context in the `ext_proc` context. +type ExtProcEvalContext interface { + ParsedQuery() ast.Body + Store() storage.Store + Compiler() *ast.Compiler + Runtime() *ast.Term + PreparedQueryDoOnce() *sync.Once + InterQueryBuiltinCache() iCache.InterQueryCache + PreparedQuery() *rego.PreparedEvalQuery + SetPreparedQuery(*rego.PreparedEvalQuery) + Logger() logging.Logger + Config() *config.Config + DistributedTracing() tracing.Options +} + +// ExtProcEval evaluates the input against the provided ExtProcEvalContext and yields a result. +func ExtProcEval(ctx context.Context, evalContext ExtProcEvalContext, input ast.Value, result *ExtProcEvalResult, opts ...func(*rego.Rego)) error { + var err error + logger := evalContext.Logger() + + // Log when starting the evaluation process + logger.Info("Starting ExtProcEval") + + if result.Txn == nil { + var txn storage.Transaction + var txnClose TransactionCloser + txn, txnClose, err = result.GetTxn(ctx, evalContext.Store()) + if err != nil { + logger.WithFields(map[string]interface{}{"err": err}).Error("Unable to start new storage transaction.") + return err + } + defer txnClose(ctx, err) + result.Txn = txn + logger.Info("Started new transaction") + } + + // Log before retrieving revision information + logger.Info("Getting revision information") + err = getRevision(ctx, evalContext.Store(), result.Txn, result) + if err != nil { + logger.Error(fmt.Sprintf("Failed to get revision information: %v", err)) + return err + } + + result.TxnID = result.Txn.ID() + + logger.WithFields(map[string]interface{}{ + "input": input, + "query": evalContext.ParsedQuery().String(), + "txn": result.TxnID, + }).Debug("Executing policy query") + + // Create a mock result set to simulate a policy evaluation result + mockResult := rego.ResultSet{ + { + Expressions: []*rego.ExpressionValue{ + { + Text: "mock_decision", + Value: "allowed", + }, + }, + }, + } + logger.Info("Using mock result set for policy evaluation") + rs := mockResult + + // Actual policy evaluation + /* + logger.Info("Constructing prepared query") + err = constructPreparedQuery(evalContext, result.Txn, result.Metrics, opts) + if err != nil { + logger.Error(fmt.Sprintf("Failed to construct prepared query: %v", err)) + return err + } + + ph := extProcHook{logger: logger.WithFields(map[string]interface{}{"decision-id": result.DecisionID})} + + var ndbCache builtins.NDBCache + if evalContext.Config().NDBuiltinCacheEnabled() { + ndbCache = builtins.NDBCache{} + } + + logger.Info("Evaluating policy with prepared query") + rs, err = evalContext.PreparedQuery().Eval( + ctx, + rego.EvalParsedInput(input), + rego.EvalTransaction(result.Txn), + rego.EvalMetrics(result.Metrics), + rego.EvalInterQueryBuiltinCache(evalContext.InterQueryBuiltinCache()), + rego.EvalPrintHook(&ph), + rego.EvalNDBuiltinCache(ndbCache), + ) + + if err != nil { + logger.Error(fmt.Sprintf("Error during policy evaluation: %v", err)) + return err + } + */ + + switch { + case err != nil: + return err + case len(rs) == 0: + return fmt.Errorf("undefined decision") + case len(rs) > 1: + return fmt.Errorf("multiple evaluation results") + } + + result.NDBuiltinCache = builtins.NDBCache{} + result.Decision = rs[0].Expressions[0].Value + + logger.Info(fmt.Sprintf("Final decision: %v", result.Decision)) + return nil +} + +// Constructing the prepared query +func constructPreparedQuery(evalContext ExtProcEvalContext, txn storage.Transaction, m metrics.Metrics, opts []func(*rego.Rego)) error { + var err error + var pq rego.PreparedEvalQuery + evalContext.PreparedQueryDoOnce().Do(func() { + opts = append(opts, + rego.Metrics(m), + rego.ParsedQuery(evalContext.ParsedQuery()), + rego.Compiler(evalContext.Compiler()), + rego.Store(evalContext.Store()), + rego.Transaction(txn), + rego.Runtime(evalContext.Runtime()), + rego.EnablePrintStatements(true), + rego.DistributedTracingOpts(evalContext.DistributedTracing()), + ) + + pq, err = rego.New(opts...).PrepareForEval(context.Background()) + evalContext.SetPreparedQuery(&pq) + }) + + return err +} + +func getRevision(ctx context.Context, store storage.Store, txn storage.Transaction, result *ExtProcEvalResult) error { + revisions := map[string]string{} + + names, err := bundle.ReadBundleNamesFromStore(ctx, store, txn) + if err != nil && !storage.IsNotFound(err) { + return err + } + + for _, name := range names { + r, err := bundle.ReadBundleRevisionFromStore(ctx, store, txn, name) + if err != nil && !storage.IsNotFound(err) { + return err + } + revisions[name] = r + } + + revision, err := bundle.LegacyReadRevisionFromStore(ctx, store, txn) + if err != nil && !storage.IsNotFound(err) { + return err + } + + result.Revisions = revisions + result.Revision = revision + return nil +} + +type extProcHook struct { + logger logging.Logger +} + +func (h *extProcHook) Print(pctx print.Context, msg string) error { + h.logger.Info("%v: %s", pctx.Location, msg) + return nil +} diff --git a/envoyextproc/request.go b/envoyextproc/request.go new file mode 100644 index 000000000..09b4e280f --- /dev/null +++ b/envoyextproc/request.go @@ -0,0 +1,79 @@ +package envoyextproc + +import ( + ext_proc_v3 "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" + "google.golang.org/grpc/codes" +) + +// ProcessRequestHeaders processes incoming request headers. +func ProcessRequestHeaders(headers *ext_proc_v3.HttpHeaders) (*ext_proc_v3.ProcessingResponse, error) { + return &ext_proc_v3.ProcessingResponse{ + Response: &ext_proc_v3.ProcessingResponse_RequestHeaders{ + RequestHeaders: &ext_proc_v3.HeadersResponse{}, + }, + }, nil +} + +// ProcessResponseHeaders processes incoming response headers. +func ProcessResponseHeaders(headers *ext_proc_v3.HttpHeaders) (*ext_proc_v3.ProcessingResponse, error) { + return &ext_proc_v3.ProcessingResponse{ + Response: &ext_proc_v3.ProcessingResponse_ResponseHeaders{ + ResponseHeaders: &ext_proc_v3.HeadersResponse{}, + }, + }, nil +} + +// ProcessRequestBody processes incoming request bodies. +func ProcessRequestBody(body *ext_proc_v3.HttpBody) (*ext_proc_v3.ProcessingResponse, error) { + return &ext_proc_v3.ProcessingResponse{ + Response: &ext_proc_v3.ProcessingResponse_RequestBody{ + RequestBody: &ext_proc_v3.BodyResponse{}, + }, + }, nil +} + +// ProcessResponseBody processes incoming response bodies. +func ProcessResponseBody(body *ext_proc_v3.HttpBody) (*ext_proc_v3.ProcessingResponse, error) { + return &ext_proc_v3.ProcessingResponse{ + Response: &ext_proc_v3.ProcessingResponse_ResponseBody{ + ResponseBody: &ext_proc_v3.BodyResponse{}, + }, + }, nil +} + +// ProcessRequestTrailers processes incoming request trailers. +func ProcessRequestTrailers(trailers *ext_proc_v3.HttpTrailers) (*ext_proc_v3.ProcessingResponse, error) { + return &ext_proc_v3.ProcessingResponse{ + Response: &ext_proc_v3.ProcessingResponse_RequestTrailers{ + RequestTrailers: &ext_proc_v3.TrailersResponse{}, + }, + }, nil +} + +// ProcessResponseTrailers processes incoming response trailers. +func ProcessResponseTrailers(trailers *ext_proc_v3.HttpTrailers) (*ext_proc_v3.ProcessingResponse, error) { + return &ext_proc_v3.ProcessingResponse{ + Response: &ext_proc_v3.ProcessingResponse_ResponseTrailers{ + ResponseTrailers: &ext_proc_v3.TrailersResponse{}, + }, + }, nil +} + +// Error represents an error with a code and a message. +type Error struct { + Code string `json:"code"` + Message string `json:"message"` +} + +// Error implements the error interface. +func (e *Error) Error() string { + return e.Message +} + +// internalError creates a new Error with the given code and message. +func internalError(code codes.Code, err error) *Error { + return &Error{ + Code: code.String(), + Message: err.Error(), + } +} diff --git a/envoyextproc/response.go b/envoyextproc/response.go new file mode 100644 index 000000000..1f29a0f96 --- /dev/null +++ b/envoyextproc/response.go @@ -0,0 +1,425 @@ +package envoyextproc + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + + ext_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + ext_type_v3 "github.com/envoyproxy/go-control-plane/envoy/type/v3" + _structpb "github.com/golang/protobuf/ptypes/struct" + "github.com/open-policy-agent/opa/metrics" + "github.com/open-policy-agent/opa/storage" + "github.com/open-policy-agent/opa/topdown/builtins" + "google.golang.org/protobuf/types/known/structpb" + + "github.com/open-policy-agent/opa-envoy-plugin/envoyauth" + "github.com/open-policy-agent/opa-envoy-plugin/internal/util" +) + +// ToEnvoyAuthEvalResult converts ExtProcEvalResult to envoyauth.EvalResult +func (r *ExtProcEvalResult) ToEnvoyAuthEvalResult() *envoyauth.EvalResult { + return &envoyauth.EvalResult{ + Revision: r.Revision, + Revisions: r.Revisions, + DecisionID: r.DecisionID, + TxnID: r.TxnID, + Decision: r.Decision, + Metrics: r.Metrics, + Txn: r.Txn, + NDBuiltinCache: r.NDBuiltinCache, + } +} + +// ExtProcEvalResult captures the result from evaluating a query against an input. +type ExtProcEvalResult struct { + Revision string // Deprecated: Use `revisions` instead. + Revisions map[string]string + DecisionID string + TxnID uint64 + Decision interface{} + Metrics metrics.Metrics + Txn storage.Transaction + NDBuiltinCache builtins.NDBCache +} + +// StopFunc should be called as soon as the evaluation is finished. +type StopFunc = func() + +// TransactionCloser should be called to abort the transaction. +type TransactionCloser func(ctx context.Context, err error) error + +// NewExtProcEvalResult creates a new ExtProcEvalResult and a StopFunc that is used to stop the timer for metrics. +func NewExtProcEvalResult(opts ...func(*ExtProcEvalResult)) (*ExtProcEvalResult, StopFunc, error) { + var err error + + er := &ExtProcEvalResult{ + Metrics: metrics.New(), + } + + for _, opt := range opts { + opt(er) + } + + if er.DecisionID == "" { + er.DecisionID, err = util.UUID4() + } + + if err != nil { + return nil, nil, err + } + + er.Metrics.Timer(metrics.ServerHandler).Start() + + stop := func() { + _ = er.Metrics.Timer(metrics.ServerHandler).Stop() + } + + return er, stop, nil +} + +// GetTxn creates a read transaction suitable for the configured ExtProcEvalResult object. +func (result *ExtProcEvalResult) GetTxn(ctx context.Context, store storage.Store) (storage.Transaction, TransactionCloser, error) { + params := storage.TransactionParams{} + + noopCloser := func(ctx context.Context, err error) error { + return nil // no-op default + } + + txn, err := store.NewTransaction(ctx, params) + if err != nil { + return nil, noopCloser, err + } + + // Setup a closer function that will abort the transaction. + closer := func(ctx context.Context, txnErr error) error { + store.Abort(ctx, txn) + result.Txn = nil + return nil + } + + return txn, closer, nil +} + +func (result *ExtProcEvalResult) invalidDecisionErr() error { + return fmt.Errorf("illegal value for policy evaluation result: %T", result.Decision) +} + +// IsAllowed returns whether the decision represents an "allow" depending on the decision structure. +// Returns an error if the decision structure is invalid. +func (result *ExtProcEvalResult) IsAllowed() (bool, error) { + switch decision := result.Decision.(type) { + case bool: + return decision, nil + case map[string]interface{}: + var val interface{} + var ok, allowed bool + + if val, ok = decision["allowed"]; !ok { + return false, fmt.Errorf("unable to determine evaluation result due to missing \"allowed\" key") + } + + if allowed, ok = val.(bool); !ok { + return false, fmt.Errorf("type assertion error, expected allowed to be of type 'boolean' but got '%T'", val) + } + + return allowed, nil + } + + return false, result.invalidDecisionErr() +} + +// GetRequestHTTPHeadersToRemove returns the HTTP headers to remove from the original request before dispatching it to the upstream. +func (result *ExtProcEvalResult) GetRequestHTTPHeadersToRemove() ([]string, error) { + headersToRemove := []string{} + + switch decision := result.Decision.(type) { + case bool: + return headersToRemove, nil + case map[string]interface{}: + var ok bool + var val interface{} + + if val, ok = decision["request_headers_to_remove"]; !ok { + return headersToRemove, nil + } + + switch val := val.(type) { + case []string: + return val, nil + case []interface{}: + for _, vval := range val { + header, ok := vval.(string) + if !ok { + return nil, fmt.Errorf("type assertion error, expected request_headers_to_remove value to be of type 'string' but got '%T'", vval) + } + + headersToRemove = append(headersToRemove, header) + } + return headersToRemove, nil + default: + return nil, fmt.Errorf("type assertion error, expected request_headers_to_remove to be of type '[]string' but got '%T'", val) + } + } + + return nil, result.invalidDecisionErr() +} + +// GetResponseHTTPHeaders returns the HTTP headers to return if they are part of the decision. +func (result *ExtProcEvalResult) GetResponseHTTPHeaders() (http.Header, error) { + var responseHeaders = make(http.Header) + + switch decision := result.Decision.(type) { + case bool: + return responseHeaders, nil + case map[string]interface{}: + var ok bool + var val interface{} + + if val, ok = decision["headers"]; !ok { + return responseHeaders, nil + } + + err := transformToHTTPHeaderFormat(val, &responseHeaders) + if err != nil { + return nil, err + } + + return responseHeaders, nil + } + + return nil, result.invalidDecisionErr() +} + +// GetResponseEnvoyHeaderValueOptions returns the HTTP headers to return if they are part of the decision as Envoy header value options. +func (result *ExtProcEvalResult) GetResponseEnvoyHeaderValueOptions() ([]*ext_core_v3.HeaderValueOption, error) { + headers, err := result.GetResponseHTTPHeaders() + if err != nil { + return nil, err + } + + return transformHTTPHeaderToEnvoyHeaderValueOption(headers) +} + +// GetResponseHTTPHeadersToAdd returns the HTTP headers to send to the downstream client. +func (result *ExtProcEvalResult) GetResponseHTTPHeadersToAdd() ([]*ext_core_v3.HeaderValueOption, error) { + var responseHeaders = make(http.Header) + + finalHeaders := []*ext_core_v3.HeaderValueOption{} + + switch decision := result.Decision.(type) { + case bool: + return finalHeaders, nil + case map[string]interface{}: + var ok bool + var val interface{} + + if val, ok = decision["response_headers_to_add"]; !ok { + return finalHeaders, nil + } + + err := transformToHTTPHeaderFormat(val, &responseHeaders) + if err != nil { + return nil, err + } + default: + return nil, result.invalidDecisionErr() + } + + return transformHTTPHeaderToEnvoyHeaderValueOption(responseHeaders) +} + +// HasResponseBody returns true if the decision defines a body (only true for structured decisions). +func (result *ExtProcEvalResult) HasResponseBody() bool { + decision, ok := result.Decision.(map[string]interface{}) + + if !ok { + return false + } + + _, ok = decision["body"] + + return ok +} + +// GetResponseBody returns the HTTP body to return if they are part of the decision. +func (result *ExtProcEvalResult) GetResponseBody() (string, error) { + var ok bool + var val interface{} + var body string + var decision map[string]interface{} + + if decision, ok = result.Decision.(map[string]interface{}); !ok { + return "", nil + } + + if val, ok = decision["body"]; !ok { + return "", nil + } + + if body, ok = val.(string); !ok { + return "", fmt.Errorf("type assertion error, expected body to be of type 'string' but got '%T'", val) + } + + return body, nil +} + +// GetResponseHTTPStatus returns the HTTP status to return if they are part of the decision. +func (result *ExtProcEvalResult) GetResponseHTTPStatus() (int, error) { + var ok bool + var val interface{} + var statusCode json.Number + + status := http.StatusForbidden + + switch decision := result.Decision.(type) { + case bool: + if decision { + return http.StatusOK, fmt.Errorf("HTTP status code undefined for simple 'allow'") + } + + return status, nil + case map[string]interface{}: + if val, ok = decision["http_status"]; !ok { + return status, nil + } + + if statusCode, ok = val.(json.Number); !ok { + return status, fmt.Errorf("type assertion error, expected http_status to be of type 'number' but got '%T'", val) + } + + httpStatusCode, err := statusCode.Int64() + if err != nil { + return status, fmt.Errorf("error converting JSON number to int: %v", err) + } + + if http.StatusText(int(httpStatusCode)) == "" { + return status, fmt.Errorf("Invalid HTTP status code %v", httpStatusCode) + } + + return int(httpStatusCode), nil + } + + return http.StatusForbidden, result.invalidDecisionErr() +} + +// GetDynamicMetadata returns the dynamic metadata to return if part of the decision. +func (result *ExtProcEvalResult) GetDynamicMetadata() (*_structpb.Struct, error) { + var ( + val interface{} + ok bool + ) + switch decision := result.Decision.(type) { + case bool: + if decision { + return nil, fmt.Errorf("dynamic metadata undefined for boolean decision") + } + case map[string]interface{}: + if val, ok = decision["dynamic_metadata"]; !ok { + return nil, nil + } + + metadata, ok := val.(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("type assertion error, expected dynamic_metadata to be of type 'object' but got '%T'", val) + } + + return structpb.NewStruct(metadata) + } + + return nil, nil +} + +// GetResponseEnvoyHTTPStatus returns the HTTP status to return if they are part of the decision. +func (result *ExtProcEvalResult) GetResponseEnvoyHTTPStatus() (*ext_type_v3.HttpStatus, error) { + status := &ext_type_v3.HttpStatus{ + Code: ext_type_v3.StatusCode(ext_type_v3.StatusCode_Forbidden), + } + + httpStatusCode, err := result.GetResponseHTTPStatus() + + if err != nil { + return nil, err + } + + // This check is partially redundant but might be more strict than http.StatusText(). + if _, ok := ext_type_v3.StatusCode_name[int32(httpStatusCode)]; !ok { + return nil, fmt.Errorf("Invalid HTTP status code %v", httpStatusCode) + } + + status.Code = ext_type_v3.StatusCode(int32(httpStatusCode)) + + return status, nil +} + +func transformToHTTPHeaderFormat(input interface{}, result *http.Header) error { + takeResponseHeaders := func(headers map[string]interface{}, targetHeaders *http.Header) error { + for key, value := range headers { + switch values := value.(type) { + case string: + targetHeaders.Add(key, values) + case []string: + for _, v := range values { + targetHeaders.Add(key, v) + } + case []interface{}: + for _, value := range values { + if headerVal, ok := value.(string); ok { + targetHeaders.Add(key, headerVal) + } else { + return fmt.Errorf("invalid value type for header '%s'", key) + } + } + default: + return fmt.Errorf("type assertion error for header '%s'", key) + } + } + return nil + } + + switch input := input.(type) { + case []interface{}: + for _, val := range input { + headers, ok := val.(map[string]interface{}) + if !ok { + return fmt.Errorf("type assertion error, expected headers to be of type 'object' but got '%T'", val) + } + + err := takeResponseHeaders(headers, result) + if err != nil { + return err + } + } + + case map[string]interface{}: + err := takeResponseHeaders(input, result) + if err != nil { + return err + } + + default: + return fmt.Errorf("type assertion error, expected headers to be of type 'object' but got '%T'", input) + } + + return nil +} + +func transformHTTPHeaderToEnvoyHeaderValueOption(headers http.Header) ([]*ext_core_v3.HeaderValueOption, error) { + responseHeaders := []*ext_core_v3.HeaderValueOption{} + + for key, values := range headers { + for idx := range values { + headerValue := &ext_core_v3.HeaderValue{ + Key: key, + Value: values[idx], + } + headerValueOption := &ext_core_v3.HeaderValueOption{ + Header: headerValue, + } + responseHeaders = append(responseHeaders, headerValueOption) + } + } + + return responseHeaders, nil +} From 1dea350e5a77185dc52b264590298f018e9b03f7 Mon Sep 17 00:00:00 2001 From: pweiber Date: Wed, 14 Aug 2024 11:55:48 -0300 Subject: [PATCH 02/10] Adding vendor files for the ext_proc --- .../mutation_rules/v3/mutation_rules.pb.go | 425 +++ .../v3/mutation_rules.pb.validate.go | 525 ++++ .../filters/http/ext_proc/v3/ext_proc.pb.go | 850 ++++++ .../http/ext_proc/v3/ext_proc.pb.validate.go | 870 ++++++ .../http/ext_proc/v3/processing_mode.pb.go | 409 +++ .../v3/processing_mode.pb.validate.go | 202 ++ .../ext_proc/v3/external_processor.pb.go | 1885 +++++++++++++ .../v3/external_processor.pb.validate.go | 2467 +++++++++++++++++ vendor/modules.txt | 3 + 9 files changed, 7636 insertions(+) create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.validate.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.validate.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.validate.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.validate.go diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.go new file mode 100644 index 000000000..2cbe78d16 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.go @@ -0,0 +1,425 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.23.4 +// source: envoy/config/common/mutation_rules/v3/mutation_rules.proto + +package mutation_rulesv3 + +import ( + _ "github.com/cncf/xds/go/udpa/annotations" + v31 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + v3 "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + wrappers "github.com/golang/protobuf/ptypes/wrappers" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The HeaderMutationRules structure specifies what headers may be +// manipulated by a processing filter. This set of rules makes it +// possible to control which modifications a filter may make. +// +// By default, an external processing server may add, modify, or remove +// any header except for an "Envoy internal" header (which is typically +// denoted by an x-envoy prefix) or specific headers that may affect +// further filter processing: +// +// * “host“ +// * “:authority“ +// * “:scheme“ +// * “:method“ +// +// Every attempt to add, change, append, or remove a header will be +// tested against the rules here. Disallowed header mutations will be +// ignored unless “disallow_is_error“ is set to true. +// +// Attempts to remove headers are further constrained -- regardless of the +// settings, system-defined headers (that start with “:“) and the “host“ +// header may never be removed. +// +// In addition, a counter will be incremented whenever a mutation is +// rejected. In the ext_proc filter, that counter is named +// “rejected_header_mutations“. +// [#next-free-field: 8] +type HeaderMutationRules struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // By default, certain headers that could affect processing of subsequent + // filters or request routing cannot be modified. These headers are + // “host“, “:authority“, “:scheme“, and “:method“. Setting this parameter + // to true allows these headers to be modified as well. + AllowAllRouting *wrappers.BoolValue `protobuf:"bytes,1,opt,name=allow_all_routing,json=allowAllRouting,proto3" json:"allow_all_routing,omitempty"` + // If true, allow modification of envoy internal headers. By default, these + // start with “x-envoy“ but this may be overridden in the “Bootstrap“ + // configuration using the + // :ref:`header_prefix ` + // field. Default is false. + AllowEnvoy *wrappers.BoolValue `protobuf:"bytes,2,opt,name=allow_envoy,json=allowEnvoy,proto3" json:"allow_envoy,omitempty"` + // If true, prevent modification of any system header, defined as a header + // that starts with a “:“ character, regardless of any other settings. + // A processing server may still override the “:status“ of an HTTP response + // using an “ImmediateResponse“ message. Default is false. + DisallowSystem *wrappers.BoolValue `protobuf:"bytes,3,opt,name=disallow_system,json=disallowSystem,proto3" json:"disallow_system,omitempty"` + // If true, prevent modifications of all header values, regardless of any + // other settings. A processing server may still override the “:status“ + // of an HTTP response using an “ImmediateResponse“ message. Default is false. + DisallowAll *wrappers.BoolValue `protobuf:"bytes,4,opt,name=disallow_all,json=disallowAll,proto3" json:"disallow_all,omitempty"` + // If set, specifically allow any header that matches this regular + // expression. This overrides all other settings except for + // “disallow_expression“. + AllowExpression *v3.RegexMatcher `protobuf:"bytes,5,opt,name=allow_expression,json=allowExpression,proto3" json:"allow_expression,omitempty"` + // If set, specifically disallow any header that matches this regular + // expression regardless of any other settings. + DisallowExpression *v3.RegexMatcher `protobuf:"bytes,6,opt,name=disallow_expression,json=disallowExpression,proto3" json:"disallow_expression,omitempty"` + // If true, and if the rules in this list cause a header mutation to be + // disallowed, then the filter using this configuration will terminate the + // request with a 500 error. In addition, regardless of the setting of this + // parameter, any attempt to set, add, or modify a disallowed header will + // cause the “rejected_header_mutations“ counter to be incremented. + // Default is false. + DisallowIsError *wrappers.BoolValue `protobuf:"bytes,7,opt,name=disallow_is_error,json=disallowIsError,proto3" json:"disallow_is_error,omitempty"` +} + +func (x *HeaderMutationRules) Reset() { + *x = HeaderMutationRules{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeaderMutationRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeaderMutationRules) ProtoMessage() {} + +func (x *HeaderMutationRules) ProtoReflect() protoreflect.Message { + mi := &file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeaderMutationRules.ProtoReflect.Descriptor instead. +func (*HeaderMutationRules) Descriptor() ([]byte, []int) { + return file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescGZIP(), []int{0} +} + +func (x *HeaderMutationRules) GetAllowAllRouting() *wrappers.BoolValue { + if x != nil { + return x.AllowAllRouting + } + return nil +} + +func (x *HeaderMutationRules) GetAllowEnvoy() *wrappers.BoolValue { + if x != nil { + return x.AllowEnvoy + } + return nil +} + +func (x *HeaderMutationRules) GetDisallowSystem() *wrappers.BoolValue { + if x != nil { + return x.DisallowSystem + } + return nil +} + +func (x *HeaderMutationRules) GetDisallowAll() *wrappers.BoolValue { + if x != nil { + return x.DisallowAll + } + return nil +} + +func (x *HeaderMutationRules) GetAllowExpression() *v3.RegexMatcher { + if x != nil { + return x.AllowExpression + } + return nil +} + +func (x *HeaderMutationRules) GetDisallowExpression() *v3.RegexMatcher { + if x != nil { + return x.DisallowExpression + } + return nil +} + +func (x *HeaderMutationRules) GetDisallowIsError() *wrappers.BoolValue { + if x != nil { + return x.DisallowIsError + } + return nil +} + +// The HeaderMutation structure specifies an action that may be taken on HTTP +// headers. +type HeaderMutation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Action: + // + // *HeaderMutation_Remove + // *HeaderMutation_Append + Action isHeaderMutation_Action `protobuf_oneof:"action"` +} + +func (x *HeaderMutation) Reset() { + *x = HeaderMutation{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeaderMutation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeaderMutation) ProtoMessage() {} + +func (x *HeaderMutation) ProtoReflect() protoreflect.Message { + mi := &file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeaderMutation.ProtoReflect.Descriptor instead. +func (*HeaderMutation) Descriptor() ([]byte, []int) { + return file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescGZIP(), []int{1} +} + +func (m *HeaderMutation) GetAction() isHeaderMutation_Action { + if m != nil { + return m.Action + } + return nil +} + +func (x *HeaderMutation) GetRemove() string { + if x, ok := x.GetAction().(*HeaderMutation_Remove); ok { + return x.Remove + } + return "" +} + +func (x *HeaderMutation) GetAppend() *v31.HeaderValueOption { + if x, ok := x.GetAction().(*HeaderMutation_Append); ok { + return x.Append + } + return nil +} + +type isHeaderMutation_Action interface { + isHeaderMutation_Action() +} + +type HeaderMutation_Remove struct { + // Remove the specified header if it exists. + Remove string `protobuf:"bytes,1,opt,name=remove,proto3,oneof"` +} + +type HeaderMutation_Append struct { + // Append new header by the specified HeaderValueOption. + Append *v31.HeaderValueOption `protobuf:"bytes,2,opt,name=append,proto3,oneof"` +} + +func (*HeaderMutation_Remove) isHeaderMutation_Action() {} + +func (*HeaderMutation_Append) isHeaderMutation_Action() {} + +var File_envoy_config_common_mutation_rules_v3_mutation_rules_proto protoreflect.FileDescriptor + +var file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDesc = []byte{ + 0x0a, 0x3a, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, + 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x25, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, + 0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x65, 0x67, 0x65, + 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x8c, 0x04, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x46, 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, + 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x6c, 0x6c, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x12, + 0x3b, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x6e, 0x76, 0x6f, 0x79, 0x12, 0x43, 0x0a, 0x0f, + 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x12, 0x3d, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x61, 0x6c, + 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x6c, 0x6c, + 0x12, 0x4e, 0x0a, 0x10, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, + 0x76, 0x33, 0x2e, 0x52, 0x65, 0x67, 0x65, 0x78, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, + 0x0f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x54, 0x0a, 0x13, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x65, 0x78, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x67, 0x65, 0x78, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x65, 0x72, 0x52, 0x12, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x78, 0x70, 0x72, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x11, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x5f, 0x69, 0x73, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x64, + 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x49, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x89, + 0x01, 0x0a, 0x0e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x72, 0x06, 0xc8, 0x01, 0x00, 0xc0, 0x01, 0x02, 0x48, 0x00, + 0x52, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12, 0x41, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x65, + 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x48, 0x00, 0x52, 0x06, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x0d, 0x0a, 0x06, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x42, 0xb2, 0x01, 0xba, 0x80, 0xc8, + 0xd1, 0x06, 0x02, 0x10, 0x02, 0x0a, 0x33, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, + 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x33, 0x42, 0x12, 0x4d, 0x75, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x5d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6d, 0x75, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x76, 0x33, 0x3b, 0x6d, + 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x76, 0x33, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescOnce sync.Once + file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescData = file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDesc +) + +func file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescGZIP() []byte { + file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescOnce.Do(func() { + file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescData) + }) + return file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescData +} + +var file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_goTypes = []interface{}{ + (*HeaderMutationRules)(nil), // 0: envoy.config.common.mutation_rules.v3.HeaderMutationRules + (*HeaderMutation)(nil), // 1: envoy.config.common.mutation_rules.v3.HeaderMutation + (*wrappers.BoolValue)(nil), // 2: google.protobuf.BoolValue + (*v3.RegexMatcher)(nil), // 3: envoy.type.matcher.v3.RegexMatcher + (*v31.HeaderValueOption)(nil), // 4: envoy.config.core.v3.HeaderValueOption +} +var file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_depIdxs = []int32{ + 2, // 0: envoy.config.common.mutation_rules.v3.HeaderMutationRules.allow_all_routing:type_name -> google.protobuf.BoolValue + 2, // 1: envoy.config.common.mutation_rules.v3.HeaderMutationRules.allow_envoy:type_name -> google.protobuf.BoolValue + 2, // 2: envoy.config.common.mutation_rules.v3.HeaderMutationRules.disallow_system:type_name -> google.protobuf.BoolValue + 2, // 3: envoy.config.common.mutation_rules.v3.HeaderMutationRules.disallow_all:type_name -> google.protobuf.BoolValue + 3, // 4: envoy.config.common.mutation_rules.v3.HeaderMutationRules.allow_expression:type_name -> envoy.type.matcher.v3.RegexMatcher + 3, // 5: envoy.config.common.mutation_rules.v3.HeaderMutationRules.disallow_expression:type_name -> envoy.type.matcher.v3.RegexMatcher + 2, // 6: envoy.config.common.mutation_rules.v3.HeaderMutationRules.disallow_is_error:type_name -> google.protobuf.BoolValue + 4, // 7: envoy.config.common.mutation_rules.v3.HeaderMutation.append:type_name -> envoy.config.core.v3.HeaderValueOption + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_init() } +func file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_init() { + if File_envoy_config_common_mutation_rules_v3_mutation_rules_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeaderMutationRules); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeaderMutation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*HeaderMutation_Remove)(nil), + (*HeaderMutation_Append)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_goTypes, + DependencyIndexes: file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_depIdxs, + MessageInfos: file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes, + }.Build() + File_envoy_config_common_mutation_rules_v3_mutation_rules_proto = out.File + file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDesc = nil + file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_goTypes = nil + file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_depIdxs = nil +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.validate.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.validate.go new file mode 100644 index 000000000..d3b7d4c35 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.validate.go @@ -0,0 +1,525 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: envoy/config/common/mutation_rules/v3/mutation_rules.proto + +package mutation_rulesv3 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on HeaderMutationRules with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *HeaderMutationRules) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on HeaderMutationRules with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// HeaderMutationRulesMultiError, or nil if none found. +func (m *HeaderMutationRules) ValidateAll() error { + return m.validate(true) +} + +func (m *HeaderMutationRules) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetAllowAllRouting()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeaderMutationRulesValidationError{ + field: "AllowAllRouting", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeaderMutationRulesValidationError{ + field: "AllowAllRouting", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAllowAllRouting()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderMutationRulesValidationError{ + field: "AllowAllRouting", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetAllowEnvoy()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeaderMutationRulesValidationError{ + field: "AllowEnvoy", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeaderMutationRulesValidationError{ + field: "AllowEnvoy", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAllowEnvoy()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderMutationRulesValidationError{ + field: "AllowEnvoy", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetDisallowSystem()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeaderMutationRulesValidationError{ + field: "DisallowSystem", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeaderMutationRulesValidationError{ + field: "DisallowSystem", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDisallowSystem()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderMutationRulesValidationError{ + field: "DisallowSystem", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetDisallowAll()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeaderMutationRulesValidationError{ + field: "DisallowAll", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeaderMutationRulesValidationError{ + field: "DisallowAll", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDisallowAll()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderMutationRulesValidationError{ + field: "DisallowAll", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetAllowExpression()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeaderMutationRulesValidationError{ + field: "AllowExpression", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeaderMutationRulesValidationError{ + field: "AllowExpression", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAllowExpression()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderMutationRulesValidationError{ + field: "AllowExpression", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetDisallowExpression()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeaderMutationRulesValidationError{ + field: "DisallowExpression", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeaderMutationRulesValidationError{ + field: "DisallowExpression", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDisallowExpression()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderMutationRulesValidationError{ + field: "DisallowExpression", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetDisallowIsError()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeaderMutationRulesValidationError{ + field: "DisallowIsError", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeaderMutationRulesValidationError{ + field: "DisallowIsError", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDisallowIsError()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderMutationRulesValidationError{ + field: "DisallowIsError", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return HeaderMutationRulesMultiError(errors) + } + + return nil +} + +// HeaderMutationRulesMultiError is an error wrapping multiple validation +// errors returned by HeaderMutationRules.ValidateAll() if the designated +// constraints aren't met. +type HeaderMutationRulesMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m HeaderMutationRulesMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m HeaderMutationRulesMultiError) AllErrors() []error { return m } + +// HeaderMutationRulesValidationError is the validation error returned by +// HeaderMutationRules.Validate if the designated constraints aren't met. +type HeaderMutationRulesValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HeaderMutationRulesValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HeaderMutationRulesValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HeaderMutationRulesValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HeaderMutationRulesValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HeaderMutationRulesValidationError) ErrorName() string { + return "HeaderMutationRulesValidationError" +} + +// Error satisfies the builtin error interface +func (e HeaderMutationRulesValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHeaderMutationRules.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HeaderMutationRulesValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HeaderMutationRulesValidationError{} + +// Validate checks the field values on HeaderMutation with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *HeaderMutation) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on HeaderMutation with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in HeaderMutationMultiError, +// or nil if none found. +func (m *HeaderMutation) ValidateAll() error { + return m.validate(true) +} + +func (m *HeaderMutation) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + oneofActionPresent := false + switch v := m.Action.(type) { + case *HeaderMutation_Remove: + if v == nil { + err := HeaderMutationValidationError{ + field: "Action", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofActionPresent = true + + if !_HeaderMutation_Remove_Pattern.MatchString(m.GetRemove()) { + err := HeaderMutationValidationError{ + field: "Remove", + reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", + } + if !all { + return err + } + errors = append(errors, err) + } + + case *HeaderMutation_Append: + if v == nil { + err := HeaderMutationValidationError{ + field: "Action", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofActionPresent = true + + if all { + switch v := interface{}(m.GetAppend()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeaderMutationValidationError{ + field: "Append", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeaderMutationValidationError{ + field: "Append", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAppend()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderMutationValidationError{ + field: "Append", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + if !oneofActionPresent { + err := HeaderMutationValidationError{ + field: "Action", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return HeaderMutationMultiError(errors) + } + + return nil +} + +// HeaderMutationMultiError is an error wrapping multiple validation errors +// returned by HeaderMutation.ValidateAll() if the designated constraints +// aren't met. +type HeaderMutationMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m HeaderMutationMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m HeaderMutationMultiError) AllErrors() []error { return m } + +// HeaderMutationValidationError is the validation error returned by +// HeaderMutation.Validate if the designated constraints aren't met. +type HeaderMutationValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HeaderMutationValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HeaderMutationValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HeaderMutationValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HeaderMutationValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HeaderMutationValidationError) ErrorName() string { return "HeaderMutationValidationError" } + +// Error satisfies the builtin error interface +func (e HeaderMutationValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHeaderMutation.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HeaderMutationValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HeaderMutationValidationError{} + +var _HeaderMutation_Remove_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.go new file mode 100644 index 000000000..663b06514 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.go @@ -0,0 +1,850 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.23.4 +// source: envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto + +package ext_procv3 + +import ( + _ "github.com/cncf/xds/go/udpa/annotations" + v31 "github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3" + v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + v32 "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + duration "github.com/golang/protobuf/ptypes/duration" + _struct "github.com/golang/protobuf/ptypes/struct" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The filter communicates with an external gRPC service called an "external processor" +// that can do a variety of things with the request and response: +// +// * Access and modify the HTTP headers on the request, response, or both +// * Access and modify the HTTP request and response bodies +// * Access and modify the dynamic stream metadata +// * Immediately send an HTTP response downstream and terminate other processing +// +// The filter communicates with the server using a gRPC bidirectional stream. After the initial +// request, the external server is in control over what additional data is sent to it +// and how it should be processed. +// +// By implementing the protocol specified by the stream, the external server can choose: +// +// - Whether it receives the response message at all +// - Whether it receives the message body at all, in separate chunks, or as a single buffer +// - Whether subsequent HTTP requests are transmitted synchronously or whether they are +// sent asynchronously. +// - To modify request or response trailers if they already exist +// +// The filter supports up to six different processing steps. Each is represented by +// a gRPC stream message that is sent to the external processor. For each message, the +// processor must send a matching response. +// +// - Request headers: Contains the headers from the original HTTP request. +// - Request body: Delivered if they are present and sent in a single message if +// the BUFFERED or BUFFERED_PARTIAL mode is chosen, in multiple messages if the +// STREAMED mode is chosen, and not at all otherwise. +// - Request trailers: Delivered if they are present and if the trailer mode is set +// to SEND. +// - Response headers: Contains the headers from the HTTP response. Keep in mind +// that if the upstream system sends them before processing the request body that +// this message may arrive before the complete body. +// - Response body: Sent according to the processing mode like the request body. +// - Response trailers: Delivered according to the processing mode like the +// request trailers. +// +// By default, the processor sends only the request and response headers messages. +// This may be changed to include any of the six steps by changing the processing_mode +// setting of the filter configuration, or by setting the mode_override of any response +// from the external processor. The latter is only enabled if allow_mode_override is +// set to true. This way, a processor may, for example, use information +// in the request header to determine whether the message body must be examined, or whether +// the proxy should simply stream it straight through. +// +// All of this together allows a server to process the filter traffic in fairly +// sophisticated ways. For example: +// +// - A server may choose to examine all or part of the HTTP message bodies depending +// on the content of the headers. +// - A server may choose to immediately reject some messages based on their HTTP +// headers (or other dynamic metadata) and more carefully examine others. +// - A server may asynchronously monitor traffic coming through the filter by inspecting +// headers, bodies, or both, and then decide to switch to a synchronous processing +// mode, either permanently or temporarily. +// +// The protocol itself is based on a bidirectional gRPC stream. Envoy will send the +// server +// :ref:`ProcessingRequest ` +// messages, and the server must reply with +// :ref:`ProcessingResponse `. +// +// Stats about each gRPC call are recorded in a :ref:`dynamic filter state +// ` object in a namespace matching the filter +// name. +// +// [#next-free-field: 16] +type ExternalProcessor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Configuration for the gRPC service that the filter will communicate with. + // The filter supports both the "Envoy" and "Google" gRPC clients. + GrpcService *v3.GrpcService `protobuf:"bytes,1,opt,name=grpc_service,json=grpcService,proto3" json:"grpc_service,omitempty"` + // By default, if the gRPC stream cannot be established, or if it is closed + // prematurely with an error, the filter will fail. Specifically, if the + // response headers have not yet been delivered, then it will return a 500 + // error downstream. If they have been delivered, then instead the HTTP stream to the + // downstream client will be reset. + // With this parameter set to true, however, then if the gRPC stream is prematurely closed + // or could not be opened, processing continues without error. + FailureModeAllow bool `protobuf:"varint,2,opt,name=failure_mode_allow,json=failureModeAllow,proto3" json:"failure_mode_allow,omitempty"` + // Specifies default options for how HTTP headers, trailers, and bodies are + // sent. See ProcessingMode for details. + ProcessingMode *ProcessingMode `protobuf:"bytes,3,opt,name=processing_mode,json=processingMode,proto3" json:"processing_mode,omitempty"` + // [#not-implemented-hide:] + // If true, send each part of the HTTP request or response specified by ProcessingMode + // asynchronously -- in other words, send the message on the gRPC stream and then continue + // filter processing. If false, which is the default, suspend filter execution after + // each message is sent to the remote service and wait up to "message_timeout" + // for a reply. + AsyncMode bool `protobuf:"varint,4,opt,name=async_mode,json=asyncMode,proto3" json:"async_mode,omitempty"` + // [#not-implemented-hide:] + // Envoy provides a number of :ref:`attributes ` + // for expressive policies. Each attribute name provided in this field will be + // matched against that list and populated in the request_headers message. + // See the :ref:`attribute documentation ` + // for the list of supported attributes and their types. + RequestAttributes []string `protobuf:"bytes,5,rep,name=request_attributes,json=requestAttributes,proto3" json:"request_attributes,omitempty"` + // [#not-implemented-hide:] + // Envoy provides a number of :ref:`attributes ` + // for expressive policies. Each attribute name provided in this field will be + // matched against that list and populated in the response_headers message. + // See the :ref:`attribute documentation ` + // for the list of supported attributes and their types. + ResponseAttributes []string `protobuf:"bytes,6,rep,name=response_attributes,json=responseAttributes,proto3" json:"response_attributes,omitempty"` + // Specifies the timeout for each individual message sent on the stream and + // when the filter is running in synchronous mode. Whenever the proxy sends + // a message on the stream that requires a response, it will reset this timer, + // and will stop processing and return an error (subject to the processing mode) + // if the timer expires before a matching response is received. There is no + // timeout when the filter is running in asynchronous mode. Zero is a valid + // config which means the timer will be triggered immediately. If not + // configured, default is 200 milliseconds. + MessageTimeout *duration.Duration `protobuf:"bytes,7,opt,name=message_timeout,json=messageTimeout,proto3" json:"message_timeout,omitempty"` + // Optional additional prefix to use when emitting statistics. This allows to distinguish + // emitted statistics between configured *ext_proc* filters in an HTTP filter chain. + StatPrefix string `protobuf:"bytes,8,opt,name=stat_prefix,json=statPrefix,proto3" json:"stat_prefix,omitempty"` + // Rules that determine what modifications an external processing server may + // make to message headers. If not set, all headers may be modified except + // for "host", ":authority", ":scheme", ":method", and headers that start + // with the header prefix set via + // :ref:`header_prefix ` + // (which is usually "x-envoy"). + // Note that changing headers such as "host" or ":authority" may not in itself + // change Envoy's routing decision, as routes can be cached. To also force the + // route to be recomputed, set the + // :ref:`clear_route_cache ` + // field to true in the same response. + MutationRules *v31.HeaderMutationRules `protobuf:"bytes,9,opt,name=mutation_rules,json=mutationRules,proto3" json:"mutation_rules,omitempty"` + // Specify the upper bound of + // :ref:`override_message_timeout ` + // If not specified, by default it is 0, which will effectively disable the “override_message_timeout“ API. + MaxMessageTimeout *duration.Duration `protobuf:"bytes,10,opt,name=max_message_timeout,json=maxMessageTimeout,proto3" json:"max_message_timeout,omitempty"` + // Prevents clearing the route-cache when the + // :ref:`clear_route_cache ` + // field is set in an external processor response. + DisableClearRouteCache bool `protobuf:"varint,11,opt,name=disable_clear_route_cache,json=disableClearRouteCache,proto3" json:"disable_clear_route_cache,omitempty"` + // Allow headers matching the “forward_rules“ to be forwarded to the external processing server. + // If not set, all headers are forwarded to the external processing server. + ForwardRules *HeaderForwardingRules `protobuf:"bytes,12,opt,name=forward_rules,json=forwardRules,proto3" json:"forward_rules,omitempty"` + // Additional metadata to be added to the filter state for logging purposes. The metadata + // will be added to StreamInfo's filter state under the namespace corresponding to the + // ext_proc filter name. + FilterMetadata *_struct.Struct `protobuf:"bytes,13,opt,name=filter_metadata,json=filterMetadata,proto3" json:"filter_metadata,omitempty"` + // If “allow_mode_override“ is set to true, the filter config :ref:`processing_mode + // ` + // can be overridden by the response message from the external processing server + // :ref:`mode_override `. + // If not set, “mode_override“ API in the response message will be ignored. + AllowModeOverride bool `protobuf:"varint,14,opt,name=allow_mode_override,json=allowModeOverride,proto3" json:"allow_mode_override,omitempty"` + // If set to true, ignore the + // :ref:`immediate_response ` + // message in an external processor response. In such case, no local reply will be sent. + // Instead, the stream to the external processor will be closed. There will be no + // more external processing for this stream from now on. + DisableImmediateResponse bool `protobuf:"varint,15,opt,name=disable_immediate_response,json=disableImmediateResponse,proto3" json:"disable_immediate_response,omitempty"` +} + +func (x *ExternalProcessor) Reset() { + *x = ExternalProcessor{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExternalProcessor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExternalProcessor) ProtoMessage() {} + +func (x *ExternalProcessor) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExternalProcessor.ProtoReflect.Descriptor instead. +func (*ExternalProcessor) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{0} +} + +func (x *ExternalProcessor) GetGrpcService() *v3.GrpcService { + if x != nil { + return x.GrpcService + } + return nil +} + +func (x *ExternalProcessor) GetFailureModeAllow() bool { + if x != nil { + return x.FailureModeAllow + } + return false +} + +func (x *ExternalProcessor) GetProcessingMode() *ProcessingMode { + if x != nil { + return x.ProcessingMode + } + return nil +} + +func (x *ExternalProcessor) GetAsyncMode() bool { + if x != nil { + return x.AsyncMode + } + return false +} + +func (x *ExternalProcessor) GetRequestAttributes() []string { + if x != nil { + return x.RequestAttributes + } + return nil +} + +func (x *ExternalProcessor) GetResponseAttributes() []string { + if x != nil { + return x.ResponseAttributes + } + return nil +} + +func (x *ExternalProcessor) GetMessageTimeout() *duration.Duration { + if x != nil { + return x.MessageTimeout + } + return nil +} + +func (x *ExternalProcessor) GetStatPrefix() string { + if x != nil { + return x.StatPrefix + } + return "" +} + +func (x *ExternalProcessor) GetMutationRules() *v31.HeaderMutationRules { + if x != nil { + return x.MutationRules + } + return nil +} + +func (x *ExternalProcessor) GetMaxMessageTimeout() *duration.Duration { + if x != nil { + return x.MaxMessageTimeout + } + return nil +} + +func (x *ExternalProcessor) GetDisableClearRouteCache() bool { + if x != nil { + return x.DisableClearRouteCache + } + return false +} + +func (x *ExternalProcessor) GetForwardRules() *HeaderForwardingRules { + if x != nil { + return x.ForwardRules + } + return nil +} + +func (x *ExternalProcessor) GetFilterMetadata() *_struct.Struct { + if x != nil { + return x.FilterMetadata + } + return nil +} + +func (x *ExternalProcessor) GetAllowModeOverride() bool { + if x != nil { + return x.AllowModeOverride + } + return false +} + +func (x *ExternalProcessor) GetDisableImmediateResponse() bool { + if x != nil { + return x.DisableImmediateResponse + } + return false +} + +// The HeaderForwardingRules structure specifies what headers are +// allowed to be forwarded to the external processing server. +// +// This works as below: +// +// 1. If neither “allowed_headers“ nor “disallowed_headers“ is set, all headers are forwarded. +// 2. If both “allowed_headers“ and “disallowed_headers“ are set, only headers in the +// “allowed_headers“ but not in the “disallowed_headers“ are forwarded. +// 3. If “allowed_headers“ is set, and “disallowed_headers“ is not set, only headers in +// the “allowed_headers“ are forwarded. +// 4. If “disallowed_headers“ is set, and “allowed_headers“ is not set, all headers except +// headers in the “disallowed_headers“ are forwarded. +type HeaderForwardingRules struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // If set, specifically allow any header in this list to be forwarded to the external + // processing server. This can be overridden by the below “disallowed_headers“. + AllowedHeaders *v32.ListStringMatcher `protobuf:"bytes,1,opt,name=allowed_headers,json=allowedHeaders,proto3" json:"allowed_headers,omitempty"` + // If set, specifically disallow any header in this list to be forwarded to the external + // processing server. This overrides the above “allowed_headers“ if a header matches both. + DisallowedHeaders *v32.ListStringMatcher `protobuf:"bytes,2,opt,name=disallowed_headers,json=disallowedHeaders,proto3" json:"disallowed_headers,omitempty"` +} + +func (x *HeaderForwardingRules) Reset() { + *x = HeaderForwardingRules{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeaderForwardingRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeaderForwardingRules) ProtoMessage() {} + +func (x *HeaderForwardingRules) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeaderForwardingRules.ProtoReflect.Descriptor instead. +func (*HeaderForwardingRules) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{1} +} + +func (x *HeaderForwardingRules) GetAllowedHeaders() *v32.ListStringMatcher { + if x != nil { + return x.AllowedHeaders + } + return nil +} + +func (x *HeaderForwardingRules) GetDisallowedHeaders() *v32.ListStringMatcher { + if x != nil { + return x.DisallowedHeaders + } + return nil +} + +// Extra settings that may be added to per-route configuration for a +// virtual host or cluster. +type ExtProcPerRoute struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Override: + // + // *ExtProcPerRoute_Disabled + // *ExtProcPerRoute_Overrides + Override isExtProcPerRoute_Override `protobuf_oneof:"override"` +} + +func (x *ExtProcPerRoute) Reset() { + *x = ExtProcPerRoute{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExtProcPerRoute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExtProcPerRoute) ProtoMessage() {} + +func (x *ExtProcPerRoute) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExtProcPerRoute.ProtoReflect.Descriptor instead. +func (*ExtProcPerRoute) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{2} +} + +func (m *ExtProcPerRoute) GetOverride() isExtProcPerRoute_Override { + if m != nil { + return m.Override + } + return nil +} + +func (x *ExtProcPerRoute) GetDisabled() bool { + if x, ok := x.GetOverride().(*ExtProcPerRoute_Disabled); ok { + return x.Disabled + } + return false +} + +func (x *ExtProcPerRoute) GetOverrides() *ExtProcOverrides { + if x, ok := x.GetOverride().(*ExtProcPerRoute_Overrides); ok { + return x.Overrides + } + return nil +} + +type isExtProcPerRoute_Override interface { + isExtProcPerRoute_Override() +} + +type ExtProcPerRoute_Disabled struct { + // Disable the filter for this particular vhost or route. + // If disabled is specified in multiple per-filter-configs, the most specific one will be used. + Disabled bool `protobuf:"varint,1,opt,name=disabled,proto3,oneof"` +} + +type ExtProcPerRoute_Overrides struct { + // Override aspects of the configuration for this route. A set of + // overrides in a more specific configuration will override a "disabled" + // flag set in a less-specific one. + Overrides *ExtProcOverrides `protobuf:"bytes,2,opt,name=overrides,proto3,oneof"` +} + +func (*ExtProcPerRoute_Disabled) isExtProcPerRoute_Override() {} + +func (*ExtProcPerRoute_Overrides) isExtProcPerRoute_Override() {} + +// Overrides that may be set on a per-route basis +// [#next-free-field: 6] +type ExtProcOverrides struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Set a different processing mode for this route than the default. + ProcessingMode *ProcessingMode `protobuf:"bytes,1,opt,name=processing_mode,json=processingMode,proto3" json:"processing_mode,omitempty"` + // [#not-implemented-hide:] + // Set a different asynchronous processing option than the default. + AsyncMode bool `protobuf:"varint,2,opt,name=async_mode,json=asyncMode,proto3" json:"async_mode,omitempty"` + // [#not-implemented-hide:] + // Set different optional attributes than the default setting of the + // “request_attributes“ field. + RequestAttributes []string `protobuf:"bytes,3,rep,name=request_attributes,json=requestAttributes,proto3" json:"request_attributes,omitempty"` + // [#not-implemented-hide:] + // Set different optional properties than the default setting of the + // “response_attributes“ field. + ResponseAttributes []string `protobuf:"bytes,4,rep,name=response_attributes,json=responseAttributes,proto3" json:"response_attributes,omitempty"` + // Set a different gRPC service for this route than the default. + GrpcService *v3.GrpcService `protobuf:"bytes,5,opt,name=grpc_service,json=grpcService,proto3" json:"grpc_service,omitempty"` +} + +func (x *ExtProcOverrides) Reset() { + *x = ExtProcOverrides{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExtProcOverrides) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExtProcOverrides) ProtoMessage() {} + +func (x *ExtProcOverrides) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExtProcOverrides.ProtoReflect.Descriptor instead. +func (*ExtProcOverrides) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{3} +} + +func (x *ExtProcOverrides) GetProcessingMode() *ProcessingMode { + if x != nil { + return x.ProcessingMode + } + return nil +} + +func (x *ExtProcOverrides) GetAsyncMode() bool { + if x != nil { + return x.AsyncMode + } + return false +} + +func (x *ExtProcOverrides) GetRequestAttributes() []string { + if x != nil { + return x.RequestAttributes + } + return nil +} + +func (x *ExtProcOverrides) GetResponseAttributes() []string { + if x != nil { + return x.ResponseAttributes + } + return nil +} + +func (x *ExtProcOverrides) GetGrpcService() *v3.GrpcService { + if x != nil { + return x.GrpcService + } + return nil +} + +var File_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto protoreflect.FileDescriptor + +var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDesc = []byte{ + 0x0a, 0x38, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, + 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2f, 0x76, 0x33, 0x2f, 0x65, 0x78, 0x74, 0x5f, + 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x29, 0x65, 0x6e, 0x76, 0x6f, + 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, + 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x1a, 0x3a, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6d, 0x75, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x6d, 0x75, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x27, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x3f, 0x65, 0x6e, 0x76, 0x6f, + 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x73, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, + 0x6f, 0x63, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, + 0x76, 0x33, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, + 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf7, 0x07, 0x0a, 0x11, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x0c, 0x67, + 0x72, 0x70, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0b, + 0x67, 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x66, + 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, + 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, + 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x62, 0x0a, 0x0f, 0x70, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, + 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x0e, 0x70, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x09, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x2d, 0x0a, 0x12, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x13, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x51, 0x0a, 0x0f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0xaa, 0x01, 0x07, 0x22, 0x03, 0x08, 0x90, 0x1c, 0x32, 0x00, 0x52, + 0x0e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, + 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, + 0x12, 0x61, 0x0a, 0x0e, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, + 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6d, + 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x33, + 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x75, 0x6c, 0x65, 0x73, 0x52, 0x0d, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, + 0x6c, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x13, 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xfa, 0x42, 0x0a, + 0xaa, 0x01, 0x07, 0x22, 0x03, 0x08, 0x90, 0x1c, 0x32, 0x00, 0x52, 0x11, 0x6d, 0x61, 0x78, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x39, 0x0a, + 0x19, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x72, + 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x16, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x52, 0x6f, + 0x75, 0x74, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x65, 0x0a, 0x0d, 0x66, 0x6f, 0x72, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x40, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, + 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, + 0x73, 0x52, 0x0c, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, + 0x40, 0x0a, 0x0f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x2e, 0x0a, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x5f, + 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4d, 0x6f, 0x64, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, + 0x65, 0x12, 0x3c, 0x0a, 0x1a, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x6d, 0x6d, + 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x6d, + 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0xc3, 0x01, 0x0a, 0x15, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, + 0x64, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x51, 0x0a, 0x0f, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x6c, + 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x57, 0x0a, 0x12, + 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x65, 0x72, 0x52, 0x11, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x73, 0x22, 0xa6, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x50, 0x72, 0x6f, + 0x63, 0x50, 0x65, 0x72, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x08, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x07, 0xfa, 0x42, 0x04, + 0x6a, 0x02, 0x08, 0x01, 0x48, 0x00, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x12, 0x5b, 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, + 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, + 0x45, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, + 0x48, 0x00, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x42, 0x0f, 0x0a, + 0x08, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0xbb, + 0x02, 0x0a, 0x10, 0x45, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, + 0x64, 0x65, 0x73, 0x12, 0x62, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, + 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, + 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, + 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x73, 0x79, 0x6e, 0x63, + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x73, 0x79, + 0x6e, 0x63, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x41, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, + 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, + 0x0b, 0x67, 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0xae, 0x01, 0xba, + 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x02, 0x0a, 0x37, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, + 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, + 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, + 0x42, 0x0c, 0x45, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x5b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x73, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2f, + 0x76, 0x33, 0x3b, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x76, 0x33, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescOnce sync.Once + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescData = file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDesc +) + +func file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP() []byte { + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescOnce.Do(func() { + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescData) + }) + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescData +} + +var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_goTypes = []interface{}{ + (*ExternalProcessor)(nil), // 0: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor + (*HeaderForwardingRules)(nil), // 1: envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules + (*ExtProcPerRoute)(nil), // 2: envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute + (*ExtProcOverrides)(nil), // 3: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides + (*v3.GrpcService)(nil), // 4: envoy.config.core.v3.GrpcService + (*ProcessingMode)(nil), // 5: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + (*duration.Duration)(nil), // 6: google.protobuf.Duration + (*v31.HeaderMutationRules)(nil), // 7: envoy.config.common.mutation_rules.v3.HeaderMutationRules + (*_struct.Struct)(nil), // 8: google.protobuf.Struct + (*v32.ListStringMatcher)(nil), // 9: envoy.type.matcher.v3.ListStringMatcher +} +var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_depIdxs = []int32{ + 4, // 0: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.grpc_service:type_name -> envoy.config.core.v3.GrpcService + 5, // 1: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.processing_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + 6, // 2: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.message_timeout:type_name -> google.protobuf.Duration + 7, // 3: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.mutation_rules:type_name -> envoy.config.common.mutation_rules.v3.HeaderMutationRules + 6, // 4: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.max_message_timeout:type_name -> google.protobuf.Duration + 1, // 5: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.forward_rules:type_name -> envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules + 8, // 6: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.filter_metadata:type_name -> google.protobuf.Struct + 9, // 7: envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules.allowed_headers:type_name -> envoy.type.matcher.v3.ListStringMatcher + 9, // 8: envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules.disallowed_headers:type_name -> envoy.type.matcher.v3.ListStringMatcher + 3, // 9: envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute.overrides:type_name -> envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides + 5, // 10: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides.processing_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + 4, // 11: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides.grpc_service:type_name -> envoy.config.core.v3.GrpcService + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_init() } +func file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_init() { + if File_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto != nil { + return + } + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_init() + if !protoimpl.UnsafeEnabled { + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExternalProcessor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeaderForwardingRules); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExtProcPerRoute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExtProcOverrides); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*ExtProcPerRoute_Disabled)(nil), + (*ExtProcPerRoute_Overrides)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_goTypes, + DependencyIndexes: file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_depIdxs, + MessageInfos: file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes, + }.Build() + File_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto = out.File + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDesc = nil + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_goTypes = nil + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_depIdxs = nil +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.validate.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.validate.go new file mode 100644 index 000000000..95277a3c9 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.validate.go @@ -0,0 +1,870 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto + +package ext_procv3 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on ExternalProcessor with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ExternalProcessor) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ExternalProcessor with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ExternalProcessorMultiError, or nil if none found. +func (m *ExternalProcessor) ValidateAll() error { + return m.validate(true) +} + +func (m *ExternalProcessor) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetGrpcService() == nil { + err := ExternalProcessorValidationError{ + field: "GrpcService", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetGrpcService()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "GrpcService", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "GrpcService", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGrpcService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "GrpcService", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for FailureModeAllow + + if all { + switch v := interface{}(m.GetProcessingMode()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "ProcessingMode", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "ProcessingMode", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetProcessingMode()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "ProcessingMode", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for AsyncMode + + if d := m.GetMessageTimeout(); d != nil { + dur, err := d.AsDuration(), d.CheckValid() + if err != nil { + err = ExternalProcessorValidationError{ + field: "MessageTimeout", + reason: "value is not a valid duration", + cause: err, + } + if !all { + return err + } + errors = append(errors, err) + } else { + + lte := time.Duration(3600*time.Second + 0*time.Nanosecond) + gte := time.Duration(0*time.Second + 0*time.Nanosecond) + + if dur < gte || dur > lte { + err := ExternalProcessorValidationError{ + field: "MessageTimeout", + reason: "value must be inside range [0s, 1h0m0s]", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + } + + // no validation rules for StatPrefix + + if all { + switch v := interface{}(m.GetMutationRules()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "MutationRules", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "MutationRules", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMutationRules()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "MutationRules", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if d := m.GetMaxMessageTimeout(); d != nil { + dur, err := d.AsDuration(), d.CheckValid() + if err != nil { + err = ExternalProcessorValidationError{ + field: "MaxMessageTimeout", + reason: "value is not a valid duration", + cause: err, + } + if !all { + return err + } + errors = append(errors, err) + } else { + + lte := time.Duration(3600*time.Second + 0*time.Nanosecond) + gte := time.Duration(0*time.Second + 0*time.Nanosecond) + + if dur < gte || dur > lte { + err := ExternalProcessorValidationError{ + field: "MaxMessageTimeout", + reason: "value must be inside range [0s, 1h0m0s]", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + } + + // no validation rules for DisableClearRouteCache + + if all { + switch v := interface{}(m.GetForwardRules()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "ForwardRules", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "ForwardRules", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetForwardRules()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "ForwardRules", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetFilterMetadata()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "FilterMetadata", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "FilterMetadata", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetFilterMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "FilterMetadata", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for AllowModeOverride + + // no validation rules for DisableImmediateResponse + + if len(errors) > 0 { + return ExternalProcessorMultiError(errors) + } + + return nil +} + +// ExternalProcessorMultiError is an error wrapping multiple validation errors +// returned by ExternalProcessor.ValidateAll() if the designated constraints +// aren't met. +type ExternalProcessorMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ExternalProcessorMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ExternalProcessorMultiError) AllErrors() []error { return m } + +// ExternalProcessorValidationError is the validation error returned by +// ExternalProcessor.Validate if the designated constraints aren't met. +type ExternalProcessorValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ExternalProcessorValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ExternalProcessorValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ExternalProcessorValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ExternalProcessorValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ExternalProcessorValidationError) ErrorName() string { + return "ExternalProcessorValidationError" +} + +// Error satisfies the builtin error interface +func (e ExternalProcessorValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sExternalProcessor.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ExternalProcessorValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ExternalProcessorValidationError{} + +// Validate checks the field values on HeaderForwardingRules with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *HeaderForwardingRules) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on HeaderForwardingRules with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// HeaderForwardingRulesMultiError, or nil if none found. +func (m *HeaderForwardingRules) ValidateAll() error { + return m.validate(true) +} + +func (m *HeaderForwardingRules) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetAllowedHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeaderForwardingRulesValidationError{ + field: "AllowedHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeaderForwardingRulesValidationError{ + field: "AllowedHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAllowedHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderForwardingRulesValidationError{ + field: "AllowedHeaders", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetDisallowedHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeaderForwardingRulesValidationError{ + field: "DisallowedHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeaderForwardingRulesValidationError{ + field: "DisallowedHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDisallowedHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderForwardingRulesValidationError{ + field: "DisallowedHeaders", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return HeaderForwardingRulesMultiError(errors) + } + + return nil +} + +// HeaderForwardingRulesMultiError is an error wrapping multiple validation +// errors returned by HeaderForwardingRules.ValidateAll() if the designated +// constraints aren't met. +type HeaderForwardingRulesMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m HeaderForwardingRulesMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m HeaderForwardingRulesMultiError) AllErrors() []error { return m } + +// HeaderForwardingRulesValidationError is the validation error returned by +// HeaderForwardingRules.Validate if the designated constraints aren't met. +type HeaderForwardingRulesValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HeaderForwardingRulesValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HeaderForwardingRulesValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HeaderForwardingRulesValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HeaderForwardingRulesValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HeaderForwardingRulesValidationError) ErrorName() string { + return "HeaderForwardingRulesValidationError" +} + +// Error satisfies the builtin error interface +func (e HeaderForwardingRulesValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHeaderForwardingRules.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HeaderForwardingRulesValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HeaderForwardingRulesValidationError{} + +// Validate checks the field values on ExtProcPerRoute with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ExtProcPerRoute) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ExtProcPerRoute with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ExtProcPerRouteMultiError, or nil if none found. +func (m *ExtProcPerRoute) ValidateAll() error { + return m.validate(true) +} + +func (m *ExtProcPerRoute) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + oneofOverridePresent := false + switch v := m.Override.(type) { + case *ExtProcPerRoute_Disabled: + if v == nil { + err := ExtProcPerRouteValidationError{ + field: "Override", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofOverridePresent = true + + if m.GetDisabled() != true { + err := ExtProcPerRouteValidationError{ + field: "Disabled", + reason: "value must equal true", + } + if !all { + return err + } + errors = append(errors, err) + } + + case *ExtProcPerRoute_Overrides: + if v == nil { + err := ExtProcPerRouteValidationError{ + field: "Override", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofOverridePresent = true + + if all { + switch v := interface{}(m.GetOverrides()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExtProcPerRouteValidationError{ + field: "Overrides", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExtProcPerRouteValidationError{ + field: "Overrides", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetOverrides()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtProcPerRouteValidationError{ + field: "Overrides", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + if !oneofOverridePresent { + err := ExtProcPerRouteValidationError{ + field: "Override", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return ExtProcPerRouteMultiError(errors) + } + + return nil +} + +// ExtProcPerRouteMultiError is an error wrapping multiple validation errors +// returned by ExtProcPerRoute.ValidateAll() if the designated constraints +// aren't met. +type ExtProcPerRouteMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ExtProcPerRouteMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ExtProcPerRouteMultiError) AllErrors() []error { return m } + +// ExtProcPerRouteValidationError is the validation error returned by +// ExtProcPerRoute.Validate if the designated constraints aren't met. +type ExtProcPerRouteValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ExtProcPerRouteValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ExtProcPerRouteValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ExtProcPerRouteValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ExtProcPerRouteValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ExtProcPerRouteValidationError) ErrorName() string { return "ExtProcPerRouteValidationError" } + +// Error satisfies the builtin error interface +func (e ExtProcPerRouteValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sExtProcPerRoute.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ExtProcPerRouteValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ExtProcPerRouteValidationError{} + +// Validate checks the field values on ExtProcOverrides with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ExtProcOverrides) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ExtProcOverrides with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ExtProcOverridesMultiError, or nil if none found. +func (m *ExtProcOverrides) ValidateAll() error { + return m.validate(true) +} + +func (m *ExtProcOverrides) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetProcessingMode()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "ProcessingMode", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "ProcessingMode", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetProcessingMode()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtProcOverridesValidationError{ + field: "ProcessingMode", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for AsyncMode + + if all { + switch v := interface{}(m.GetGrpcService()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "GrpcService", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "GrpcService", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGrpcService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtProcOverridesValidationError{ + field: "GrpcService", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return ExtProcOverridesMultiError(errors) + } + + return nil +} + +// ExtProcOverridesMultiError is an error wrapping multiple validation errors +// returned by ExtProcOverrides.ValidateAll() if the designated constraints +// aren't met. +type ExtProcOverridesMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ExtProcOverridesMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ExtProcOverridesMultiError) AllErrors() []error { return m } + +// ExtProcOverridesValidationError is the validation error returned by +// ExtProcOverrides.Validate if the designated constraints aren't met. +type ExtProcOverridesValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ExtProcOverridesValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ExtProcOverridesValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ExtProcOverridesValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ExtProcOverridesValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ExtProcOverridesValidationError) ErrorName() string { return "ExtProcOverridesValidationError" } + +// Error satisfies the builtin error interface +func (e ExtProcOverridesValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sExtProcOverrides.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ExtProcOverridesValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ExtProcOverridesValidationError{} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.go new file mode 100644 index 000000000..0e60c6c51 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.go @@ -0,0 +1,409 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.23.4 +// source: envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto + +package ext_procv3 + +import ( + _ "github.com/cncf/xds/go/udpa/annotations" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Control how headers and trailers are handled +type ProcessingMode_HeaderSendMode int32 + +const ( + // The default HeaderSendMode depends on which part of the message is being + // processed. By default, request and response headers are sent, + // while trailers are skipped. + ProcessingMode_DEFAULT ProcessingMode_HeaderSendMode = 0 + // Send the header or trailer. + ProcessingMode_SEND ProcessingMode_HeaderSendMode = 1 + // Do not send the header or trailer. + ProcessingMode_SKIP ProcessingMode_HeaderSendMode = 2 +) + +// Enum value maps for ProcessingMode_HeaderSendMode. +var ( + ProcessingMode_HeaderSendMode_name = map[int32]string{ + 0: "DEFAULT", + 1: "SEND", + 2: "SKIP", + } + ProcessingMode_HeaderSendMode_value = map[string]int32{ + "DEFAULT": 0, + "SEND": 1, + "SKIP": 2, + } +) + +func (x ProcessingMode_HeaderSendMode) Enum() *ProcessingMode_HeaderSendMode { + p := new(ProcessingMode_HeaderSendMode) + *p = x + return p +} + +func (x ProcessingMode_HeaderSendMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProcessingMode_HeaderSendMode) Descriptor() protoreflect.EnumDescriptor { + return file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_enumTypes[0].Descriptor() +} + +func (ProcessingMode_HeaderSendMode) Type() protoreflect.EnumType { + return &file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_enumTypes[0] +} + +func (x ProcessingMode_HeaderSendMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProcessingMode_HeaderSendMode.Descriptor instead. +func (ProcessingMode_HeaderSendMode) EnumDescriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescGZIP(), []int{0, 0} +} + +// Control how the request and response bodies are handled +// When body mutation by external processor is enabled, ext_proc filter will always remove +// the content length header in three cases below because content length can not be guaranteed +// to be set correctly: +// 1) STREAMED BodySendMode: header processing completes before body mutation comes back. +// 2) BUFFERED_PARTIAL BodySendMode: body is buffered and could be injected in different phases. +// 3) BUFFERED BodySendMode + SKIP HeaderSendMode: header processing (e.g., update content-length) is skipped. +// +// In Envoy's http1 codec implementation, removing content length will enable chunked transfer +// encoding whenever feasible. The recipient (either client or server) must be able +// to parse and decode the chunked transfer coding. +// (see `details in RFC9112 `_). +// +// In BUFFERED BodySendMode + SEND HeaderSendMode, content length header is allowed but it is +// external processor's responsibility to set the content length correctly matched to the length +// of mutated body. If they don't match, the corresponding body mutation will be rejected and +// local reply will be sent with an error message. +type ProcessingMode_BodySendMode int32 + +const ( + // Do not send the body at all. This is the default. + ProcessingMode_NONE ProcessingMode_BodySendMode = 0 + // Stream the body to the server in pieces as they arrive at the + // proxy. + ProcessingMode_STREAMED ProcessingMode_BodySendMode = 1 + // Buffer the message body in memory and send the entire body at once. + // If the body exceeds the configured buffer limit, then the + // downstream system will receive an error. + ProcessingMode_BUFFERED ProcessingMode_BodySendMode = 2 + // Buffer the message body in memory and send the entire body in one + // chunk. If the body exceeds the configured buffer limit, then the body contents + // up to the buffer limit will be sent. + ProcessingMode_BUFFERED_PARTIAL ProcessingMode_BodySendMode = 3 +) + +// Enum value maps for ProcessingMode_BodySendMode. +var ( + ProcessingMode_BodySendMode_name = map[int32]string{ + 0: "NONE", + 1: "STREAMED", + 2: "BUFFERED", + 3: "BUFFERED_PARTIAL", + } + ProcessingMode_BodySendMode_value = map[string]int32{ + "NONE": 0, + "STREAMED": 1, + "BUFFERED": 2, + "BUFFERED_PARTIAL": 3, + } +) + +func (x ProcessingMode_BodySendMode) Enum() *ProcessingMode_BodySendMode { + p := new(ProcessingMode_BodySendMode) + *p = x + return p +} + +func (x ProcessingMode_BodySendMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProcessingMode_BodySendMode) Descriptor() protoreflect.EnumDescriptor { + return file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_enumTypes[1].Descriptor() +} + +func (ProcessingMode_BodySendMode) Type() protoreflect.EnumType { + return &file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_enumTypes[1] +} + +func (x ProcessingMode_BodySendMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProcessingMode_BodySendMode.Descriptor instead. +func (ProcessingMode_BodySendMode) EnumDescriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescGZIP(), []int{0, 1} +} + +// [#next-free-field: 7] +type ProcessingMode struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // How to handle the request header. Default is "SEND". + RequestHeaderMode ProcessingMode_HeaderSendMode `protobuf:"varint,1,opt,name=request_header_mode,json=requestHeaderMode,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ProcessingMode_HeaderSendMode" json:"request_header_mode,omitempty"` + // How to handle the response header. Default is "SEND". + ResponseHeaderMode ProcessingMode_HeaderSendMode `protobuf:"varint,2,opt,name=response_header_mode,json=responseHeaderMode,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ProcessingMode_HeaderSendMode" json:"response_header_mode,omitempty"` + // How to handle the request body. Default is "NONE". + RequestBodyMode ProcessingMode_BodySendMode `protobuf:"varint,3,opt,name=request_body_mode,json=requestBodyMode,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ProcessingMode_BodySendMode" json:"request_body_mode,omitempty"` + // How do handle the response body. Default is "NONE". + ResponseBodyMode ProcessingMode_BodySendMode `protobuf:"varint,4,opt,name=response_body_mode,json=responseBodyMode,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ProcessingMode_BodySendMode" json:"response_body_mode,omitempty"` + // How to handle the request trailers. Default is "SKIP". + RequestTrailerMode ProcessingMode_HeaderSendMode `protobuf:"varint,5,opt,name=request_trailer_mode,json=requestTrailerMode,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ProcessingMode_HeaderSendMode" json:"request_trailer_mode,omitempty"` + // How to handle the response trailers. Default is "SKIP". + ResponseTrailerMode ProcessingMode_HeaderSendMode `protobuf:"varint,6,opt,name=response_trailer_mode,json=responseTrailerMode,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ProcessingMode_HeaderSendMode" json:"response_trailer_mode,omitempty"` +} + +func (x *ProcessingMode) Reset() { + *x = ProcessingMode{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProcessingMode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProcessingMode) ProtoMessage() {} + +func (x *ProcessingMode) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProcessingMode.ProtoReflect.Descriptor instead. +func (*ProcessingMode) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescGZIP(), []int{0} +} + +func (x *ProcessingMode) GetRequestHeaderMode() ProcessingMode_HeaderSendMode { + if x != nil { + return x.RequestHeaderMode + } + return ProcessingMode_DEFAULT +} + +func (x *ProcessingMode) GetResponseHeaderMode() ProcessingMode_HeaderSendMode { + if x != nil { + return x.ResponseHeaderMode + } + return ProcessingMode_DEFAULT +} + +func (x *ProcessingMode) GetRequestBodyMode() ProcessingMode_BodySendMode { + if x != nil { + return x.RequestBodyMode + } + return ProcessingMode_NONE +} + +func (x *ProcessingMode) GetResponseBodyMode() ProcessingMode_BodySendMode { + if x != nil { + return x.ResponseBodyMode + } + return ProcessingMode_NONE +} + +func (x *ProcessingMode) GetRequestTrailerMode() ProcessingMode_HeaderSendMode { + if x != nil { + return x.RequestTrailerMode + } + return ProcessingMode_DEFAULT +} + +func (x *ProcessingMode) GetResponseTrailerMode() ProcessingMode_HeaderSendMode { + if x != nil { + return x.ResponseTrailerMode + } + return ProcessingMode_DEFAULT +} + +var File_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto protoreflect.FileDescriptor + +var file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDesc = []byte{ + 0x0a, 0x3f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, + 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x63, + 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x29, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, + 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x1a, 0x1d, 0x75, 0x64, + 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa9, 0x07, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x82, 0x01, 0x0a, 0x13, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x48, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, + 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, + 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, + 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x42, + 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x84, 0x01, 0x0a, + 0x14, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x48, 0x2e, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, + 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, + 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x6e, + 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, + 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, + 0x6f, 0x64, 0x65, 0x12, 0x7c, 0x0a, 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x62, + 0x6f, 0x64, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x46, + 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, + 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x53, 0x65, + 0x6e, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, + 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x4d, 0x6f, 0x64, + 0x65, 0x12, 0x7e, 0x0a, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x62, 0x6f, + 0x64, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x46, 0x2e, + 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, + 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x53, 0x65, 0x6e, + 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, + 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6f, 0x64, 0x79, 0x4d, 0x6f, 0x64, + 0x65, 0x12, 0x84, 0x01, 0x0a, 0x14, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x72, + 0x61, 0x69, 0x6c, 0x65, 0x72, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x48, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, + 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, + 0x01, 0x02, 0x10, 0x01, 0x52, 0x12, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x72, 0x61, + 0x69, 0x6c, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x86, 0x01, 0x0a, 0x15, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x5f, 0x6d, 0x6f, + 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x48, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, + 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, + 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, + 0x6f, 0x64, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x6f, + 0x64, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x13, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x4d, 0x6f, 0x64, + 0x65, 0x22, 0x31, 0x0a, 0x0e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x6e, 0x64, 0x4d, + 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, + 0x12, 0x08, 0x0a, 0x04, 0x53, 0x45, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x4b, + 0x49, 0x50, 0x10, 0x02, 0x22, 0x4a, 0x0a, 0x0c, 0x42, 0x6f, 0x64, 0x79, 0x53, 0x65, 0x6e, 0x64, + 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0c, + 0x0a, 0x08, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4d, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, + 0x42, 0x55, 0x46, 0x46, 0x45, 0x52, 0x45, 0x44, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x42, 0x55, + 0x46, 0x46, 0x45, 0x52, 0x45, 0x44, 0x5f, 0x50, 0x41, 0x52, 0x54, 0x49, 0x41, 0x4c, 0x10, 0x03, + 0x42, 0xb5, 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x02, 0x0a, 0x37, 0x69, 0x6f, 0x2e, + 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, + 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, + 0x63, 0x2e, 0x76, 0x33, 0x42, 0x13, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, + 0x4d, 0x6f, 0x64, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x5b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, + 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2f, 0x68, 0x74, 0x74, + 0x70, 0x2f, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2f, 0x76, 0x33, 0x3b, 0x65, 0x78, + 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescOnce sync.Once + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescData = file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDesc +) + +func file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescGZIP() []byte { + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescOnce.Do(func() { + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescData) + }) + return file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescData +} + +var file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_goTypes = []interface{}{ + (ProcessingMode_HeaderSendMode)(0), // 0: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode + (ProcessingMode_BodySendMode)(0), // 1: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode + (*ProcessingMode)(nil), // 2: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode +} +var file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_depIdxs = []int32{ + 0, // 0: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.request_header_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode + 0, // 1: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.response_header_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode + 1, // 2: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.request_body_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode + 1, // 3: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.response_body_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode + 0, // 4: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.request_trailer_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode + 0, // 5: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.response_trailer_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_init() } +func file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_init() { + if File_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProcessingMode); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDesc, + NumEnums: 2, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_goTypes, + DependencyIndexes: file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_depIdxs, + EnumInfos: file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_enumTypes, + MessageInfos: file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_msgTypes, + }.Build() + File_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto = out.File + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDesc = nil + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_goTypes = nil + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_depIdxs = nil +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.validate.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.validate.go new file mode 100644 index 000000000..78202c108 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.validate.go @@ -0,0 +1,202 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto + +package ext_procv3 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on ProcessingMode with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *ProcessingMode) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ProcessingMode with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in ProcessingModeMultiError, +// or nil if none found. +func (m *ProcessingMode) ValidateAll() error { + return m.validate(true) +} + +func (m *ProcessingMode) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if _, ok := ProcessingMode_HeaderSendMode_name[int32(m.GetRequestHeaderMode())]; !ok { + err := ProcessingModeValidationError{ + field: "RequestHeaderMode", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if _, ok := ProcessingMode_HeaderSendMode_name[int32(m.GetResponseHeaderMode())]; !ok { + err := ProcessingModeValidationError{ + field: "ResponseHeaderMode", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if _, ok := ProcessingMode_BodySendMode_name[int32(m.GetRequestBodyMode())]; !ok { + err := ProcessingModeValidationError{ + field: "RequestBodyMode", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if _, ok := ProcessingMode_BodySendMode_name[int32(m.GetResponseBodyMode())]; !ok { + err := ProcessingModeValidationError{ + field: "ResponseBodyMode", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if _, ok := ProcessingMode_HeaderSendMode_name[int32(m.GetRequestTrailerMode())]; !ok { + err := ProcessingModeValidationError{ + field: "RequestTrailerMode", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if _, ok := ProcessingMode_HeaderSendMode_name[int32(m.GetResponseTrailerMode())]; !ok { + err := ProcessingModeValidationError{ + field: "ResponseTrailerMode", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return ProcessingModeMultiError(errors) + } + + return nil +} + +// ProcessingModeMultiError is an error wrapping multiple validation errors +// returned by ProcessingMode.ValidateAll() if the designated constraints +// aren't met. +type ProcessingModeMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ProcessingModeMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ProcessingModeMultiError) AllErrors() []error { return m } + +// ProcessingModeValidationError is the validation error returned by +// ProcessingMode.Validate if the designated constraints aren't met. +type ProcessingModeValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ProcessingModeValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ProcessingModeValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ProcessingModeValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ProcessingModeValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ProcessingModeValidationError) ErrorName() string { return "ProcessingModeValidationError" } + +// Error satisfies the builtin error interface +func (e ProcessingModeValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sProcessingMode.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ProcessingModeValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ProcessingModeValidationError{} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.go new file mode 100644 index 000000000..af4069166 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.go @@ -0,0 +1,1885 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.23.4 +// source: envoy/service/ext_proc/v3/external_processor.proto + +package ext_procv3 + +import ( + context "context" + _ "github.com/cncf/xds/go/udpa/annotations" + v31 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3" + v32 "github.com/envoyproxy/go-control-plane/envoy/type/v3" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + duration "github.com/golang/protobuf/ptypes/duration" + _struct "github.com/golang/protobuf/ptypes/struct" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CommonResponse_ResponseStatus int32 + +const ( + // Apply the mutation instructions in this message to the + // request or response, and then continue processing the filter + // stream as normal. This is the default. + CommonResponse_CONTINUE CommonResponse_ResponseStatus = 0 + // Apply the specified header mutation, replace the body with the body + // specified in the body mutation (if present), and do not send any + // further messages for this request or response even if the processing + // mode is configured to do so. + // + // When used in response to a request_headers or response_headers message, + // this status makes it possible to either completely replace the body + // while discarding the original body, or to add a body to a message that + // formerly did not have one. + // + // In other words, this response makes it possible to turn an HTTP GET + // into a POST, PUT, or PATCH. + CommonResponse_CONTINUE_AND_REPLACE CommonResponse_ResponseStatus = 1 +) + +// Enum value maps for CommonResponse_ResponseStatus. +var ( + CommonResponse_ResponseStatus_name = map[int32]string{ + 0: "CONTINUE", + 1: "CONTINUE_AND_REPLACE", + } + CommonResponse_ResponseStatus_value = map[string]int32{ + "CONTINUE": 0, + "CONTINUE_AND_REPLACE": 1, + } +) + +func (x CommonResponse_ResponseStatus) Enum() *CommonResponse_ResponseStatus { + p := new(CommonResponse_ResponseStatus) + *p = x + return p +} + +func (x CommonResponse_ResponseStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CommonResponse_ResponseStatus) Descriptor() protoreflect.EnumDescriptor { + return file_envoy_service_ext_proc_v3_external_processor_proto_enumTypes[0].Descriptor() +} + +func (CommonResponse_ResponseStatus) Type() protoreflect.EnumType { + return &file_envoy_service_ext_proc_v3_external_processor_proto_enumTypes[0] +} + +func (x CommonResponse_ResponseStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CommonResponse_ResponseStatus.Descriptor instead. +func (CommonResponse_ResponseStatus) EnumDescriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{8, 0} +} + +// This represents the different types of messages that Envoy can send +// to an external processing server. +// [#next-free-field: 8] +type ProcessingRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Specify whether the filter that sent this request is running in synchronous + // or asynchronous mode. The choice of synchronous or asynchronous mode + // can be set in the filter configuration, and defaults to false. + // + // - A value of “false“ indicates that the server must respond + // to this message by either sending back a matching ProcessingResponse message, + // or by closing the stream. + // - A value of “true“ indicates that the server must not respond to this + // message, although it may still close the stream to indicate that no more messages + // are needed. + AsyncMode bool `protobuf:"varint,1,opt,name=async_mode,json=asyncMode,proto3" json:"async_mode,omitempty"` + // Each request message will include one of the following sub-messages. Which + // ones are set for a particular HTTP request/response depend on the + // processing mode. + // + // Types that are assignable to Request: + // + // *ProcessingRequest_RequestHeaders + // *ProcessingRequest_ResponseHeaders + // *ProcessingRequest_RequestBody + // *ProcessingRequest_ResponseBody + // *ProcessingRequest_RequestTrailers + // *ProcessingRequest_ResponseTrailers + Request isProcessingRequest_Request `protobuf_oneof:"request"` +} + +func (x *ProcessingRequest) Reset() { + *x = ProcessingRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProcessingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProcessingRequest) ProtoMessage() {} + +func (x *ProcessingRequest) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProcessingRequest.ProtoReflect.Descriptor instead. +func (*ProcessingRequest) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{0} +} + +func (x *ProcessingRequest) GetAsyncMode() bool { + if x != nil { + return x.AsyncMode + } + return false +} + +func (m *ProcessingRequest) GetRequest() isProcessingRequest_Request { + if m != nil { + return m.Request + } + return nil +} + +func (x *ProcessingRequest) GetRequestHeaders() *HttpHeaders { + if x, ok := x.GetRequest().(*ProcessingRequest_RequestHeaders); ok { + return x.RequestHeaders + } + return nil +} + +func (x *ProcessingRequest) GetResponseHeaders() *HttpHeaders { + if x, ok := x.GetRequest().(*ProcessingRequest_ResponseHeaders); ok { + return x.ResponseHeaders + } + return nil +} + +func (x *ProcessingRequest) GetRequestBody() *HttpBody { + if x, ok := x.GetRequest().(*ProcessingRequest_RequestBody); ok { + return x.RequestBody + } + return nil +} + +func (x *ProcessingRequest) GetResponseBody() *HttpBody { + if x, ok := x.GetRequest().(*ProcessingRequest_ResponseBody); ok { + return x.ResponseBody + } + return nil +} + +func (x *ProcessingRequest) GetRequestTrailers() *HttpTrailers { + if x, ok := x.GetRequest().(*ProcessingRequest_RequestTrailers); ok { + return x.RequestTrailers + } + return nil +} + +func (x *ProcessingRequest) GetResponseTrailers() *HttpTrailers { + if x, ok := x.GetRequest().(*ProcessingRequest_ResponseTrailers); ok { + return x.ResponseTrailers + } + return nil +} + +type isProcessingRequest_Request interface { + isProcessingRequest_Request() +} + +type ProcessingRequest_RequestHeaders struct { + // Information about the HTTP request headers, as well as peer info and additional + // properties. Unless “async_mode“ is “true“, the server must send back a + // HeaderResponse message, an ImmediateResponse message, or close the stream. + RequestHeaders *HttpHeaders `protobuf:"bytes,2,opt,name=request_headers,json=requestHeaders,proto3,oneof"` +} + +type ProcessingRequest_ResponseHeaders struct { + // Information about the HTTP response headers, as well as peer info and additional + // properties. Unless “async_mode“ is “true“, the server must send back a + // HeaderResponse message or close the stream. + ResponseHeaders *HttpHeaders `protobuf:"bytes,3,opt,name=response_headers,json=responseHeaders,proto3,oneof"` +} + +type ProcessingRequest_RequestBody struct { + // A chunk of the HTTP request body. Unless “async_mode“ is true, the server must send back + // a BodyResponse message, an ImmediateResponse message, or close the stream. + RequestBody *HttpBody `protobuf:"bytes,4,opt,name=request_body,json=requestBody,proto3,oneof"` +} + +type ProcessingRequest_ResponseBody struct { + // A chunk of the HTTP request body. Unless “async_mode“ is “true“, the server must send back + // a BodyResponse message or close the stream. + ResponseBody *HttpBody `protobuf:"bytes,5,opt,name=response_body,json=responseBody,proto3,oneof"` +} + +type ProcessingRequest_RequestTrailers struct { + // The HTTP trailers for the request path. Unless “async_mode“ is “true“, the server + // must send back a TrailerResponse message or close the stream. + // + // This message is only sent if the trailers processing mode is set to “SEND“. + // If there are no trailers on the original downstream request, then this message + // will only be sent (with empty trailers waiting to be populated) if the + // processing mode is set before the request headers are sent, such as + // in the filter configuration. + RequestTrailers *HttpTrailers `protobuf:"bytes,6,opt,name=request_trailers,json=requestTrailers,proto3,oneof"` +} + +type ProcessingRequest_ResponseTrailers struct { + // The HTTP trailers for the response path. Unless “async_mode“ is “true“, the server + // must send back a TrailerResponse message or close the stream. + // + // This message is only sent if the trailers processing mode is set to “SEND“. + // If there are no trailers on the original downstream request, then this message + // will only be sent (with empty trailers waiting to be populated) if the + // processing mode is set before the request headers are sent, such as + // in the filter configuration. + ResponseTrailers *HttpTrailers `protobuf:"bytes,7,opt,name=response_trailers,json=responseTrailers,proto3,oneof"` +} + +func (*ProcessingRequest_RequestHeaders) isProcessingRequest_Request() {} + +func (*ProcessingRequest_ResponseHeaders) isProcessingRequest_Request() {} + +func (*ProcessingRequest_RequestBody) isProcessingRequest_Request() {} + +func (*ProcessingRequest_ResponseBody) isProcessingRequest_Request() {} + +func (*ProcessingRequest_RequestTrailers) isProcessingRequest_Request() {} + +func (*ProcessingRequest_ResponseTrailers) isProcessingRequest_Request() {} + +// For every ProcessingRequest received by the server with the “async_mode“ field +// set to false, the server must send back exactly one ProcessingResponse message. +// [#next-free-field: 11] +type ProcessingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *ProcessingResponse_RequestHeaders + // *ProcessingResponse_ResponseHeaders + // *ProcessingResponse_RequestBody + // *ProcessingResponse_ResponseBody + // *ProcessingResponse_RequestTrailers + // *ProcessingResponse_ResponseTrailers + // *ProcessingResponse_ImmediateResponse + Response isProcessingResponse_Response `protobuf_oneof:"response"` + // [#not-implemented-hide:] + // Optional metadata that will be emitted as dynamic metadata to be consumed by the next + // filter. This metadata will be placed in the namespace “envoy.filters.http.ext_proc“. + DynamicMetadata *_struct.Struct `protobuf:"bytes,8,opt,name=dynamic_metadata,json=dynamicMetadata,proto3" json:"dynamic_metadata,omitempty"` + // Override how parts of the HTTP request and response are processed + // for the duration of this particular request/response only. Servers + // may use this to intelligently control how requests are processed + // based on the headers and other metadata that they see. + // This field is only applicable when servers responding to the header requests. + // If it is set in the response to the body or trailer requests, it will be ignored by Envoy. + // It is also ignored by Envoy when the ext_proc filter config + // :ref:`allow_mode_override + // ` + // is set to false. + ModeOverride *v3.ProcessingMode `protobuf:"bytes,9,opt,name=mode_override,json=modeOverride,proto3" json:"mode_override,omitempty"` + // When ext_proc server receives a request message, in case it needs more + // time to process the message, it sends back a ProcessingResponse message + // with a new timeout value. When Envoy receives this response message, + // it ignores other fields in the response, just stop the original timer, + // which has the timeout value specified in + // :ref:`message_timeout + // ` + // and start a new timer with this “override_message_timeout“ value and keep the + // Envoy ext_proc filter state machine intact. + // Has to be >= 1ms and <= + // :ref:`max_message_timeout ` + // Such message can be sent at most once in a particular Envoy ext_proc filter processing state. + // To enable this API, one has to set “max_message_timeout“ to a number >= 1ms. + OverrideMessageTimeout *duration.Duration `protobuf:"bytes,10,opt,name=override_message_timeout,json=overrideMessageTimeout,proto3" json:"override_message_timeout,omitempty"` +} + +func (x *ProcessingResponse) Reset() { + *x = ProcessingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProcessingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProcessingResponse) ProtoMessage() {} + +func (x *ProcessingResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProcessingResponse.ProtoReflect.Descriptor instead. +func (*ProcessingResponse) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{1} +} + +func (m *ProcessingResponse) GetResponse() isProcessingResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *ProcessingResponse) GetRequestHeaders() *HeadersResponse { + if x, ok := x.GetResponse().(*ProcessingResponse_RequestHeaders); ok { + return x.RequestHeaders + } + return nil +} + +func (x *ProcessingResponse) GetResponseHeaders() *HeadersResponse { + if x, ok := x.GetResponse().(*ProcessingResponse_ResponseHeaders); ok { + return x.ResponseHeaders + } + return nil +} + +func (x *ProcessingResponse) GetRequestBody() *BodyResponse { + if x, ok := x.GetResponse().(*ProcessingResponse_RequestBody); ok { + return x.RequestBody + } + return nil +} + +func (x *ProcessingResponse) GetResponseBody() *BodyResponse { + if x, ok := x.GetResponse().(*ProcessingResponse_ResponseBody); ok { + return x.ResponseBody + } + return nil +} + +func (x *ProcessingResponse) GetRequestTrailers() *TrailersResponse { + if x, ok := x.GetResponse().(*ProcessingResponse_RequestTrailers); ok { + return x.RequestTrailers + } + return nil +} + +func (x *ProcessingResponse) GetResponseTrailers() *TrailersResponse { + if x, ok := x.GetResponse().(*ProcessingResponse_ResponseTrailers); ok { + return x.ResponseTrailers + } + return nil +} + +func (x *ProcessingResponse) GetImmediateResponse() *ImmediateResponse { + if x, ok := x.GetResponse().(*ProcessingResponse_ImmediateResponse); ok { + return x.ImmediateResponse + } + return nil +} + +func (x *ProcessingResponse) GetDynamicMetadata() *_struct.Struct { + if x != nil { + return x.DynamicMetadata + } + return nil +} + +func (x *ProcessingResponse) GetModeOverride() *v3.ProcessingMode { + if x != nil { + return x.ModeOverride + } + return nil +} + +func (x *ProcessingResponse) GetOverrideMessageTimeout() *duration.Duration { + if x != nil { + return x.OverrideMessageTimeout + } + return nil +} + +type isProcessingResponse_Response interface { + isProcessingResponse_Response() +} + +type ProcessingResponse_RequestHeaders struct { + // The server must send back this message in response to a message with the + // “request_headers“ field set. + RequestHeaders *HeadersResponse `protobuf:"bytes,1,opt,name=request_headers,json=requestHeaders,proto3,oneof"` +} + +type ProcessingResponse_ResponseHeaders struct { + // The server must send back this message in response to a message with the + // “response_headers“ field set. + ResponseHeaders *HeadersResponse `protobuf:"bytes,2,opt,name=response_headers,json=responseHeaders,proto3,oneof"` +} + +type ProcessingResponse_RequestBody struct { + // The server must send back this message in response to a message with + // the “request_body“ field set. + RequestBody *BodyResponse `protobuf:"bytes,3,opt,name=request_body,json=requestBody,proto3,oneof"` +} + +type ProcessingResponse_ResponseBody struct { + // The server must send back this message in response to a message with + // the “response_body“ field set. + ResponseBody *BodyResponse `protobuf:"bytes,4,opt,name=response_body,json=responseBody,proto3,oneof"` +} + +type ProcessingResponse_RequestTrailers struct { + // The server must send back this message in response to a message with + // the “request_trailers“ field set. + RequestTrailers *TrailersResponse `protobuf:"bytes,5,opt,name=request_trailers,json=requestTrailers,proto3,oneof"` +} + +type ProcessingResponse_ResponseTrailers struct { + // The server must send back this message in response to a message with + // the “response_trailers“ field set. + ResponseTrailers *TrailersResponse `protobuf:"bytes,6,opt,name=response_trailers,json=responseTrailers,proto3,oneof"` +} + +type ProcessingResponse_ImmediateResponse struct { + // If specified, attempt to create a locally generated response, send it + // downstream, and stop processing additional filters and ignore any + // additional messages received from the remote server for this request or + // response. If a response has already started -- for example, if this + // message is sent response to a “response_body“ message -- then + // this will either ship the reply directly to the downstream codec, + // or reset the stream. + ImmediateResponse *ImmediateResponse `protobuf:"bytes,7,opt,name=immediate_response,json=immediateResponse,proto3,oneof"` +} + +func (*ProcessingResponse_RequestHeaders) isProcessingResponse_Response() {} + +func (*ProcessingResponse_ResponseHeaders) isProcessingResponse_Response() {} + +func (*ProcessingResponse_RequestBody) isProcessingResponse_Response() {} + +func (*ProcessingResponse_ResponseBody) isProcessingResponse_Response() {} + +func (*ProcessingResponse_RequestTrailers) isProcessingResponse_Response() {} + +func (*ProcessingResponse_ResponseTrailers) isProcessingResponse_Response() {} + +func (*ProcessingResponse_ImmediateResponse) isProcessingResponse_Response() {} + +// This message is sent to the external server when the HTTP request and responses +// are first received. +type HttpHeaders struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The HTTP request headers. All header keys will be + // lower-cased, because HTTP header keys are case-insensitive. + // The “headers“ encoding is based on the runtime guard + // envoy_reloadable_features_send_header_raw_value setting. + // When it is true, the header value is encoded in the + // :ref:`raw_value ` field. + // When it is false, the header value is encoded in the + // :ref:`value ` field. + Headers *v31.HeaderMap `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers,omitempty"` + // [#not-implemented-hide:] + // The values of properties selected by the “request_attributes“ + // or “response_attributes“ list in the configuration. Each entry + // in the list is populated + // from the standard :ref:`attributes ` + // supported across Envoy. + Attributes map[string]*_struct.Struct `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // If true, then there is no message body associated with this + // request or response. + EndOfStream bool `protobuf:"varint,3,opt,name=end_of_stream,json=endOfStream,proto3" json:"end_of_stream,omitempty"` +} + +func (x *HttpHeaders) Reset() { + *x = HttpHeaders{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HttpHeaders) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HttpHeaders) ProtoMessage() {} + +func (x *HttpHeaders) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HttpHeaders.ProtoReflect.Descriptor instead. +func (*HttpHeaders) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{2} +} + +func (x *HttpHeaders) GetHeaders() *v31.HeaderMap { + if x != nil { + return x.Headers + } + return nil +} + +func (x *HttpHeaders) GetAttributes() map[string]*_struct.Struct { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *HttpHeaders) GetEndOfStream() bool { + if x != nil { + return x.EndOfStream + } + return false +} + +// This message contains the message body that Envoy sends to the external server. +type HttpBody struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Body []byte `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + EndOfStream bool `protobuf:"varint,2,opt,name=end_of_stream,json=endOfStream,proto3" json:"end_of_stream,omitempty"` +} + +func (x *HttpBody) Reset() { + *x = HttpBody{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HttpBody) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HttpBody) ProtoMessage() {} + +func (x *HttpBody) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HttpBody.ProtoReflect.Descriptor instead. +func (*HttpBody) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{3} +} + +func (x *HttpBody) GetBody() []byte { + if x != nil { + return x.Body + } + return nil +} + +func (x *HttpBody) GetEndOfStream() bool { + if x != nil { + return x.EndOfStream + } + return false +} + +// This message contains the trailers. +type HttpTrailers struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The “trailers“ encoding is based on the runtime guard + // envoy_reloadable_features_send_header_raw_value setting. + // When it is true, the header value is encoded in the + // :ref:`raw_value ` field. + // When it is false, the header value is encoded in the + // :ref:`value ` field. + Trailers *v31.HeaderMap `protobuf:"bytes,1,opt,name=trailers,proto3" json:"trailers,omitempty"` +} + +func (x *HttpTrailers) Reset() { + *x = HttpTrailers{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HttpTrailers) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HttpTrailers) ProtoMessage() {} + +func (x *HttpTrailers) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HttpTrailers.ProtoReflect.Descriptor instead. +func (*HttpTrailers) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{4} +} + +func (x *HttpTrailers) GetTrailers() *v31.HeaderMap { + if x != nil { + return x.Trailers + } + return nil +} + +// This message must be sent in response to an HttpHeaders message. +type HeadersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Response *CommonResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *HeadersResponse) Reset() { + *x = HeadersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeadersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeadersResponse) ProtoMessage() {} + +func (x *HeadersResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeadersResponse.ProtoReflect.Descriptor instead. +func (*HeadersResponse) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{5} +} + +func (x *HeadersResponse) GetResponse() *CommonResponse { + if x != nil { + return x.Response + } + return nil +} + +// This message must be sent in response to an HttpTrailers message. +type TrailersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Instructions on how to manipulate the trailers + HeaderMutation *HeaderMutation `protobuf:"bytes,1,opt,name=header_mutation,json=headerMutation,proto3" json:"header_mutation,omitempty"` +} + +func (x *TrailersResponse) Reset() { + *x = TrailersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrailersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrailersResponse) ProtoMessage() {} + +func (x *TrailersResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TrailersResponse.ProtoReflect.Descriptor instead. +func (*TrailersResponse) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{6} +} + +func (x *TrailersResponse) GetHeaderMutation() *HeaderMutation { + if x != nil { + return x.HeaderMutation + } + return nil +} + +// This message must be sent in response to an HttpBody message. +type BodyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Response *CommonResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *BodyResponse) Reset() { + *x = BodyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BodyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BodyResponse) ProtoMessage() {} + +func (x *BodyResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BodyResponse.ProtoReflect.Descriptor instead. +func (*BodyResponse) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{7} +} + +func (x *BodyResponse) GetResponse() *CommonResponse { + if x != nil { + return x.Response + } + return nil +} + +// This message contains common fields between header and body responses. +// [#next-free-field: 6] +type CommonResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // If set, provide additional direction on how the Envoy proxy should + // handle the rest of the HTTP filter chain. + Status CommonResponse_ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=envoy.service.ext_proc.v3.CommonResponse_ResponseStatus" json:"status,omitempty"` + // Instructions on how to manipulate the headers. When responding to an + // HttpBody request, header mutations will only take effect if + // the current processing mode for the body is BUFFERED. + HeaderMutation *HeaderMutation `protobuf:"bytes,2,opt,name=header_mutation,json=headerMutation,proto3" json:"header_mutation,omitempty"` + // Replace the body of the last message sent to the remote server on this + // stream. If responding to an HttpBody request, simply replace or clear + // the body chunk that was sent with that request. Body mutations may take + // effect in response either to “header“ or “body“ messages. When it is + // in response to “header“ messages, it only take effect if the + // :ref:`status ` + // is set to CONTINUE_AND_REPLACE. + BodyMutation *BodyMutation `protobuf:"bytes,3,opt,name=body_mutation,json=bodyMutation,proto3" json:"body_mutation,omitempty"` + // [#not-implemented-hide:] + // Add new trailers to the message. This may be used when responding to either a + // HttpHeaders or HttpBody message, but only if this message is returned + // along with the CONTINUE_AND_REPLACE status. + // The “trailers“ encoding is based on the runtime guard + // envoy_reloadable_features_send_header_raw_value setting. + // When it is true, the header value is encoded in the + // :ref:`raw_value ` field. + // When it is false, the header value is encoded in the + // :ref:`value ` field. + Trailers *v31.HeaderMap `protobuf:"bytes,4,opt,name=trailers,proto3" json:"trailers,omitempty"` + // Clear the route cache for the current client request. This is necessary + // if the remote server modified headers that are used to calculate the route. + // This field is ignored in the response direction. + ClearRouteCache bool `protobuf:"varint,5,opt,name=clear_route_cache,json=clearRouteCache,proto3" json:"clear_route_cache,omitempty"` +} + +func (x *CommonResponse) Reset() { + *x = CommonResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommonResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommonResponse) ProtoMessage() {} + +func (x *CommonResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommonResponse.ProtoReflect.Descriptor instead. +func (*CommonResponse) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{8} +} + +func (x *CommonResponse) GetStatus() CommonResponse_ResponseStatus { + if x != nil { + return x.Status + } + return CommonResponse_CONTINUE +} + +func (x *CommonResponse) GetHeaderMutation() *HeaderMutation { + if x != nil { + return x.HeaderMutation + } + return nil +} + +func (x *CommonResponse) GetBodyMutation() *BodyMutation { + if x != nil { + return x.BodyMutation + } + return nil +} + +func (x *CommonResponse) GetTrailers() *v31.HeaderMap { + if x != nil { + return x.Trailers + } + return nil +} + +func (x *CommonResponse) GetClearRouteCache() bool { + if x != nil { + return x.ClearRouteCache + } + return false +} + +// This message causes the filter to attempt to create a locally +// generated response, send it downstream, stop processing +// additional filters, and ignore any additional messages received +// from the remote server for this request or response. If a response +// has already started, then this will either ship the reply directly +// to the downstream codec, or reset the stream. +// [#next-free-field: 6] +type ImmediateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The response code to return + Status *v32.HttpStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + // Apply changes to the default headers, which will include content-type. + Headers *HeaderMutation `protobuf:"bytes,2,opt,name=headers,proto3" json:"headers,omitempty"` + // The message body to return with the response which is sent using the + // text/plain content type, or encoded in the grpc-message header. + Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` + // If set, then include a gRPC status trailer. + GrpcStatus *GrpcStatus `protobuf:"bytes,4,opt,name=grpc_status,json=grpcStatus,proto3" json:"grpc_status,omitempty"` + // A string detailing why this local reply was sent, which may be included + // in log and debug output (e.g. this populates the %RESPONSE_CODE_DETAILS% + // command operator field for use in access logging). + Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"` +} + +func (x *ImmediateResponse) Reset() { + *x = ImmediateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImmediateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImmediateResponse) ProtoMessage() {} + +func (x *ImmediateResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImmediateResponse.ProtoReflect.Descriptor instead. +func (*ImmediateResponse) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{9} +} + +func (x *ImmediateResponse) GetStatus() *v32.HttpStatus { + if x != nil { + return x.Status + } + return nil +} + +func (x *ImmediateResponse) GetHeaders() *HeaderMutation { + if x != nil { + return x.Headers + } + return nil +} + +func (x *ImmediateResponse) GetBody() string { + if x != nil { + return x.Body + } + return "" +} + +func (x *ImmediateResponse) GetGrpcStatus() *GrpcStatus { + if x != nil { + return x.GrpcStatus + } + return nil +} + +func (x *ImmediateResponse) GetDetails() string { + if x != nil { + return x.Details + } + return "" +} + +// This message specifies a gRPC status for an ImmediateResponse message. +type GrpcStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The actual gRPC status + Status uint32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *GrpcStatus) Reset() { + *x = GrpcStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrpcStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrpcStatus) ProtoMessage() {} + +func (x *GrpcStatus) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GrpcStatus.ProtoReflect.Descriptor instead. +func (*GrpcStatus) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{10} +} + +func (x *GrpcStatus) GetStatus() uint32 { + if x != nil { + return x.Status + } + return 0 +} + +// Change HTTP headers or trailers by appending, replacing, or removing +// headers. +type HeaderMutation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Add or replace HTTP headers. Attempts to set the value of + // any “x-envoy“ header, and attempts to set the “:method“, + // “:authority“, “:scheme“, or “host“ headers will be ignored. + // The “set_headers“ encoding is based on the runtime guard + // envoy_reloadable_features_send_header_raw_value setting. + // When it is true, the header value is encoded in the + // :ref:`raw_value ` field. + // When it is false, the header value is encoded in the + // :ref:`value ` field. + SetHeaders []*v31.HeaderValueOption `protobuf:"bytes,1,rep,name=set_headers,json=setHeaders,proto3" json:"set_headers,omitempty"` + // Remove these HTTP headers. Attempts to remove system headers -- + // any header starting with “:“, plus “host“ -- will be ignored. + RemoveHeaders []string `protobuf:"bytes,2,rep,name=remove_headers,json=removeHeaders,proto3" json:"remove_headers,omitempty"` +} + +func (x *HeaderMutation) Reset() { + *x = HeaderMutation{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeaderMutation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeaderMutation) ProtoMessage() {} + +func (x *HeaderMutation) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeaderMutation.ProtoReflect.Descriptor instead. +func (*HeaderMutation) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{11} +} + +func (x *HeaderMutation) GetSetHeaders() []*v31.HeaderValueOption { + if x != nil { + return x.SetHeaders + } + return nil +} + +func (x *HeaderMutation) GetRemoveHeaders() []string { + if x != nil { + return x.RemoveHeaders + } + return nil +} + +// Replace the entire message body chunk received in the corresponding +// HttpBody message with this new body, or clear the body. +type BodyMutation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Mutation: + // + // *BodyMutation_Body + // *BodyMutation_ClearBody + Mutation isBodyMutation_Mutation `protobuf_oneof:"mutation"` +} + +func (x *BodyMutation) Reset() { + *x = BodyMutation{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BodyMutation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BodyMutation) ProtoMessage() {} + +func (x *BodyMutation) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BodyMutation.ProtoReflect.Descriptor instead. +func (*BodyMutation) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{12} +} + +func (m *BodyMutation) GetMutation() isBodyMutation_Mutation { + if m != nil { + return m.Mutation + } + return nil +} + +func (x *BodyMutation) GetBody() []byte { + if x, ok := x.GetMutation().(*BodyMutation_Body); ok { + return x.Body + } + return nil +} + +func (x *BodyMutation) GetClearBody() bool { + if x, ok := x.GetMutation().(*BodyMutation_ClearBody); ok { + return x.ClearBody + } + return false +} + +type isBodyMutation_Mutation interface { + isBodyMutation_Mutation() +} + +type BodyMutation_Body struct { + // The entire body to replace + Body []byte `protobuf:"bytes,1,opt,name=body,proto3,oneof"` +} + +type BodyMutation_ClearBody struct { + // Clear the corresponding body chunk + ClearBody bool `protobuf:"varint,2,opt,name=clear_body,json=clearBody,proto3,oneof"` +} + +func (*BodyMutation_Body) isBodyMutation_Mutation() {} + +func (*BodyMutation_ClearBody) isBodyMutation_Mutation() {} + +var File_envoy_service_ext_proc_v3_external_processor_proto protoreflect.FileDescriptor + +var file_envoy_service_ext_proc_v3_external_processor_proto_rawDesc = []byte{ + 0x0a, 0x32, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2f, 0x76, 0x33, 0x2f, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x1a, + 0x1f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x6f, + 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x3f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, + 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x63, + 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x76, 0x33, + 0x2f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x04, 0x0a, 0x11, 0x50, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x51, 0x0a, + 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, + 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x48, 0x00, + 0x52, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x12, 0x53, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, + 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x73, 0x48, 0x00, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x48, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, + 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x42, 0x6f, 0x64, 0x79, + 0x48, 0x00, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, + 0x4a, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x62, 0x6f, 0x64, 0x79, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, + 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x42, 0x6f, 0x64, 0x79, 0x48, 0x00, 0x52, 0x0c, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x54, 0x0a, 0x10, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, + 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x48, 0x00, + 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, + 0x73, 0x12, 0x56, 0x0a, 0x11, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x72, + 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, + 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, + 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x54, 0x72, 0x61, + 0x69, 0x6c, 0x65, 0x72, 0x73, 0x48, 0x00, 0x52, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x0e, 0x0a, 0x07, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x81, 0x07, 0x0a, 0x12, 0x50, 0x72, + 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x55, 0x0a, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x6e, 0x76, 0x6f, + 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, + 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x57, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, + 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x12, 0x4c, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6f, 0x64, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, + 0x76, 0x33, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, + 0x00, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x4e, + 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, + 0x33, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, + 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x58, + 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, + 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, + 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x5a, 0x0a, 0x11, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, + 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x48, 0x00, 0x52, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x72, 0x61, 0x69, + 0x6c, 0x65, 0x72, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, + 0x65, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6d, 0x6d, + 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, + 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x10, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x5e, 0x0a, 0x0d, 0x6d, 0x6f, 0x64, 0x65, 0x5f, + 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, + 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, + 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x0c, 0x6d, 0x6f, 0x64, 0x65, 0x4f, + 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x53, 0x0a, 0x18, 0x6f, 0x76, 0x65, 0x72, 0x72, + 0x69, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x16, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x42, 0x0f, 0x0a, 0x08, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x9c, 0x02, + 0x0a, 0x0b, 0x48, 0x74, 0x74, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x39, 0x0a, + 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x61, 0x70, 0x52, + 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x56, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, + 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, + 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x12, 0x22, 0x0a, 0x0d, 0x65, 0x6e, 0x64, 0x5f, 0x6f, 0x66, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x65, 0x6e, 0x64, 0x4f, 0x66, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x1a, 0x56, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x42, 0x0a, 0x08, + 0x48, 0x74, 0x74, 0x70, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x22, 0x0a, 0x0d, + 0x65, 0x6e, 0x64, 0x5f, 0x6f, 0x66, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0b, 0x65, 0x6e, 0x64, 0x4f, 0x66, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x22, 0x4b, 0x0a, 0x0c, 0x48, 0x74, 0x74, 0x70, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, + 0x12, 0x3b, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x4d, 0x61, 0x70, 0x52, 0x08, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x22, 0x58, 0x0a, + 0x0f, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x45, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x43, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x66, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x69, 0x6c, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0f, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, + 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x55, 0x0a, 0x0c, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x45, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb1, 0x03, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x38, 0x2e, 0x65, 0x6e, 0x76, 0x6f, + 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, + 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x52, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, + 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, + 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x0d, 0x62, 0x6f, 0x64, + 0x79, 0x5f, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x42, 0x6f, 0x64, + 0x79, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x62, 0x6f, 0x64, 0x79, 0x4d, + 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x69, 0x6c, + 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, + 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, + 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x61, 0x70, 0x52, 0x08, 0x74, 0x72, 0x61, 0x69, + 0x6c, 0x65, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x72, 0x6f, + 0x75, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, + 0x22, 0x38, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x4f, 0x4e, 0x54, 0x49, 0x4e, 0x55, 0x45, 0x10, 0x00, + 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4e, 0x54, 0x49, 0x4e, 0x55, 0x45, 0x5f, 0x41, 0x4e, 0x44, + 0x5f, 0x52, 0x45, 0x50, 0x4c, 0x41, 0x43, 0x45, 0x10, 0x01, 0x22, 0x8b, 0x02, 0x0a, 0x11, 0x49, + 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x3b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x33, + 0x2e, 0x48, 0x74, 0x74, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, + 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x43, 0x0a, + 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, + 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, + 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x0a, 0x67, 0x72, 0x70, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, + 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x24, 0x0a, 0x0a, 0x47, 0x72, 0x70, 0x63, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x81, + 0x01, 0x0a, 0x0e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x48, 0x0a, 0x0b, 0x73, 0x65, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0a, 0x73, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x72, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x73, 0x22, 0x51, 0x0a, 0x0c, 0x42, 0x6f, 0x64, 0x79, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x1f, 0x0a, 0x0a, 0x63, 0x6c, 0x65, 0x61, + 0x72, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, + 0x63, 0x6c, 0x65, 0x61, 0x72, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x0a, 0x0a, 0x08, 0x6d, 0x75, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x81, 0x01, 0x0a, 0x11, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x12, 0x6c, 0x0a, 0x07, 0x50, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, + 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, + 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x98, 0x01, 0xba, 0x80, 0xc8, 0xd1, + 0x06, 0x02, 0x10, 0x02, 0x0a, 0x27, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x42, 0x16, 0x45, + 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, + 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, + 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x65, 0x78, + 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2f, 0x76, 0x33, 0x3b, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, + 0x6f, 0x63, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_envoy_service_ext_proc_v3_external_processor_proto_rawDescOnce sync.Once + file_envoy_service_ext_proc_v3_external_processor_proto_rawDescData = file_envoy_service_ext_proc_v3_external_processor_proto_rawDesc +) + +func file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP() []byte { + file_envoy_service_ext_proc_v3_external_processor_proto_rawDescOnce.Do(func() { + file_envoy_service_ext_proc_v3_external_processor_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoy_service_ext_proc_v3_external_processor_proto_rawDescData) + }) + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescData +} + +var file_envoy_service_ext_proc_v3_external_processor_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_envoy_service_ext_proc_v3_external_processor_proto_goTypes = []interface{}{ + (CommonResponse_ResponseStatus)(0), // 0: envoy.service.ext_proc.v3.CommonResponse.ResponseStatus + (*ProcessingRequest)(nil), // 1: envoy.service.ext_proc.v3.ProcessingRequest + (*ProcessingResponse)(nil), // 2: envoy.service.ext_proc.v3.ProcessingResponse + (*HttpHeaders)(nil), // 3: envoy.service.ext_proc.v3.HttpHeaders + (*HttpBody)(nil), // 4: envoy.service.ext_proc.v3.HttpBody + (*HttpTrailers)(nil), // 5: envoy.service.ext_proc.v3.HttpTrailers + (*HeadersResponse)(nil), // 6: envoy.service.ext_proc.v3.HeadersResponse + (*TrailersResponse)(nil), // 7: envoy.service.ext_proc.v3.TrailersResponse + (*BodyResponse)(nil), // 8: envoy.service.ext_proc.v3.BodyResponse + (*CommonResponse)(nil), // 9: envoy.service.ext_proc.v3.CommonResponse + (*ImmediateResponse)(nil), // 10: envoy.service.ext_proc.v3.ImmediateResponse + (*GrpcStatus)(nil), // 11: envoy.service.ext_proc.v3.GrpcStatus + (*HeaderMutation)(nil), // 12: envoy.service.ext_proc.v3.HeaderMutation + (*BodyMutation)(nil), // 13: envoy.service.ext_proc.v3.BodyMutation + nil, // 14: envoy.service.ext_proc.v3.HttpHeaders.AttributesEntry + (*_struct.Struct)(nil), // 15: google.protobuf.Struct + (*v3.ProcessingMode)(nil), // 16: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + (*duration.Duration)(nil), // 17: google.protobuf.Duration + (*v31.HeaderMap)(nil), // 18: envoy.config.core.v3.HeaderMap + (*v32.HttpStatus)(nil), // 19: envoy.type.v3.HttpStatus + (*v31.HeaderValueOption)(nil), // 20: envoy.config.core.v3.HeaderValueOption +} +var file_envoy_service_ext_proc_v3_external_processor_proto_depIdxs = []int32{ + 3, // 0: envoy.service.ext_proc.v3.ProcessingRequest.request_headers:type_name -> envoy.service.ext_proc.v3.HttpHeaders + 3, // 1: envoy.service.ext_proc.v3.ProcessingRequest.response_headers:type_name -> envoy.service.ext_proc.v3.HttpHeaders + 4, // 2: envoy.service.ext_proc.v3.ProcessingRequest.request_body:type_name -> envoy.service.ext_proc.v3.HttpBody + 4, // 3: envoy.service.ext_proc.v3.ProcessingRequest.response_body:type_name -> envoy.service.ext_proc.v3.HttpBody + 5, // 4: envoy.service.ext_proc.v3.ProcessingRequest.request_trailers:type_name -> envoy.service.ext_proc.v3.HttpTrailers + 5, // 5: envoy.service.ext_proc.v3.ProcessingRequest.response_trailers:type_name -> envoy.service.ext_proc.v3.HttpTrailers + 6, // 6: envoy.service.ext_proc.v3.ProcessingResponse.request_headers:type_name -> envoy.service.ext_proc.v3.HeadersResponse + 6, // 7: envoy.service.ext_proc.v3.ProcessingResponse.response_headers:type_name -> envoy.service.ext_proc.v3.HeadersResponse + 8, // 8: envoy.service.ext_proc.v3.ProcessingResponse.request_body:type_name -> envoy.service.ext_proc.v3.BodyResponse + 8, // 9: envoy.service.ext_proc.v3.ProcessingResponse.response_body:type_name -> envoy.service.ext_proc.v3.BodyResponse + 7, // 10: envoy.service.ext_proc.v3.ProcessingResponse.request_trailers:type_name -> envoy.service.ext_proc.v3.TrailersResponse + 7, // 11: envoy.service.ext_proc.v3.ProcessingResponse.response_trailers:type_name -> envoy.service.ext_proc.v3.TrailersResponse + 10, // 12: envoy.service.ext_proc.v3.ProcessingResponse.immediate_response:type_name -> envoy.service.ext_proc.v3.ImmediateResponse + 15, // 13: envoy.service.ext_proc.v3.ProcessingResponse.dynamic_metadata:type_name -> google.protobuf.Struct + 16, // 14: envoy.service.ext_proc.v3.ProcessingResponse.mode_override:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + 17, // 15: envoy.service.ext_proc.v3.ProcessingResponse.override_message_timeout:type_name -> google.protobuf.Duration + 18, // 16: envoy.service.ext_proc.v3.HttpHeaders.headers:type_name -> envoy.config.core.v3.HeaderMap + 14, // 17: envoy.service.ext_proc.v3.HttpHeaders.attributes:type_name -> envoy.service.ext_proc.v3.HttpHeaders.AttributesEntry + 18, // 18: envoy.service.ext_proc.v3.HttpTrailers.trailers:type_name -> envoy.config.core.v3.HeaderMap + 9, // 19: envoy.service.ext_proc.v3.HeadersResponse.response:type_name -> envoy.service.ext_proc.v3.CommonResponse + 12, // 20: envoy.service.ext_proc.v3.TrailersResponse.header_mutation:type_name -> envoy.service.ext_proc.v3.HeaderMutation + 9, // 21: envoy.service.ext_proc.v3.BodyResponse.response:type_name -> envoy.service.ext_proc.v3.CommonResponse + 0, // 22: envoy.service.ext_proc.v3.CommonResponse.status:type_name -> envoy.service.ext_proc.v3.CommonResponse.ResponseStatus + 12, // 23: envoy.service.ext_proc.v3.CommonResponse.header_mutation:type_name -> envoy.service.ext_proc.v3.HeaderMutation + 13, // 24: envoy.service.ext_proc.v3.CommonResponse.body_mutation:type_name -> envoy.service.ext_proc.v3.BodyMutation + 18, // 25: envoy.service.ext_proc.v3.CommonResponse.trailers:type_name -> envoy.config.core.v3.HeaderMap + 19, // 26: envoy.service.ext_proc.v3.ImmediateResponse.status:type_name -> envoy.type.v3.HttpStatus + 12, // 27: envoy.service.ext_proc.v3.ImmediateResponse.headers:type_name -> envoy.service.ext_proc.v3.HeaderMutation + 11, // 28: envoy.service.ext_proc.v3.ImmediateResponse.grpc_status:type_name -> envoy.service.ext_proc.v3.GrpcStatus + 20, // 29: envoy.service.ext_proc.v3.HeaderMutation.set_headers:type_name -> envoy.config.core.v3.HeaderValueOption + 15, // 30: envoy.service.ext_proc.v3.HttpHeaders.AttributesEntry.value:type_name -> google.protobuf.Struct + 1, // 31: envoy.service.ext_proc.v3.ExternalProcessor.Process:input_type -> envoy.service.ext_proc.v3.ProcessingRequest + 2, // 32: envoy.service.ext_proc.v3.ExternalProcessor.Process:output_type -> envoy.service.ext_proc.v3.ProcessingResponse + 32, // [32:33] is the sub-list for method output_type + 31, // [31:32] is the sub-list for method input_type + 31, // [31:31] is the sub-list for extension type_name + 31, // [31:31] is the sub-list for extension extendee + 0, // [0:31] is the sub-list for field type_name +} + +func init() { file_envoy_service_ext_proc_v3_external_processor_proto_init() } +func file_envoy_service_ext_proc_v3_external_processor_proto_init() { + if File_envoy_service_ext_proc_v3_external_processor_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProcessingRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProcessingResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HttpHeaders); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HttpBody); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HttpTrailers); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeadersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrailersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BodyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommonResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImmediateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GrpcStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeaderMutation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BodyMutation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*ProcessingRequest_RequestHeaders)(nil), + (*ProcessingRequest_ResponseHeaders)(nil), + (*ProcessingRequest_RequestBody)(nil), + (*ProcessingRequest_ResponseBody)(nil), + (*ProcessingRequest_RequestTrailers)(nil), + (*ProcessingRequest_ResponseTrailers)(nil), + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*ProcessingResponse_RequestHeaders)(nil), + (*ProcessingResponse_ResponseHeaders)(nil), + (*ProcessingResponse_RequestBody)(nil), + (*ProcessingResponse_ResponseBody)(nil), + (*ProcessingResponse_RequestTrailers)(nil), + (*ProcessingResponse_ResponseTrailers)(nil), + (*ProcessingResponse_ImmediateResponse)(nil), + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[12].OneofWrappers = []interface{}{ + (*BodyMutation_Body)(nil), + (*BodyMutation_ClearBody)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_envoy_service_ext_proc_v3_external_processor_proto_rawDesc, + NumEnums: 1, + NumMessages: 14, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_envoy_service_ext_proc_v3_external_processor_proto_goTypes, + DependencyIndexes: file_envoy_service_ext_proc_v3_external_processor_proto_depIdxs, + EnumInfos: file_envoy_service_ext_proc_v3_external_processor_proto_enumTypes, + MessageInfos: file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes, + }.Build() + File_envoy_service_ext_proc_v3_external_processor_proto = out.File + file_envoy_service_ext_proc_v3_external_processor_proto_rawDesc = nil + file_envoy_service_ext_proc_v3_external_processor_proto_goTypes = nil + file_envoy_service_ext_proc_v3_external_processor_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// ExternalProcessorClient is the client API for ExternalProcessor service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ExternalProcessorClient interface { + // This begins the bidirectional stream that Envoy will use to + // give the server control over what the filter does. The actual + // protocol is described by the ProcessingRequest and ProcessingResponse + // messages below. + Process(ctx context.Context, opts ...grpc.CallOption) (ExternalProcessor_ProcessClient, error) +} + +type externalProcessorClient struct { + cc grpc.ClientConnInterface +} + +func NewExternalProcessorClient(cc grpc.ClientConnInterface) ExternalProcessorClient { + return &externalProcessorClient{cc} +} + +func (c *externalProcessorClient) Process(ctx context.Context, opts ...grpc.CallOption) (ExternalProcessor_ProcessClient, error) { + stream, err := c.cc.NewStream(ctx, &_ExternalProcessor_serviceDesc.Streams[0], "/envoy.service.ext_proc.v3.ExternalProcessor/Process", opts...) + if err != nil { + return nil, err + } + x := &externalProcessorProcessClient{stream} + return x, nil +} + +type ExternalProcessor_ProcessClient interface { + Send(*ProcessingRequest) error + Recv() (*ProcessingResponse, error) + grpc.ClientStream +} + +type externalProcessorProcessClient struct { + grpc.ClientStream +} + +func (x *externalProcessorProcessClient) Send(m *ProcessingRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *externalProcessorProcessClient) Recv() (*ProcessingResponse, error) { + m := new(ProcessingResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ExternalProcessorServer is the server API for ExternalProcessor service. +type ExternalProcessorServer interface { + // This begins the bidirectional stream that Envoy will use to + // give the server control over what the filter does. The actual + // protocol is described by the ProcessingRequest and ProcessingResponse + // messages below. + Process(ExternalProcessor_ProcessServer) error +} + +// UnimplementedExternalProcessorServer can be embedded to have forward compatible implementations. +type UnimplementedExternalProcessorServer struct { +} + +func (*UnimplementedExternalProcessorServer) Process(ExternalProcessor_ProcessServer) error { + return status.Errorf(codes.Unimplemented, "method Process not implemented") +} + +func RegisterExternalProcessorServer(s *grpc.Server, srv ExternalProcessorServer) { + s.RegisterService(&_ExternalProcessor_serviceDesc, srv) +} + +func _ExternalProcessor_Process_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ExternalProcessorServer).Process(&externalProcessorProcessServer{stream}) +} + +type ExternalProcessor_ProcessServer interface { + Send(*ProcessingResponse) error + Recv() (*ProcessingRequest, error) + grpc.ServerStream +} + +type externalProcessorProcessServer struct { + grpc.ServerStream +} + +func (x *externalProcessorProcessServer) Send(m *ProcessingResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *externalProcessorProcessServer) Recv() (*ProcessingRequest, error) { + m := new(ProcessingRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _ExternalProcessor_serviceDesc = grpc.ServiceDesc{ + ServiceName: "envoy.service.ext_proc.v3.ExternalProcessor", + HandlerType: (*ExternalProcessorServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Process", + Handler: _ExternalProcessor_Process_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "envoy/service/ext_proc/v3/external_processor.proto", +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.validate.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.validate.go new file mode 100644 index 000000000..b6215e8f9 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.validate.go @@ -0,0 +1,2467 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: envoy/service/ext_proc/v3/external_processor.proto + +package ext_procv3 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on ProcessingRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ProcessingRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ProcessingRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ProcessingRequestMultiError, or nil if none found. +func (m *ProcessingRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *ProcessingRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for AsyncMode + + oneofRequestPresent := false + switch v := m.Request.(type) { + case *ProcessingRequest_RequestHeaders: + if v == nil { + err := ProcessingRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofRequestPresent = true + + if all { + switch v := interface{}(m.GetRequestHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "RequestHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "RequestHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRequestHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "RequestHeaders", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingRequest_ResponseHeaders: + if v == nil { + err := ProcessingRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofRequestPresent = true + + if all { + switch v := interface{}(m.GetResponseHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "ResponseHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "ResponseHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponseHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "ResponseHeaders", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingRequest_RequestBody: + if v == nil { + err := ProcessingRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofRequestPresent = true + + if all { + switch v := interface{}(m.GetRequestBody()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "RequestBody", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "RequestBody", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRequestBody()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "RequestBody", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingRequest_ResponseBody: + if v == nil { + err := ProcessingRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofRequestPresent = true + + if all { + switch v := interface{}(m.GetResponseBody()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "ResponseBody", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "ResponseBody", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponseBody()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "ResponseBody", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingRequest_RequestTrailers: + if v == nil { + err := ProcessingRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofRequestPresent = true + + if all { + switch v := interface{}(m.GetRequestTrailers()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "RequestTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "RequestTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRequestTrailers()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "RequestTrailers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingRequest_ResponseTrailers: + if v == nil { + err := ProcessingRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofRequestPresent = true + + if all { + switch v := interface{}(m.GetResponseTrailers()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "ResponseTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "ResponseTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponseTrailers()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "ResponseTrailers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + if !oneofRequestPresent { + err := ProcessingRequestValidationError{ + field: "Request", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return ProcessingRequestMultiError(errors) + } + + return nil +} + +// ProcessingRequestMultiError is an error wrapping multiple validation errors +// returned by ProcessingRequest.ValidateAll() if the designated constraints +// aren't met. +type ProcessingRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ProcessingRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ProcessingRequestMultiError) AllErrors() []error { return m } + +// ProcessingRequestValidationError is the validation error returned by +// ProcessingRequest.Validate if the designated constraints aren't met. +type ProcessingRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ProcessingRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ProcessingRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ProcessingRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ProcessingRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ProcessingRequestValidationError) ErrorName() string { + return "ProcessingRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e ProcessingRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sProcessingRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ProcessingRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ProcessingRequestValidationError{} + +// Validate checks the field values on ProcessingResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *ProcessingResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ProcessingResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ProcessingResponseMultiError, or nil if none found. +func (m *ProcessingResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ProcessingResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetDynamicMetadata()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "DynamicMetadata", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "DynamicMetadata", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDynamicMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "DynamicMetadata", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetModeOverride()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ModeOverride", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ModeOverride", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetModeOverride()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "ModeOverride", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetOverrideMessageTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "OverrideMessageTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "OverrideMessageTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetOverrideMessageTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "OverrideMessageTimeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + oneofResponsePresent := false + switch v := m.Response.(type) { + case *ProcessingResponse_RequestHeaders: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetRequestHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "RequestHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "RequestHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRequestHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "RequestHeaders", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingResponse_ResponseHeaders: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetResponseHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ResponseHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ResponseHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponseHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "ResponseHeaders", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingResponse_RequestBody: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetRequestBody()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "RequestBody", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "RequestBody", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRequestBody()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "RequestBody", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingResponse_ResponseBody: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetResponseBody()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ResponseBody", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ResponseBody", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponseBody()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "ResponseBody", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingResponse_RequestTrailers: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetRequestTrailers()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "RequestTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "RequestTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRequestTrailers()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "RequestTrailers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingResponse_ResponseTrailers: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetResponseTrailers()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ResponseTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ResponseTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponseTrailers()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "ResponseTrailers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingResponse_ImmediateResponse: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetImmediateResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ImmediateResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ImmediateResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetImmediateResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "ImmediateResponse", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + if !oneofResponsePresent { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return ProcessingResponseMultiError(errors) + } + + return nil +} + +// ProcessingResponseMultiError is an error wrapping multiple validation errors +// returned by ProcessingResponse.ValidateAll() if the designated constraints +// aren't met. +type ProcessingResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ProcessingResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ProcessingResponseMultiError) AllErrors() []error { return m } + +// ProcessingResponseValidationError is the validation error returned by +// ProcessingResponse.Validate if the designated constraints aren't met. +type ProcessingResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ProcessingResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ProcessingResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ProcessingResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ProcessingResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ProcessingResponseValidationError) ErrorName() string { + return "ProcessingResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ProcessingResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sProcessingResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ProcessingResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ProcessingResponseValidationError{} + +// Validate checks the field values on HttpHeaders with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *HttpHeaders) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on HttpHeaders with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in HttpHeadersMultiError, or +// nil if none found. +func (m *HttpHeaders) ValidateAll() error { + return m.validate(true) +} + +func (m *HttpHeaders) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HttpHeadersValidationError{ + field: "Headers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HttpHeadersValidationError{ + field: "Headers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpHeadersValidationError{ + field: "Headers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + { + sorted_keys := make([]string, len(m.GetAttributes())) + i := 0 + for key := range m.GetAttributes() { + sorted_keys[i] = key + i++ + } + sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) + for _, key := range sorted_keys { + val := m.GetAttributes()[key] + _ = val + + // no validation rules for Attributes[key] + + if all { + switch v := interface{}(val).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HttpHeadersValidationError{ + field: fmt.Sprintf("Attributes[%v]", key), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HttpHeadersValidationError{ + field: fmt.Sprintf("Attributes[%v]", key), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpHeadersValidationError{ + field: fmt.Sprintf("Attributes[%v]", key), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + } + + // no validation rules for EndOfStream + + if len(errors) > 0 { + return HttpHeadersMultiError(errors) + } + + return nil +} + +// HttpHeadersMultiError is an error wrapping multiple validation errors +// returned by HttpHeaders.ValidateAll() if the designated constraints aren't met. +type HttpHeadersMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m HttpHeadersMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m HttpHeadersMultiError) AllErrors() []error { return m } + +// HttpHeadersValidationError is the validation error returned by +// HttpHeaders.Validate if the designated constraints aren't met. +type HttpHeadersValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HttpHeadersValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HttpHeadersValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HttpHeadersValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HttpHeadersValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HttpHeadersValidationError) ErrorName() string { return "HttpHeadersValidationError" } + +// Error satisfies the builtin error interface +func (e HttpHeadersValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHttpHeaders.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HttpHeadersValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HttpHeadersValidationError{} + +// Validate checks the field values on HttpBody with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *HttpBody) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on HttpBody with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in HttpBodyMultiError, or nil +// if none found. +func (m *HttpBody) ValidateAll() error { + return m.validate(true) +} + +func (m *HttpBody) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Body + + // no validation rules for EndOfStream + + if len(errors) > 0 { + return HttpBodyMultiError(errors) + } + + return nil +} + +// HttpBodyMultiError is an error wrapping multiple validation errors returned +// by HttpBody.ValidateAll() if the designated constraints aren't met. +type HttpBodyMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m HttpBodyMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m HttpBodyMultiError) AllErrors() []error { return m } + +// HttpBodyValidationError is the validation error returned by +// HttpBody.Validate if the designated constraints aren't met. +type HttpBodyValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HttpBodyValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HttpBodyValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HttpBodyValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HttpBodyValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HttpBodyValidationError) ErrorName() string { return "HttpBodyValidationError" } + +// Error satisfies the builtin error interface +func (e HttpBodyValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHttpBody.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HttpBodyValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HttpBodyValidationError{} + +// Validate checks the field values on HttpTrailers with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *HttpTrailers) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on HttpTrailers with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in HttpTrailersMultiError, or +// nil if none found. +func (m *HttpTrailers) ValidateAll() error { + return m.validate(true) +} + +func (m *HttpTrailers) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetTrailers()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HttpTrailersValidationError{ + field: "Trailers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HttpTrailersValidationError{ + field: "Trailers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTrailers()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpTrailersValidationError{ + field: "Trailers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return HttpTrailersMultiError(errors) + } + + return nil +} + +// HttpTrailersMultiError is an error wrapping multiple validation errors +// returned by HttpTrailers.ValidateAll() if the designated constraints aren't met. +type HttpTrailersMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m HttpTrailersMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m HttpTrailersMultiError) AllErrors() []error { return m } + +// HttpTrailersValidationError is the validation error returned by +// HttpTrailers.Validate if the designated constraints aren't met. +type HttpTrailersValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HttpTrailersValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HttpTrailersValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HttpTrailersValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HttpTrailersValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HttpTrailersValidationError) ErrorName() string { return "HttpTrailersValidationError" } + +// Error satisfies the builtin error interface +func (e HttpTrailersValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHttpTrailers.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HttpTrailersValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HttpTrailersValidationError{} + +// Validate checks the field values on HeadersResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *HeadersResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on HeadersResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// HeadersResponseMultiError, or nil if none found. +func (m *HeadersResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *HeadersResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeadersResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeadersResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeadersResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return HeadersResponseMultiError(errors) + } + + return nil +} + +// HeadersResponseMultiError is an error wrapping multiple validation errors +// returned by HeadersResponse.ValidateAll() if the designated constraints +// aren't met. +type HeadersResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m HeadersResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m HeadersResponseMultiError) AllErrors() []error { return m } + +// HeadersResponseValidationError is the validation error returned by +// HeadersResponse.Validate if the designated constraints aren't met. +type HeadersResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HeadersResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HeadersResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HeadersResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HeadersResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HeadersResponseValidationError) ErrorName() string { return "HeadersResponseValidationError" } + +// Error satisfies the builtin error interface +func (e HeadersResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHeadersResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HeadersResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HeadersResponseValidationError{} + +// Validate checks the field values on TrailersResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *TrailersResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on TrailersResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// TrailersResponseMultiError, or nil if none found. +func (m *TrailersResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *TrailersResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetHeaderMutation()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, TrailersResponseValidationError{ + field: "HeaderMutation", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, TrailersResponseValidationError{ + field: "HeaderMutation", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHeaderMutation()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TrailersResponseValidationError{ + field: "HeaderMutation", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return TrailersResponseMultiError(errors) + } + + return nil +} + +// TrailersResponseMultiError is an error wrapping multiple validation errors +// returned by TrailersResponse.ValidateAll() if the designated constraints +// aren't met. +type TrailersResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m TrailersResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m TrailersResponseMultiError) AllErrors() []error { return m } + +// TrailersResponseValidationError is the validation error returned by +// TrailersResponse.Validate if the designated constraints aren't met. +type TrailersResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e TrailersResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e TrailersResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e TrailersResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e TrailersResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e TrailersResponseValidationError) ErrorName() string { return "TrailersResponseValidationError" } + +// Error satisfies the builtin error interface +func (e TrailersResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sTrailersResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = TrailersResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = TrailersResponseValidationError{} + +// Validate checks the field values on BodyResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *BodyResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on BodyResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in BodyResponseMultiError, or +// nil if none found. +func (m *BodyResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *BodyResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BodyResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BodyResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BodyResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return BodyResponseMultiError(errors) + } + + return nil +} + +// BodyResponseMultiError is an error wrapping multiple validation errors +// returned by BodyResponse.ValidateAll() if the designated constraints aren't met. +type BodyResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m BodyResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m BodyResponseMultiError) AllErrors() []error { return m } + +// BodyResponseValidationError is the validation error returned by +// BodyResponse.Validate if the designated constraints aren't met. +type BodyResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e BodyResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e BodyResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e BodyResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e BodyResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e BodyResponseValidationError) ErrorName() string { return "BodyResponseValidationError" } + +// Error satisfies the builtin error interface +func (e BodyResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sBodyResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = BodyResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = BodyResponseValidationError{} + +// Validate checks the field values on CommonResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *CommonResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CommonResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in CommonResponseMultiError, +// or nil if none found. +func (m *CommonResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *CommonResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if _, ok := CommonResponse_ResponseStatus_name[int32(m.GetStatus())]; !ok { + err := CommonResponseValidationError{ + field: "Status", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetHeaderMutation()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CommonResponseValidationError{ + field: "HeaderMutation", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CommonResponseValidationError{ + field: "HeaderMutation", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHeaderMutation()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CommonResponseValidationError{ + field: "HeaderMutation", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetBodyMutation()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CommonResponseValidationError{ + field: "BodyMutation", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CommonResponseValidationError{ + field: "BodyMutation", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetBodyMutation()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CommonResponseValidationError{ + field: "BodyMutation", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetTrailers()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CommonResponseValidationError{ + field: "Trailers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CommonResponseValidationError{ + field: "Trailers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTrailers()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CommonResponseValidationError{ + field: "Trailers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for ClearRouteCache + + if len(errors) > 0 { + return CommonResponseMultiError(errors) + } + + return nil +} + +// CommonResponseMultiError is an error wrapping multiple validation errors +// returned by CommonResponse.ValidateAll() if the designated constraints +// aren't met. +type CommonResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CommonResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CommonResponseMultiError) AllErrors() []error { return m } + +// CommonResponseValidationError is the validation error returned by +// CommonResponse.Validate if the designated constraints aren't met. +type CommonResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CommonResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CommonResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CommonResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CommonResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CommonResponseValidationError) ErrorName() string { return "CommonResponseValidationError" } + +// Error satisfies the builtin error interface +func (e CommonResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCommonResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CommonResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CommonResponseValidationError{} + +// Validate checks the field values on ImmediateResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ImmediateResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ImmediateResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ImmediateResponseMultiError, or nil if none found. +func (m *ImmediateResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ImmediateResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetStatus() == nil { + err := ImmediateResponseValidationError{ + field: "Status", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetStatus()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ImmediateResponseValidationError{ + field: "Status", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ImmediateResponseValidationError{ + field: "Status", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetStatus()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ImmediateResponseValidationError{ + field: "Status", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ImmediateResponseValidationError{ + field: "Headers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ImmediateResponseValidationError{ + field: "Headers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ImmediateResponseValidationError{ + field: "Headers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Body + + if all { + switch v := interface{}(m.GetGrpcStatus()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ImmediateResponseValidationError{ + field: "GrpcStatus", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ImmediateResponseValidationError{ + field: "GrpcStatus", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGrpcStatus()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ImmediateResponseValidationError{ + field: "GrpcStatus", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Details + + if len(errors) > 0 { + return ImmediateResponseMultiError(errors) + } + + return nil +} + +// ImmediateResponseMultiError is an error wrapping multiple validation errors +// returned by ImmediateResponse.ValidateAll() if the designated constraints +// aren't met. +type ImmediateResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ImmediateResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ImmediateResponseMultiError) AllErrors() []error { return m } + +// ImmediateResponseValidationError is the validation error returned by +// ImmediateResponse.Validate if the designated constraints aren't met. +type ImmediateResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ImmediateResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ImmediateResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ImmediateResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ImmediateResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ImmediateResponseValidationError) ErrorName() string { + return "ImmediateResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ImmediateResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sImmediateResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ImmediateResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ImmediateResponseValidationError{} + +// Validate checks the field values on GrpcStatus with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *GrpcStatus) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GrpcStatus with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in GrpcStatusMultiError, or +// nil if none found. +func (m *GrpcStatus) ValidateAll() error { + return m.validate(true) +} + +func (m *GrpcStatus) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Status + + if len(errors) > 0 { + return GrpcStatusMultiError(errors) + } + + return nil +} + +// GrpcStatusMultiError is an error wrapping multiple validation errors +// returned by GrpcStatus.ValidateAll() if the designated constraints aren't met. +type GrpcStatusMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GrpcStatusMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GrpcStatusMultiError) AllErrors() []error { return m } + +// GrpcStatusValidationError is the validation error returned by +// GrpcStatus.Validate if the designated constraints aren't met. +type GrpcStatusValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GrpcStatusValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GrpcStatusValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GrpcStatusValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GrpcStatusValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GrpcStatusValidationError) ErrorName() string { return "GrpcStatusValidationError" } + +// Error satisfies the builtin error interface +func (e GrpcStatusValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGrpcStatus.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GrpcStatusValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GrpcStatusValidationError{} + +// Validate checks the field values on HeaderMutation with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *HeaderMutation) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on HeaderMutation with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in HeaderMutationMultiError, +// or nil if none found. +func (m *HeaderMutation) ValidateAll() error { + return m.validate(true) +} + +func (m *HeaderMutation) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetSetHeaders() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeaderMutationValidationError{ + field: fmt.Sprintf("SetHeaders[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeaderMutationValidationError{ + field: fmt.Sprintf("SetHeaders[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderMutationValidationError{ + field: fmt.Sprintf("SetHeaders[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return HeaderMutationMultiError(errors) + } + + return nil +} + +// HeaderMutationMultiError is an error wrapping multiple validation errors +// returned by HeaderMutation.ValidateAll() if the designated constraints +// aren't met. +type HeaderMutationMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m HeaderMutationMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m HeaderMutationMultiError) AllErrors() []error { return m } + +// HeaderMutationValidationError is the validation error returned by +// HeaderMutation.Validate if the designated constraints aren't met. +type HeaderMutationValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HeaderMutationValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HeaderMutationValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HeaderMutationValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HeaderMutationValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HeaderMutationValidationError) ErrorName() string { return "HeaderMutationValidationError" } + +// Error satisfies the builtin error interface +func (e HeaderMutationValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHeaderMutation.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HeaderMutationValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HeaderMutationValidationError{} + +// Validate checks the field values on BodyMutation with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *BodyMutation) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on BodyMutation with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in BodyMutationMultiError, or +// nil if none found. +func (m *BodyMutation) ValidateAll() error { + return m.validate(true) +} + +func (m *BodyMutation) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + switch v := m.Mutation.(type) { + case *BodyMutation_Body: + if v == nil { + err := BodyMutationValidationError{ + field: "Mutation", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + // no validation rules for Body + case *BodyMutation_ClearBody: + if v == nil { + err := BodyMutationValidationError{ + field: "Mutation", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + // no validation rules for ClearBody + default: + _ = v // ensures v is used + } + + if len(errors) > 0 { + return BodyMutationMultiError(errors) + } + + return nil +} + +// BodyMutationMultiError is an error wrapping multiple validation errors +// returned by BodyMutation.ValidateAll() if the designated constraints aren't met. +type BodyMutationMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m BodyMutationMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m BodyMutationMultiError) AllErrors() []error { return m } + +// BodyMutationValidationError is the validation error returned by +// BodyMutation.Validate if the designated constraints aren't met. +type BodyMutationValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e BodyMutationValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e BodyMutationValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e BodyMutationValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e BodyMutationValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e BodyMutationValidationError) ErrorName() string { return "BodyMutationValidationError" } + +// Error satisfies the builtin error interface +func (e BodyMutationValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sBodyMutation.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = BodyMutationValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = BodyMutationValidationError{} diff --git a/vendor/modules.txt b/vendor/modules.txt index f3a4b579b..27492d99a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -85,9 +85,12 @@ github.com/dustin/go-humanize ## explicit; go 1.17 github.com/envoyproxy/go-control-plane/envoy/annotations github.com/envoyproxy/go-control-plane/envoy/api/v2/core +github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3 github.com/envoyproxy/go-control-plane/envoy/config/core/v3 +github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3 github.com/envoyproxy/go-control-plane/envoy/service/auth/v2 github.com/envoyproxy/go-control-plane/envoy/service/auth/v3 +github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3 github.com/envoyproxy/go-control-plane/envoy/type github.com/envoyproxy/go-control-plane/envoy/type/matcher github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3 From 5410748f8f37ba8078f5cef420cbdded7c6369a9 Mon Sep 17 00:00:00 2001 From: pweiber Date: Wed, 14 Aug 2024 11:56:33 -0300 Subject: [PATCH 03/10] Adding current setup for main/plugin and the code for the internal using the ext_proc server --- cmd/opa-envoy-plugin/main.go | 5 +- internal/internal.go | 366 ++++++++++++++++++++++++++++++++++- plugin/plugin.go | 2 +- 3 files changed, 367 insertions(+), 6 deletions(-) diff --git a/cmd/opa-envoy-plugin/main.go b/cmd/opa-envoy-plugin/main.go index 1df7f7880..540e58b7a 100644 --- a/cmd/opa-envoy-plugin/main.go +++ b/cmd/opa-envoy-plugin/main.go @@ -7,13 +7,14 @@ package main import ( "os" - "github.com/open-policy-agent/opa-envoy-plugin/plugin" "github.com/open-policy-agent/opa/cmd" "github.com/open-policy-agent/opa/runtime" + + "github.com/open-policy-agent/opa-envoy-plugin/plugin" ) func main() { - runtime.RegisterPlugin("envoy.ext_authz.grpc", plugin.Factory{}) // for backwards compatibility + //runtime.RegisterPlugin("envoy.ext_authz.grpc", plugin.Factory{}) // for backwards compatibility runtime.RegisterPlugin(plugin.PluginName, plugin.Factory{}) if err := cmd.RootCommand.Execute(); err != nil { diff --git a/internal/internal.go b/internal/internal.go index a133d08bb..0b49989f2 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -20,6 +20,7 @@ import ( ext_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" ext_authz_v2 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v2" ext_authz_v3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3" + ext_proc_v3 "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" ext_type_v2 "github.com/envoyproxy/go-control-plane/envoy/type" ext_type_v3 "github.com/envoyproxy/go-control-plane/envoy/type/v3" "github.com/pkg/errors" @@ -51,13 +52,14 @@ import ( _structpb "github.com/golang/protobuf/ptypes/struct" "github.com/open-policy-agent/opa-envoy-plugin/envoyauth" + "github.com/open-policy-agent/opa-envoy-plugin/envoyextproc" internal_util "github.com/open-policy-agent/opa-envoy-plugin/internal/util" "github.com/open-policy-agent/opa-envoy-plugin/opa/decisionlog" ) const ( - defaultAddr = ":9191" - defaultPath = "envoy/authz/allow" + defaultAddr = ":9292" + defaultPath = "envoy.service.ext_proc.v3.ExternalProcessor/Process" defaultDryRun = false defaultEnableReflection = false defaultSkipRequestBodyParse = false @@ -69,7 +71,8 @@ const ( defaultGRPCServerMaxSendMessageSize = math.MaxInt32 // PluginName is the name to register with the OPA plugin manager - PluginName = "envoy_ext_authz_grpc" + //PluginName = "envoy_ext_authz_grpc" + PluginName = "envoy_ext_proc_grpc" ) var defaultGRPCRequestDurationSecondsBuckets = []float64{ @@ -698,3 +701,360 @@ func v2Status(s *ext_type_v3.HttpStatus) *ext_type_v2.HttpStatus { Code: ext_type_v2.StatusCode(s.Code), } } + +// envoyExtProcGrpcServer represents the ext_proc gRPC server implementation. +type envoyExtProcGrpcServer struct { + cfg Config + server *grpc.Server + manager *plugins.Manager + preparedQuery *rego.PreparedEvalQuery + preparedQueryDoOnce *sync.Once + interQueryBuiltinCache iCache.InterQueryCache + distributedTracingOpts tracing.Options + metricExtProcDuration prometheus.HistogramVec + metricErrorCounter prometheus.CounterVec +} + +// NewExtProc creates a new instance of the ext_proc gRPC server. +func NewExtProc(m *plugins.Manager, cfg *Config) plugins.Plugin { + grpcOpts := []grpc.ServerOption{ + grpc.MaxRecvMsgSize(cfg.GRPCMaxRecvMsgSize), + grpc.MaxSendMsgSize(cfg.GRPCMaxSendMsgSize), + } + + var distributedTracingOpts tracing.Options = nil + if m.TracerProvider() != nil { + grpcTracingOption := []otelgrpc.Option{ + otelgrpc.WithTracerProvider(m.TracerProvider()), + otelgrpc.WithPropagators(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}, b3.New(b3.WithInjectEncoding(b3.B3MultipleHeader|b3.B3SingleHeader)))), + } + distributedTracingOpts = tracing.NewOptions( + otelhttp.WithTracerProvider(m.TracerProvider()), + otelhttp.WithPropagators(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}, b3.New(b3.WithInjectEncoding(b3.B3MultipleHeader|b3.B3SingleHeader)))), + ) + grpcOpts = append(grpcOpts, + grpc.UnaryInterceptor(otelgrpc.UnaryServerInterceptor(grpcTracingOption...)), + grpc.StreamInterceptor(otelgrpc.StreamServerInterceptor(grpcTracingOption...)), + ) + } + + plugin := &envoyExtProcGrpcServer{ + manager: m, + cfg: *cfg, + server: grpc.NewServer(grpcOpts...), + preparedQueryDoOnce: new(sync.Once), + interQueryBuiltinCache: iCache.NewInterQueryCache(m.InterQueryBuiltinCacheConfig()), + distributedTracingOpts: distributedTracingOpts, + } + + // Register External Processor Server + ext_proc_v3.RegisterExternalProcessorServer(plugin.server, plugin) + + m.RegisterCompilerTrigger(plugin.compilerUpdated) + + // Register reflection service on gRPC server + if cfg.EnableReflection { + reflection.Register(plugin.server) + } + if cfg.EnablePerformanceMetrics { + histogramExtProcDuration := prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "grpc_request_duration_seconds", + Help: "A histogram of duration for grpc extproc requests.", + Buckets: cfg.GRPCRequestDurationSecondsBuckets, + }, []string{"handler"}) + plugin.metricExtProcDuration = *histogramExtProcDuration + errorCounter := prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "error_counter", + Help: "A counter for errors", + }, []string{"reason"}) + plugin.metricErrorCounter = *errorCounter + plugin.manager.PrometheusRegister().MustRegister(histogramExtProcDuration) + plugin.manager.PrometheusRegister().MustRegister(errorCounter) + } + + m.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) + + return plugin +} + +// Start starts the gRPC server for the ext_proc plugin. +func (p *envoyExtProcGrpcServer) Start(ctx context.Context) error { + p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) + go p.listen() + return nil +} + +// Stop stops the gRPC server for the ext_proc plugin. +func (p *envoyExtProcGrpcServer) Stop(ctx context.Context) { + p.server.Stop() + p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) +} + +// Reconfigure is not implemented for this plugin. +func (p *envoyExtProcGrpcServer) Reconfigure(ctx context.Context, config interface{}) { + return +} + +func (p *envoyExtProcGrpcServer) listen() { + logger := p.manager.Logger() + addr := p.cfg.Addr + if !strings.Contains(addr, "://") { + addr = "grpc://" + addr + } + + parsedURL, err := url.Parse(addr) + if err != nil { + logger.WithFields(map[string]interface{}{"err": err}).Error("Unable to parse URL.") + return + } + + var l net.Listener + + switch parsedURL.Scheme { + case "unix": + socketPath := parsedURL.Host + parsedURL.Path + if strings.HasPrefix(parsedURL.String(), parsedURL.Scheme+"://@") { + socketPath = "@" + socketPath + } else { + os.Remove(socketPath) + } + l, err = net.Listen("unix", socketPath) + case "grpc": + l, err = net.Listen("tcp", parsedURL.Host) + default: + err = fmt.Errorf("invalid URL scheme %q", parsedURL.Scheme) + } + + if err != nil { + logger.WithFields(map[string]interface{}{"err": err}).Error("Unable to create listener.") + } + + logger.WithFields(map[string]interface{}{ + "addr": p.cfg.Addr, + "query": p.cfg.Query, + "path": p.cfg.Path, + "dry-run": p.cfg.DryRun, + "enable-reflection": p.cfg.EnableReflection, + }).Info("Starting gRPC server.") + + p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateOK}) + + if err := p.server.Serve(l); err != nil { + logger.WithFields(map[string]interface{}{"err": err}).Error("Listener failed.") + return + } + + logger.Info("Listener exited.") + p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) +} + +// Process handles the processing of incoming ext_proc requests. +func (p *envoyExtProcGrpcServer) Process(stream ext_proc_v3.ExternalProcessor_ProcessServer) error { + logger := p.manager.Logger() + logger.Info("Processing incoming stream") + + for { + req, err := stream.Recv() + if err != nil { + logger.Error(fmt.Sprintf("Failed to receive request: %v", err)) + return err + } + + logger.Info(fmt.Sprintf("Received request: %v", req)) + + start := time.Now() + + logger.Info("LOG - Step 1") + // Initialize evaluation result + result, _, err := envoyextproc.NewExtProcEvalResult() + if err != nil { + logger.WithFields(map[string]interface{}{"err": err}).Error("Unable to start new evaluation.") + return err + } + + logger.Info("LOG - Step 2") + // Start a new storage transaction + txn, txnClose, err := result.GetTxn(stream.Context(), p.Store()) + if err != nil { + logger.WithFields(map[string]interface{}{"err": err}).Error("Unable to start new storage transaction.") + return err + } + defer txnClose(stream.Context(), err) + result.Txn = txn + + logger.Info("LOG - Step 3") + logger.Info(fmt.Sprintf("req: %v", req)) + + // Convert request to input + input, err := RequestToInput(req, logger, p.cfg.protoSet, p.cfg.SkipRequestBodyParse) + if err != nil { + return err + } + + input = map[string]interface{}{ + "request_headers": map[string]interface{}{ + "headers": map[string]interface{}{ + "headers": []map[string]interface{}{ + { + "key": "some-key", + "raw_value": "some-value", + }, + }, + }, + }, + } + + logger.Info(fmt.Sprintf("input: %v", input)) + + logger.Info("LOG - Step 4") + + if stream.Context().Err() != nil { + err = errors.Wrap(stream.Context().Err(), "process request timed out before query execution") + return err + } + + logger.Info("LOG - Step 5") + + // Convert input to ast.Value + inputValue, err := ast.InterfaceToValue(input) + if err != nil { + return err + } + + logger.Info("LOG - Step 6") + logger.Info(fmt.Sprintf("Input to be evaluated: %v", inputValue)) + + // Evaluate the policy + if err = envoyextproc.ExtProcEval(stream.Context(), p, inputValue, result); err != nil { + return err + } + + logger.Info("LOG - Step 7") + + response := &ext_proc_v3.ProcessingResponse{} + + // Apply OPA evaluation results to the response + // Setting headers, status, etc., based on the decision + + // Send the response to the client + if err := stream.Send(response); err != nil { + logger.Error(fmt.Sprintf("Failed to send response: %v", err)) + return err + } + + // Log the total decision time + totalDecisionTime := time.Since(start) + if p.cfg.EnablePerformanceMetrics { + p.metricExtProcDuration.With(prometheus.Labels{"handler": "process"}).Observe(float64(totalDecisionTime.Seconds())) + } + + p.manager.Logger().WithFields(map[string]interface{}{ + "query": p.cfg.parsedQuery.String(), + "decision": result.Decision, + "err": err, + "txn": result.TxnID, + "metrics": result.Metrics.All(), + "total_decision_time": totalDecisionTime, + }).Debug("Returning policy decision.") + } +} + +// RequestToInput converts an incoming ext_proc request to an input map for policy evaluation. +func RequestToInput(req *ext_proc_v3.ProcessingRequest, logger logging.Logger, protoSet *protoregistry.Files, skipRequestBodyParse bool) (map[string]interface{}, error) { + // This is a placeholder implementation for now. + return map[string]interface{}{}, nil +} + +// compilerUpdated resets the prepared query when the compiler is updated. +func (p *envoyExtProcGrpcServer) compilerUpdated(txn storage.Transaction) { + p.preparedQueryDoOnce = new(sync.Once) +} + +// ParsedQuery returns the parsed query from the config. +func (p *envoyExtProcGrpcServer) ParsedQuery() ast.Body { + return p.cfg.parsedQuery +} + +// Store returns the storage.Store associated with the server. +func (p *envoyExtProcGrpcServer) Store() storage.Store { + return p.manager.Store +} + +// Compiler returns the AST compiler associated with the server. +func (p *envoyExtProcGrpcServer) Compiler() *ast.Compiler { + return p.manager.GetCompiler() +} + +// Config returns the OPA configuration. +func (p *envoyExtProcGrpcServer) Config() *config.Config { + return p.manager.Config +} + +// Runtime returns the runtime information for the OPA instance. +func (p *envoyExtProcGrpcServer) Runtime() *ast.Term { + return p.manager.Info +} + +// PreparedQueryDoOnce returns the sync.Once for the prepared query. +func (p *envoyExtProcGrpcServer) PreparedQueryDoOnce() *sync.Once { + return p.preparedQueryDoOnce +} + +// InterQueryBuiltinCache returns the inter-query cache. +func (p *envoyExtProcGrpcServer) InterQueryBuiltinCache() iCache.InterQueryCache { + return p.interQueryBuiltinCache +} + +// PreparedQuery returns the prepared evaluation query. +func (p *envoyExtProcGrpcServer) PreparedQuery() *rego.PreparedEvalQuery { + return p.preparedQuery +} + +// SetPreparedQuery sets the prepared evaluation query. +func (p *envoyExtProcGrpcServer) SetPreparedQuery(pq *rego.PreparedEvalQuery) { + p.preparedQuery = pq +} + +// Logger returns the logger associated with the OPA instance. +func (p *envoyExtProcGrpcServer) Logger() logging.Logger { + return p.manager.Logger() +} + +// DistributedTracing returns the distributed tracing options. +func (p *envoyExtProcGrpcServer) DistributedTracing() tracing.Options { + return p.distributedTracingOpts +} + +// Log logs the decision to the decision log. +func (p *envoyExtProcGrpcServer) log(ctx context.Context, input interface{}, result *envoyextproc.ExtProcEvalResult, err error) error { + info := &server.Info{ + Timestamp: time.Now(), + Input: &input, + } + + if p.cfg.Query != "" { + info.Query = p.cfg.Query + } + + if p.cfg.Path != "" { + info.Path = p.cfg.Path + } + + sctx := trace.SpanFromContext(ctx).SpanContext() + if sctx.IsValid() { + info.TraceID = sctx.TraceID().String() + info.SpanID = sctx.SpanID().String() + } + + if result.NDBuiltinCache != nil { + x, err := ast.JSON(result.NDBuiltinCache.AsValue()) + if err != nil { + return err + } + info.NDBuiltinCache = &x + } + + // Use the adapter to convert ExtProcEvalResult to EvalResult + adaptedResult := result.ToEnvoyAuthEvalResult() + return decisionlog.LogDecision(ctx, p.manager, info, adaptedResult, err) +} diff --git a/plugin/plugin.go b/plugin/plugin.go index 122469f33..1f63a0a67 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -18,7 +18,7 @@ const PluginName = internal.PluginName // New returns the object initialized with a valid plugin configuration. func (Factory) New(m *plugins.Manager, config interface{}) plugins.Plugin { - return internal.New(m, config.(*internal.Config)) + return internal.NewExtProc(m, config.(*internal.Config)) } // Validate returns a valid configuration to instantiate the plugin. From 92b9573647781de05f7c436d3cb88ab355655b13 Mon Sep 17 00:00:00 2001 From: pweiber Date: Wed, 13 Nov 2024 13:43:53 -0300 Subject: [PATCH 04/10] Updating eval, request and response files for ext_proc Signed-off-by: pweiber --- envoyextproc/evaluation.go | 129 ++++------ envoyextproc/request.go | 515 +++++++++++++++++++++++++++++++++---- envoyextproc/response.go | 502 ++++++++++++++++++------------------ 3 files changed, 750 insertions(+), 396 deletions(-) diff --git a/envoyextproc/evaluation.go b/envoyextproc/evaluation.go index 9468291fc..d4ea45c5a 100644 --- a/envoyextproc/evaluation.go +++ b/envoyextproc/evaluation.go @@ -3,13 +3,11 @@ package envoyextproc import ( "context" "fmt" - "sync" "github.com/open-policy-agent/opa/ast" "github.com/open-policy-agent/opa/bundle" "github.com/open-policy-agent/opa/config" "github.com/open-policy-agent/opa/logging" - "github.com/open-policy-agent/opa/metrics" "github.com/open-policy-agent/opa/rego" "github.com/open-policy-agent/opa/storage" "github.com/open-policy-agent/opa/topdown/builtins" @@ -18,29 +16,31 @@ import ( "github.com/open-policy-agent/opa/tracing" ) -// ExtProcEvalContext defines the interface for the evaluation context in the `ext_proc` context. -type ExtProcEvalContext interface { +// EvalContext - This is an SPI that has to be provided if the envoy external authorization +// is used from outside the plugin, i.e. as a Go module +type EvalContext interface { ParsedQuery() ast.Body Store() storage.Store Compiler() *ast.Compiler Runtime() *ast.Term - PreparedQueryDoOnce() *sync.Once InterQueryBuiltinCache() iCache.InterQueryCache - PreparedQuery() *rego.PreparedEvalQuery - SetPreparedQuery(*rego.PreparedEvalQuery) Logger() logging.Logger Config() *config.Config DistributedTracing() tracing.Options + CreatePreparedQueryOnce(opts PrepareQueryOpts) (*rego.PreparedEvalQuery, error) } -// ExtProcEval evaluates the input against the provided ExtProcEvalContext and yields a result. -func ExtProcEval(ctx context.Context, evalContext ExtProcEvalContext, input ast.Value, result *ExtProcEvalResult, opts ...func(*rego.Rego)) error { +// PrepareQueryOpts - Options to prepare a Rego query to be passed to the CreatePreparedQueryOnce method +type PrepareQueryOpts struct { + Opts []func(*rego.Rego) + PrepareOpts []rego.PrepareOption +} + +// Eval - Evaluates an input against a provided EvalContext and yields result +func Eval(ctx context.Context, evalContext EvalContext, input ast.Value, result *EvalResult, evalOpts ...rego.EvalOption) error { var err error logger := evalContext.Logger() - // Log when starting the evaluation process - logger.Info("Starting ExtProcEval") - if result.Txn == nil { var txn storage.Transaction var txnClose TransactionCloser @@ -51,14 +51,10 @@ func ExtProcEval(ctx context.Context, evalContext ExtProcEvalContext, input ast. } defer txnClose(ctx, err) result.Txn = txn - logger.Info("Started new transaction") } - // Log before retrieving revision information - logger.Info("Getting revision information") err = getRevision(ctx, evalContext.Store(), result.Txn, result) if err != nil { - logger.Error(fmt.Sprintf("Failed to get revision information: %v", err)) return err } @@ -68,54 +64,49 @@ func ExtProcEval(ctx context.Context, evalContext ExtProcEvalContext, input ast. "input": input, "query": evalContext.ParsedQuery().String(), "txn": result.TxnID, - }).Debug("Executing policy query") - - // Create a mock result set to simulate a policy evaluation result - mockResult := rego.ResultSet{ - { - Expressions: []*rego.ExpressionValue{ - { - Text: "mock_decision", - Value: "allowed", - }, + }).Debug("Executing policy query.") + + pq, err := evalContext.CreatePreparedQueryOnce( + PrepareQueryOpts{ + Opts: []func(*rego.Rego){ + rego.Metrics(result.Metrics), + rego.ParsedQuery(evalContext.ParsedQuery()), + rego.Compiler(evalContext.Compiler()), + rego.Store(evalContext.Store()), + rego.Transaction(result.Txn), + rego.Runtime(evalContext.Runtime()), + rego.EnablePrintStatements(true), + rego.DistributedTracingOpts(evalContext.DistributedTracing()), }, - }, + }) + if err != nil { + return err } - logger.Info("Using mock result set for policy evaluation") - rs := mockResult - - // Actual policy evaluation - /* - logger.Info("Constructing prepared query") - err = constructPreparedQuery(evalContext, result.Txn, result.Metrics, opts) - if err != nil { - logger.Error(fmt.Sprintf("Failed to construct prepared query: %v", err)) - return err - } - ph := extProcHook{logger: logger.WithFields(map[string]interface{}{"decision-id": result.DecisionID})} + ph := hook{logger: logger.WithFields(map[string]interface{}{"decision-id": result.DecisionID})} - var ndbCache builtins.NDBCache - if evalContext.Config().NDBuiltinCacheEnabled() { - ndbCache = builtins.NDBCache{} - } + var ndbCache builtins.NDBCache + if evalContext.Config().NDBuiltinCacheEnabled() { + ndbCache = builtins.NDBCache{} + } - logger.Info("Evaluating policy with prepared query") - rs, err = evalContext.PreparedQuery().Eval( - ctx, + evalOpts = append( + []rego.EvalOption{ rego.EvalParsedInput(input), rego.EvalTransaction(result.Txn), rego.EvalMetrics(result.Metrics), rego.EvalInterQueryBuiltinCache(evalContext.InterQueryBuiltinCache()), rego.EvalPrintHook(&ph), rego.EvalNDBuiltinCache(ndbCache), - ) + }, + evalOpts..., + ) - if err != nil { - logger.Error(fmt.Sprintf("Error during policy evaluation: %v", err)) - return err - } - */ + var rs rego.ResultSet + rs, err = pq.Eval( + ctx, + evalOpts..., + ) switch { case err != nil: @@ -126,37 +117,12 @@ func ExtProcEval(ctx context.Context, evalContext ExtProcEvalContext, input ast. return fmt.Errorf("multiple evaluation results") } - result.NDBuiltinCache = builtins.NDBCache{} + result.NDBuiltinCache = ndbCache result.Decision = rs[0].Expressions[0].Value - - logger.Info(fmt.Sprintf("Final decision: %v", result.Decision)) return nil } -// Constructing the prepared query -func constructPreparedQuery(evalContext ExtProcEvalContext, txn storage.Transaction, m metrics.Metrics, opts []func(*rego.Rego)) error { - var err error - var pq rego.PreparedEvalQuery - evalContext.PreparedQueryDoOnce().Do(func() { - opts = append(opts, - rego.Metrics(m), - rego.ParsedQuery(evalContext.ParsedQuery()), - rego.Compiler(evalContext.Compiler()), - rego.Store(evalContext.Store()), - rego.Transaction(txn), - rego.Runtime(evalContext.Runtime()), - rego.EnablePrintStatements(true), - rego.DistributedTracingOpts(evalContext.DistributedTracing()), - ) - - pq, err = rego.New(opts...).PrepareForEval(context.Background()) - evalContext.SetPreparedQuery(&pq) - }) - - return err -} - -func getRevision(ctx context.Context, store storage.Store, txn storage.Transaction, result *ExtProcEvalResult) error { +func getRevision(ctx context.Context, store storage.Store, txn storage.Transaction, result *EvalResult) error { revisions := map[string]string{} names, err := bundle.ReadBundleNamesFromStore(ctx, store, txn) @@ -172,6 +138,7 @@ func getRevision(ctx context.Context, store storage.Store, txn storage.Transacti revisions[name] = r } + // Check legacy bundle manifest in the store revision, err := bundle.LegacyReadRevisionFromStore(ctx, store, txn) if err != nil && !storage.IsNotFound(err) { return err @@ -182,11 +149,11 @@ func getRevision(ctx context.Context, store storage.Store, txn storage.Transacti return nil } -type extProcHook struct { +type hook struct { logger logging.Logger } -func (h *extProcHook) Print(pctx print.Context, msg string) error { +func (h *hook) Print(pctx print.Context, msg string) error { h.logger.Info("%v: %s", pctx.Location, msg) return nil } diff --git a/envoyextproc/request.go b/envoyextproc/request.go index 09b4e280f..e331f92d6 100644 --- a/envoyextproc/request.go +++ b/envoyextproc/request.go @@ -1,79 +1,480 @@ package envoyextproc import ( + "encoding/binary" + "fmt" + "io" + "mime" + "mime/multipart" + "net/url" + "strconv" + "strings" + ext_proc_v3 "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" - "google.golang.org/grpc/codes" + "github.com/open-policy-agent/opa/logging" + "github.com/open-policy-agent/opa/util" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/types/dynamicpb" + + "github.com/open-policy-agent/opa-envoy-plugin/internal/types" ) -// ProcessRequestHeaders processes incoming request headers. -func ProcessRequestHeaders(headers *ext_proc_v3.HttpHeaders) (*ext_proc_v3.ProcessingResponse, error) { - return &ext_proc_v3.ProcessingResponse{ - Response: &ext_proc_v3.ProcessingResponse_RequestHeaders{ - RequestHeaders: &ext_proc_v3.HeadersResponse{}, - }, - }, nil -} +// RequestToInput converts an incoming ext_proc request to an input map for policy evaluation. +func RequestToInput(req *ext_proc_v3.ProcessingRequest, logger logging.Logger, protoSet *protoregistry.Files, skipRequestBodyParse bool, state *types.StreamState) (map[string]interface{}, error) { + input := make(map[string]interface{}) -// ProcessResponseHeaders processes incoming response headers. -func ProcessResponseHeaders(headers *ext_proc_v3.HttpHeaders) (*ext_proc_v3.ProcessingResponse, error) { - return &ext_proc_v3.ProcessingResponse{ - Response: &ext_proc_v3.ProcessingResponse_ResponseHeaders{ - ResponseHeaders: &ext_proc_v3.HeadersResponse{}, - }, - }, nil -} + switch request := req.Request.(type) { + case *ext_proc_v3.ProcessingRequest_RequestHeaders: + // Log the type of request + logger.Info("Processing RequestHeaders") + // Handle RequestHeaders + input["request_type"] = "request_headers" + requestHeaders := request.RequestHeaders + headers := requestHeaders.GetHeaders() + + // Log the raw headers + logger.Debug(fmt.Sprintf("Raw request headers: %v", headers)) + + headerMap := make(map[string]string) + for _, header := range headers.GetHeaders() { + headerMap[header.GetKey()] = header.GetValue() + } + + // Log the extracted headers + logger.Debug(fmt.Sprintf("Extracted headers: %v", headerMap)) + + path := headerMap[":path"] + method := headerMap[":method"] + scheme := headerMap[":scheme"] + authority := headerMap[":authority"] + input["headers"] = headerMap + input["path"] = path + input["method"] = method + input["scheme"] = scheme + input["authority"] = authority + + // Log the extracted path and method + logger.Debug(fmt.Sprintf("Extracted path: %s, method: %s", path, method)) + + // Parse path into parsed_path and parsed_query + parsedPath, parsedQuery, err := getParsedPathAndQuery(path) + if err != nil { + logger.Error(fmt.Sprintf("Error parsing path and query: %v", err)) + return nil, err + } + input["parsed_path"] = parsedPath + input["parsed_query"] = parsedQuery + + // Log the parsed path and query + logger.Debug(fmt.Sprintf("Parsed path: %v", parsedPath)) + logger.Debug(fmt.Sprintf("Parsed query: %v", parsedQuery)) + + state.Headers = headerMap + state.Path = path + state.Method = method + + case *ext_proc_v3.ProcessingRequest_RequestBody: + // Log the type of request + logger.Info("Processing RequestBody") + // Handle RequestBody + input["request_type"] = "request_body" + requestBody := request.RequestBody + body := requestBody.GetBody() + + // Log the raw body + logger.Debug(fmt.Sprintf("Raw request body: %s", string(body))) + + input["path"] = state.Path + + if !skipRequestBodyParse { + + headers := state.Headers + + // Log parse the body + logger.Info("Parsing request body") + + parsedBody, isBodyTruncated, err := getParsedBody(logger, headers, string(body), nil, nil, protoSet) + if err != nil { + logger.Error(fmt.Sprintf("Error parsing request body: %v", err)) + return nil, err + } + input["parsed_body"] = parsedBody + input["truncated_body"] = isBodyTruncated + + // Log the parsed body + logger.Debug(fmt.Sprintf("Parsed body: %v", parsedBody)) + logger.Debug(fmt.Sprintf("Is body truncated: %v", isBodyTruncated)) + } + + case *ext_proc_v3.ProcessingRequest_ResponseHeaders: + // Log the type of request + logger.Info("Processing ResponseHeaders") + // Handle ResponseHeaders + input["request_type"] = "response_headers" + responseHeaders := request.ResponseHeaders + headers := responseHeaders.GetHeaders() -// ProcessRequestBody processes incoming request bodies. -func ProcessRequestBody(body *ext_proc_v3.HttpBody) (*ext_proc_v3.ProcessingResponse, error) { - return &ext_proc_v3.ProcessingResponse{ - Response: &ext_proc_v3.ProcessingResponse_RequestBody{ - RequestBody: &ext_proc_v3.BodyResponse{}, - }, - }, nil + // Log the raw response headers + logger.Debug(fmt.Sprintf("Raw response headers: %v", headers)) + + headerMap := make(map[string]string) + for _, header := range headers.GetHeaders() { + headerMap[header.GetKey()] = header.GetValue() + } + input["response_headers"] = headerMap + + // Extract and set 'path' from response_headers + if path, exists := headerMap[":path"]; exists { + input["path"] = path + } else { + logger.Warn("Path not found in response_headers during ResponseHeaders processing") + } + + // Log the extracted response headers + logger.Debug(fmt.Sprintf("Extracted response headers: %v", headerMap)) + + case *ext_proc_v3.ProcessingRequest_ResponseBody: + // Handle ResponseBody + input["request_type"] = "response_body" + responseBody := request.ResponseBody + body := responseBody.GetBody() + if !skipRequestBodyParse { + headers := state.Headers + parsedBody, isBodyTruncated, err := getParsedBody(logger, headers, string(body), nil, nil, protoSet) + if err != nil { + return nil, err + } + input["response_parsed_body"] = parsedBody + input["response_truncated_body"] = isBodyTruncated + } + + case *ext_proc_v3.ProcessingRequest_RequestTrailers: + // Handle RequestTrailers + input["request_type"] = "request_trailers" + requestTrailers := request.RequestTrailers + trailers := requestTrailers.GetTrailers() + trailerMap := make(map[string]string) + for _, trailer := range trailers.GetHeaders() { + trailerMap[trailer.GetKey()] = trailer.GetValue() + } + input["request_trailers"] = trailerMap + + // Use the stored headers from the state + if state.Headers != nil { + input["headers"] = state.Headers + input["path"] = state.Path + input["method"] = state.Method + } else { + logger.Warn("Headers not available in state during RequestTrailers processing") + } + + case *ext_proc_v3.ProcessingRequest_ResponseTrailers: + // Handle ResponseTrailers + input["request_type"] = "response_trailers" + responseTrailers := request.ResponseTrailers + trailers := responseTrailers.GetTrailers() + trailerMap := make(map[string]string) + for _, trailer := range trailers.GetHeaders() { + trailerMap[trailer.GetKey()] = trailer.GetValue() + } + input["response_trailers"] = trailerMap + + // Use the stored headers from the state + if state.Headers != nil { + input["headers"] = state.Headers + input["path"] = state.Path + input["method"] = state.Method + } else { + logger.Warn("Headers not available in state during ResponseTrailers processing") + } + + default: + logger.Error("Unknown request type in ProcessingRequest") + return nil, fmt.Errorf("unknown request type in ProcessingRequest") + } + // Log the final input map + logger.Info(fmt.Sprintf("Final input map: %v", input)) + + return input, nil } -// ProcessResponseBody processes incoming response bodies. -func ProcessResponseBody(body *ext_proc_v3.HttpBody) (*ext_proc_v3.ProcessingResponse, error) { - return &ext_proc_v3.ProcessingResponse{ - Response: &ext_proc_v3.ProcessingResponse_ResponseBody{ - ResponseBody: &ext_proc_v3.BodyResponse{}, - }, - }, nil +func getParsedPathAndQuery(path string) ([]interface{}, map[string]interface{}, error) { + parsedURL, err := url.Parse(path) + if err != nil { + return nil, nil, err + } + + fmt.Sprintf("Parsed URL: %v", parsedURL) + + parsedPath := strings.Split(strings.TrimLeft(parsedURL.Path, "/"), "/") + parsedPathInterface := make([]interface{}, len(parsedPath)) + for i, v := range parsedPath { + parsedPathInterface[i] = v + } + + // Log the parsed path components + fmt.Sprintf("Parsed path components: %v", parsedPathInterface) + + parsedQueryInterface := make(map[string]interface{}) + for paramKey, paramValues := range parsedURL.Query() { + queryValues := make([]interface{}, len(paramValues)) + for i, v := range paramValues { + queryValues[i] = v + } + parsedQueryInterface[paramKey] = queryValues + } + + // Log the parsed query parameters + fmt.Sprintf("Parsed query parameters: %v", parsedQueryInterface) + + return parsedPathInterface, parsedQueryInterface, nil } -// ProcessRequestTrailers processes incoming request trailers. -func ProcessRequestTrailers(trailers *ext_proc_v3.HttpTrailers) (*ext_proc_v3.ProcessingResponse, error) { - return &ext_proc_v3.ProcessingResponse{ - Response: &ext_proc_v3.ProcessingResponse_RequestTrailers{ - RequestTrailers: &ext_proc_v3.TrailersResponse{}, - }, - }, nil +func getParsedBody(logger logging.Logger, headers map[string]string, body string, rawBody []byte, parsedPath []interface{}, protoSet *protoregistry.Files) (interface{}, bool, error) { + var data interface{} + + if val, ok := headers["content-type"]; ok { + if strings.Contains(val, "application/json") { + + if body == "" { + if len(rawBody) == 0 { + return nil, false, nil + } + body = string(rawBody) + } + + if val, ok := headers["content-length"]; ok { + truncated, err := checkIfHTTPBodyTruncated(val, int64(len(body))) + if err != nil { + return nil, false, err + } + if truncated { + return nil, true, nil + } + } + + err := util.UnmarshalJSON([]byte(body), &data) + if err != nil { + return nil, false, err + } + } else if strings.Contains(val, "application/grpc") { + + if protoSet == nil { + return nil, false, nil + } + + // This happens when the plugin was configured to read gRPC payloads, + // but the Envoy instance requesting an authz decision didn't have + // pack_as_bytes set to true. + if len(rawBody) == 0 { + logger.Debug("no rawBody field sent") + return nil, false, nil + } + // In gRPC, a call of method DoThing on service ThingService is a + // POST to /ThingService/DoThing. If our path length is anything but + // two, something is wrong. + if len(parsedPath) != 2 { + return nil, false, fmt.Errorf("invalid parsed path") + } + + known, truncated, err := getGRPCBody(logger, rawBody, parsedPath, &data, protoSet) + if err != nil { + return nil, false, err + } + if truncated { + return nil, true, nil + } + if !known { + return nil, false, nil + } + } else if strings.Contains(val, "application/x-www-form-urlencoded") { + var payload string + switch { + case body != "": + payload = body + case len(rawBody) > 0: + payload = string(rawBody) + default: + return nil, false, nil + } + + if val, ok := headers["content-length"]; ok { + truncated, err := checkIfHTTPBodyTruncated(val, int64(len(payload))) + if err != nil { + return nil, false, err + } + if truncated { + return nil, true, nil + } + } + + parsed, err := url.ParseQuery(payload) + if err != nil { + return nil, false, err + } + + data = map[string][]string(parsed) + } else if strings.Contains(val, "multipart/form-data") { + var payload string + switch { + case body != "": + payload = body + case len(rawBody) > 0: + payload = string(rawBody) + default: + return nil, false, nil + } + + if val, ok := headers["content-length"]; ok { + truncated, err := checkIfHTTPBodyTruncated(val, int64(len(payload))) + if err != nil { + return nil, false, err + } + if truncated { + return nil, true, nil + } + } + + _, params, err := mime.ParseMediaType(headers["content-type"]) + if err != nil { + return nil, false, err + } + + boundary, ok := params["boundary"] + if !ok { + return nil, false, nil + } + + values := map[string][]interface{}{} + + mr := multipart.NewReader(strings.NewReader(payload), boundary) + for { + p, err := mr.NextPart() + if err == io.EOF { + break + } + if err != nil { + return nil, false, err + } + + name := p.FormName() + if name == "" { + continue + } + + value, err := io.ReadAll(p) + if err != nil { + return nil, false, err + } + + switch { + case strings.Contains(p.Header.Get("Content-Type"), "application/json"): + var jsonValue interface{} + if err := util.UnmarshalJSON(value, &jsonValue); err != nil { + return nil, false, err + } + values[name] = append(values[name], jsonValue) + default: + values[name] = append(values[name], string(value)) + } + } + + data = values + } else { + logger.Debug("content-type: %s parsing not supported", val) + } + } else { + logger.Debug("no content-type header supplied, performing no body parsing") + } + + return data, false, nil } -// ProcessResponseTrailers processes incoming response trailers. -func ProcessResponseTrailers(trailers *ext_proc_v3.HttpTrailers) (*ext_proc_v3.ProcessingResponse, error) { - return &ext_proc_v3.ProcessingResponse{ - Response: &ext_proc_v3.ProcessingResponse_ResponseTrailers{ - ResponseTrailers: &ext_proc_v3.TrailersResponse{}, - }, - }, nil +func getGRPCBody(logger logging.Logger, in []byte, parsedPath []interface{}, data interface{}, files *protoregistry.Files) (found, truncated bool, _ error) { + + // the first 5 bytes are part of gRPC framing. We need to remove them to be able to parse + // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md + + if len(in) < 5 { + return false, false, fmt.Errorf("less than 5 bytes") + } + + // Can be 0 or 1, 1 indicates that the payload is compressed. + // The method could be looked up in the request headers, and the + // request decompressed; but for now, let's skip it. + if in[0] != 0 { + logger.Debug("gRPC payload compression not supported") + return false, false, nil + } + + // Note: we're only reading one message, this is the first message's size + size := binary.BigEndian.Uint32(in[1:5]) + if int(size) > len(in)-5 { + return false, true, nil // truncated body + } + in = in[5 : size+5] + + // Note: we've already checked that len(path)>=2 + svc, err := findService(parsedPath[0].(string), files) + if err != nil { + logger.WithFields(map[string]interface{}{"err": err}).Debug("could not find service") + return false, false, nil + } + msgDesc, err := findMessageInputDesc(parsedPath[1].(string), svc) + if err != nil { + logger.WithFields(map[string]interface{}{"err": err}).Debug("could not find message") + return false, false, nil + } + + msg := dynamicpb.NewMessage(msgDesc) + if err := proto.Unmarshal(in, msg); err != nil { + return true, false, err + } + + jsonBody, err := protojson.Marshal(msg) + if err != nil { + return true, false, err + } + + if err := util.Unmarshal([]byte(jsonBody), &data); err != nil { + return true, false, err + } + + return true, false, nil } -// Error represents an error with a code and a message. -type Error struct { - Code string `json:"code"` - Message string `json:"message"` +func findService(path string, files *protoregistry.Files) (protoreflect.ServiceDescriptor, error) { + desc, err := files.FindDescriptorByName(protoreflect.FullName(path)) + if err != nil { + return nil, err + } + svcDesc, ok := desc.(protoreflect.ServiceDescriptor) + if !ok { + return nil, fmt.Errorf("could not find service descriptor for path %q", path) + } + return svcDesc, nil } -// Error implements the error interface. -func (e *Error) Error() string { - return e.Message +func findMessageInputDesc(name string, svc protoreflect.ServiceDescriptor) (protoreflect.MessageDescriptor, error) { + if method := svc.Methods().ByName(protoreflect.Name(name)); method != nil { + if method.IsStreamingClient() { + return nil, fmt.Errorf("streaming client method %s not supported", method.Name()) + } + return method.Input(), nil + } + return nil, fmt.Errorf("method %q not found", name) } -// internalError creates a new Error with the given code and message. -func internalError(code codes.Code, err error) *Error { - return &Error{ - Code: code.String(), - Message: err.Error(), +func checkIfHTTPBodyTruncated(contentLength string, bodyLength int64) (bool, error) { + cl, err := strconv.ParseInt(contentLength, 10, 64) + if err != nil { + return false, err + } + if cl != -1 && cl > bodyLength { + return true, nil } + return false, nil } diff --git a/envoyextproc/response.go b/envoyextproc/response.go index 1f29a0f96..801863854 100644 --- a/envoyextproc/response.go +++ b/envoyextproc/response.go @@ -7,33 +7,18 @@ import ( "net/http" ext_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + ext_proc_v3 "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" ext_type_v3 "github.com/envoyproxy/go-control-plane/envoy/type/v3" - _structpb "github.com/golang/protobuf/ptypes/struct" "github.com/open-policy-agent/opa/metrics" "github.com/open-policy-agent/opa/storage" "github.com/open-policy-agent/opa/topdown/builtins" "google.golang.org/protobuf/types/known/structpb" - "github.com/open-policy-agent/opa-envoy-plugin/envoyauth" "github.com/open-policy-agent/opa-envoy-plugin/internal/util" ) -// ToEnvoyAuthEvalResult converts ExtProcEvalResult to envoyauth.EvalResult -func (r *ExtProcEvalResult) ToEnvoyAuthEvalResult() *envoyauth.EvalResult { - return &envoyauth.EvalResult{ - Revision: r.Revision, - Revisions: r.Revisions, - DecisionID: r.DecisionID, - TxnID: r.TxnID, - Decision: r.Decision, - Metrics: r.Metrics, - Txn: r.Txn, - NDBuiltinCache: r.NDBuiltinCache, - } -} - -// ExtProcEvalResult captures the result from evaluating a query against an input. -type ExtProcEvalResult struct { +// EvalResult captures the result from evaluating a query against an input. +type EvalResult struct { Revision string // Deprecated: Use `revisions` instead. Revisions map[string]string DecisionID string @@ -50,11 +35,11 @@ type StopFunc = func() // TransactionCloser should be called to abort the transaction. type TransactionCloser func(ctx context.Context, err error) error -// NewExtProcEvalResult creates a new ExtProcEvalResult and a StopFunc that is used to stop the timer for metrics. -func NewExtProcEvalResult(opts ...func(*ExtProcEvalResult)) (*ExtProcEvalResult, StopFunc, error) { +// NewEvalResult creates a new EvalResult and a StopFunc that is used to stop the timer for metrics. +func NewEvalResult(opts ...func(*EvalResult)) (*EvalResult, StopFunc, error) { var err error - er := &ExtProcEvalResult{ + er := &EvalResult{ Metrics: metrics.New(), } @@ -79,8 +64,8 @@ func NewExtProcEvalResult(opts ...func(*ExtProcEvalResult)) (*ExtProcEvalResult, return er, stop, nil } -// GetTxn creates a read transaction suitable for the configured ExtProcEvalResult object. -func (result *ExtProcEvalResult) GetTxn(ctx context.Context, store storage.Store) (storage.Transaction, TransactionCloser, error) { +// GetTxn creates a read transaction suitable for the configured EvalResult object. +func (result *EvalResult) GetTxn(ctx context.Context, store storage.Store) (storage.Transaction, TransactionCloser, error) { params := storage.TransactionParams{} noopCloser := func(ctx context.Context, err error) error { @@ -102,324 +87,325 @@ func (result *ExtProcEvalResult) GetTxn(ctx context.Context, store storage.Store return txn, closer, nil } -func (result *ExtProcEvalResult) invalidDecisionErr() error { +// invalidDecisionErr returns an error indicating that the decision is invalid. +func (result *EvalResult) invalidDecisionErr() error { return fmt.Errorf("illegal value for policy evaluation result: %T", result.Decision) } -// IsAllowed returns whether the decision represents an "allow" depending on the decision structure. -// Returns an error if the decision structure is invalid. -func (result *ExtProcEvalResult) IsAllowed() (bool, error) { - switch decision := result.Decision.(type) { - case bool: - return decision, nil - case map[string]interface{}: - var val interface{} - var ok, allowed bool - - if val, ok = decision["allowed"]; !ok { - return false, fmt.Errorf("unable to determine evaluation result due to missing \"allowed\" key") - } - - if allowed, ok = val.(bool); !ok { - return false, fmt.Errorf("type assertion error, expected allowed to be of type 'boolean' but got '%T'", val) - } - - return allowed, nil +// GetImmediateResponse constructs an ImmediateResponse message based on the policy decision. +func (result *EvalResult) GetImmediateResponse() (*ext_proc_v3.ImmediateResponse, error) { + decisionMap, ok := result.Decision.(map[string]interface{}) + if !ok { + return nil, nil // No immediate response } - return false, result.invalidDecisionErr() -} - -// GetRequestHTTPHeadersToRemove returns the HTTP headers to remove from the original request before dispatching it to the upstream. -func (result *ExtProcEvalResult) GetRequestHTTPHeadersToRemove() ([]string, error) { - headersToRemove := []string{} - - switch decision := result.Decision.(type) { - case bool: - return headersToRemove, nil - case map[string]interface{}: - var ok bool - var val interface{} - - if val, ok = decision["request_headers_to_remove"]; !ok { - return headersToRemove, nil - } - - switch val := val.(type) { - case []string: - return val, nil - case []interface{}: - for _, vval := range val { - header, ok := vval.(string) - if !ok { - return nil, fmt.Errorf("type assertion error, expected request_headers_to_remove value to be of type 'string' but got '%T'", vval) - } - - headersToRemove = append(headersToRemove, header) - } - return headersToRemove, nil - default: - return nil, fmt.Errorf("type assertion error, expected request_headers_to_remove to be of type '[]string' but got '%T'", val) - } + immediateRespData, ok := decisionMap["immediate_response"].(map[string]interface{}) + if !ok { + return nil, nil // No immediate response } - return nil, result.invalidDecisionErr() -} - -// GetResponseHTTPHeaders returns the HTTP headers to return if they are part of the decision. -func (result *ExtProcEvalResult) GetResponseHTTPHeaders() (http.Header, error) { - var responseHeaders = make(http.Header) - - switch decision := result.Decision.(type) { - case bool: - return responseHeaders, nil - case map[string]interface{}: - var ok bool - var val interface{} + // Default status code + statusInt := http.StatusForbidden - if val, ok = decision["headers"]; !ok { - return responseHeaders, nil + // Extract status code + if val, ok := immediateRespData["status"]; ok { + var statusCode json.Number + if statusCode, ok = val.(json.Number); !ok { + return nil, fmt.Errorf("type assertion error, expected status to be of type 'number' but got '%T'", val) } - err := transformToHTTPHeaderFormat(val, &responseHeaders) + httpStatusCode, err := statusCode.Int64() if err != nil { - return nil, err + return nil, fmt.Errorf("error converting JSON number to int: %v", err) } - return responseHeaders, nil - } + if http.StatusText(int(httpStatusCode)) == "" { + return nil, fmt.Errorf("invalid HTTP status code %v", httpStatusCode) + } - return nil, result.invalidDecisionErr() -} + statusInt = int(httpStatusCode) + } -// GetResponseEnvoyHeaderValueOptions returns the HTTP headers to return if they are part of the decision as Envoy header value options. -func (result *ExtProcEvalResult) GetResponseEnvoyHeaderValueOptions() ([]*ext_core_v3.HeaderValueOption, error) { - headers, err := result.GetResponseHTTPHeaders() - if err != nil { - return nil, err + // Construct HttpStatus + statusCode := &ext_type_v3.HttpStatus{ + Code: ext_type_v3.StatusCode(statusInt), } - return transformHTTPHeaderToEnvoyHeaderValueOption(headers) -} + // Extract body + body := []byte{} + if bodyVal, ok := immediateRespData["body"].(string); ok { + body = []byte(bodyVal) + } -// GetResponseHTTPHeadersToAdd returns the HTTP headers to send to the downstream client. -func (result *ExtProcEvalResult) GetResponseHTTPHeadersToAdd() ([]*ext_core_v3.HeaderValueOption, error) { - var responseHeaders = make(http.Header) + // Extract headers + headers := []*ext_core_v3.HeaderValueOption{} + if headersVal, ok := immediateRespData["headers"].([]interface{}); ok { + for _, headerObj := range headersVal { + headerMap, ok := headerObj.(map[string]interface{}) + if !ok { + continue + } - finalHeaders := []*ext_core_v3.HeaderValueOption{} + key, ok := headerMap["key"].(string) + if !ok { + continue + } - switch decision := result.Decision.(type) { - case bool: - return finalHeaders, nil - case map[string]interface{}: - var ok bool - var val interface{} + value, ok := headerMap["value"].(string) + if !ok { + continue + } - if val, ok = decision["response_headers_to_add"]; !ok { - return finalHeaders, nil + headerValueOption := &ext_core_v3.HeaderValueOption{ + Header: &ext_core_v3.HeaderValue{Key: key, Value: value}, + } + headers = append(headers, headerValueOption) } + } - err := transformToHTTPHeaderFormat(val, &responseHeaders) - if err != nil { - return nil, err + immediateResponse := &ext_proc_v3.ImmediateResponse{ + Status: statusCode, + Body: body, + Headers: &ext_proc_v3.HeaderMutation{ + SetHeaders: headers, + }, + } + + // Optional: Handle gRPC status and details if needed + if grpcStatusVal, ok := immediateRespData["grpc_status"].(float64); ok { + immediateResponse.GrpcStatus = &ext_proc_v3.GrpcStatus{ + Status: uint32(grpcStatusVal), } - default: - return nil, result.invalidDecisionErr() } - return transformHTTPHeaderToEnvoyHeaderValueOption(responseHeaders) -} + if detailsVal, ok := immediateRespData["details"].(string); ok { + immediateResponse.Details = detailsVal + } -// HasResponseBody returns true if the decision defines a body (only true for structured decisions). -func (result *ExtProcEvalResult) HasResponseBody() bool { - decision, ok := result.Decision.(map[string]interface{}) + return immediateResponse, nil +} +// GetCommonResponse constructs a CommonResponse based on the policy decision. +func (result *EvalResult) GetCommonResponse() (*ext_proc_v3.CommonResponse, error) { + _, ok := result.Decision.(map[string]interface{}) if !ok { - return false + return nil, nil // No modifications } - _, ok = decision["body"] - - return ok -} + headerMutation, err := result.getHeaderMutation() + if err != nil { + return nil, err + } -// GetResponseBody returns the HTTP body to return if they are part of the decision. -func (result *ExtProcEvalResult) GetResponseBody() (string, error) { - var ok bool - var val interface{} - var body string - var decision map[string]interface{} + bodyMutation, err := result.getBodyMutation() + if err != nil { + return nil, err + } - if decision, ok = result.Decision.(map[string]interface{}); !ok { - return "", nil + if headerMutation == nil && bodyMutation == nil { + return nil, nil // No modifications } - if val, ok = decision["body"]; !ok { - return "", nil + commonResponse := &ext_proc_v3.CommonResponse{ + HeaderMutation: headerMutation, + BodyMutation: bodyMutation, } - if body, ok = val.(string); !ok { - return "", fmt.Errorf("type assertion error, expected body to be of type 'string' but got '%T'", val) + // Set status if needed + if bodyMutation != nil { + commonResponse.Status = ext_proc_v3.CommonResponse_CONTINUE_AND_REPLACE } - return body, nil + return commonResponse, nil } -// GetResponseHTTPStatus returns the HTTP status to return if they are part of the decision. -func (result *ExtProcEvalResult) GetResponseHTTPStatus() (int, error) { - var ok bool - var val interface{} - var statusCode json.Number +// getHeaderMutation constructs a HeaderMutation from the policy decision. +func (result *EvalResult) getHeaderMutation() (*ext_proc_v3.HeaderMutation, error) { + decisionMap, ok := result.Decision.(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("decision is not a map") + } - status := http.StatusForbidden + // Initialize slices for set and remove headers + setHeaders := []*ext_core_v3.HeaderValueOption{} + removeHeaders := []string{} - switch decision := result.Decision.(type) { - case bool: - if decision { - return http.StatusOK, fmt.Errorf("HTTP status code undefined for simple 'allow'") + // Process headers to add + if responseHeaders, ok := decisionMap["headers_to_add"]; ok { + headersSlice, ok := responseHeaders.([]interface{}) + if !ok { + return nil, fmt.Errorf("headers_to_add is not an array") } - return status, nil - case map[string]interface{}: - if val, ok = decision["http_status"]; !ok { - return status, nil - } + for _, headerObj := range headersSlice { + headerMap, ok := headerObj.(map[string]interface{}) + if !ok { + continue + } - if statusCode, ok = val.(json.Number); !ok { - return status, fmt.Errorf("type assertion error, expected http_status to be of type 'number' but got '%T'", val) - } + key, ok := headerMap["key"].(string) + if !ok { + continue + } - httpStatusCode, err := statusCode.Int64() - if err != nil { - return status, fmt.Errorf("error converting JSON number to int: %v", err) + value, ok := headerMap["value"].(string) + if !ok { + continue + } + + headerValueOption := &ext_core_v3.HeaderValueOption{ + Header: &ext_core_v3.HeaderValue{Key: key, Value: value}, + } + + setHeaders = append(setHeaders, headerValueOption) } + } - if http.StatusText(int(httpStatusCode)) == "" { - return status, fmt.Errorf("Invalid HTTP status code %v", httpStatusCode) + // Process headers to remove + if removeHeadersVal, ok := decisionMap["headers_to_remove"]; ok { + removeHeadersSlice, ok := removeHeadersVal.([]interface{}) + if !ok { + return nil, fmt.Errorf("headers_to_remove is not an array") + } + for _, v := range removeHeadersSlice { + header, ok := v.(string) + if !ok { + return nil, fmt.Errorf("header to remove is not a string") + } + removeHeaders = append(removeHeaders, header) } + } + + // Check if there are any header mutations + if len(setHeaders) == 0 && len(removeHeaders) == 0 { + return nil, nil // No header mutations + } - return int(httpStatusCode), nil + headerMutation := &ext_proc_v3.HeaderMutation{ + SetHeaders: setHeaders, + RemoveHeaders: removeHeaders, } - return http.StatusForbidden, result.invalidDecisionErr() + return headerMutation, nil } -// GetDynamicMetadata returns the dynamic metadata to return if part of the decision. -func (result *ExtProcEvalResult) GetDynamicMetadata() (*_structpb.Struct, error) { - var ( - val interface{} - ok bool - ) - switch decision := result.Decision.(type) { - case bool: - if decision { - return nil, fmt.Errorf("dynamic metadata undefined for boolean decision") - } - case map[string]interface{}: - if val, ok = decision["dynamic_metadata"]; !ok { - return nil, nil - } +// getBodyMutation constructs a BodyMutation from the policy decision. +func (result *EvalResult) getBodyMutation() (*ext_proc_v3.BodyMutation, error) { + decisionMap, ok := result.Decision.(map[string]interface{}) + if !ok { + return nil, nil + } - metadata, ok := val.(map[string]interface{}) - if !ok { - return nil, fmt.Errorf("type assertion error, expected dynamic_metadata to be of type 'object' but got '%T'", val) - } + bodyVal, ok := decisionMap["body"] + if !ok { + return nil, nil + } + + bodyStr, ok := bodyVal.(string) + if !ok { + return nil, fmt.Errorf("body is not a string") + } - return structpb.NewStruct(metadata) + bodyMutation := &ext_proc_v3.BodyMutation{ + Mutation: &ext_proc_v3.BodyMutation_Body{ + Body: []byte(bodyStr), + }, } - return nil, nil + return bodyMutation, nil } -// GetResponseEnvoyHTTPStatus returns the HTTP status to return if they are part of the decision. -func (result *ExtProcEvalResult) GetResponseEnvoyHTTPStatus() (*ext_type_v3.HttpStatus, error) { - status := &ext_type_v3.HttpStatus{ - Code: ext_type_v3.StatusCode(ext_type_v3.StatusCode_Forbidden), +// GetDynamicMetadata retrieves dynamic metadata from the policy decision. +func (result *EvalResult) GetDynamicMetadata() (*structpb.Struct, error) { + decisionMap, ok := result.Decision.(map[string]interface{}) + if !ok { + return nil, nil + } + + val, ok := decisionMap["dynamic_metadata"] + if !ok { + return nil, nil // No dynamic metadata } - httpStatusCode, err := result.GetResponseHTTPStatus() + metadataMap, ok := val.(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("dynamic_metadata is not a map") + } + dynamicMetadata, err := structpb.NewStruct(metadataMap) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to convert dynamic_metadata to Struct: %v", err) } - // This check is partially redundant but might be more strict than http.StatusText(). - if _, ok := ext_type_v3.StatusCode_name[int32(httpStatusCode)]; !ok { - return nil, fmt.Errorf("Invalid HTTP status code %v", httpStatusCode) + return dynamicMetadata, nil +} + +// GetTrailerMutation constructs a HeaderMutation from the policy decision for trailers. +func (result *EvalResult) GetTrailerMutation() (*ext_proc_v3.HeaderMutation, error) { + decisionMap, ok := result.Decision.(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("decision is not a map") } - status.Code = ext_type_v3.StatusCode(int32(httpStatusCode)) + // Initialize slices for set and remove trailers + setTrailers := []*ext_core_v3.HeaderValueOption{} + removeTrailers := []string{} - return status, nil -} + // Process trailers to add + if responseTrailers, ok := decisionMap["trailers_to_add"]; ok { + trailersSlice, ok := responseTrailers.([]interface{}) + if !ok { + return nil, fmt.Errorf("trailers_to_add is not an array") + } -func transformToHTTPHeaderFormat(input interface{}, result *http.Header) error { - takeResponseHeaders := func(headers map[string]interface{}, targetHeaders *http.Header) error { - for key, value := range headers { - switch values := value.(type) { - case string: - targetHeaders.Add(key, values) - case []string: - for _, v := range values { - targetHeaders.Add(key, v) - } - case []interface{}: - for _, value := range values { - if headerVal, ok := value.(string); ok { - targetHeaders.Add(key, headerVal) - } else { - return fmt.Errorf("invalid value type for header '%s'", key) - } - } - default: - return fmt.Errorf("type assertion error for header '%s'", key) + for _, trailerObj := range trailersSlice { + trailerMap, ok := trailerObj.(map[string]interface{}) + if !ok { + continue } - } - return nil - } - switch input := input.(type) { - case []interface{}: - for _, val := range input { - headers, ok := val.(map[string]interface{}) + key, ok := trailerMap["key"].(string) if !ok { - return fmt.Errorf("type assertion error, expected headers to be of type 'object' but got '%T'", val) + continue } - err := takeResponseHeaders(headers, result) - if err != nil { - return err + value, ok := trailerMap["value"].(string) + if !ok { + continue } - } - case map[string]interface{}: - err := takeResponseHeaders(input, result) - if err != nil { - return err - } + headerValueOption := &ext_core_v3.HeaderValueOption{ + Header: &ext_core_v3.HeaderValue{Key: key, Value: value}, + } - default: - return fmt.Errorf("type assertion error, expected headers to be of type 'object' but got '%T'", input) + setTrailers = append(setTrailers, headerValueOption) + } } - return nil -} - -func transformHTTPHeaderToEnvoyHeaderValueOption(headers http.Header) ([]*ext_core_v3.HeaderValueOption, error) { - responseHeaders := []*ext_core_v3.HeaderValueOption{} - - for key, values := range headers { - for idx := range values { - headerValue := &ext_core_v3.HeaderValue{ - Key: key, - Value: values[idx], - } - headerValueOption := &ext_core_v3.HeaderValueOption{ - Header: headerValue, + // Process trailers to remove + if removeTrailersVal, ok := decisionMap["trailers_to_remove"]; ok { + removeTrailersSlice, ok := removeTrailersVal.([]interface{}) + if !ok { + return nil, fmt.Errorf("trailers_to_remove is not an array") + } + for _, v := range removeTrailersSlice { + trailer, ok := v.(string) + if !ok { + return nil, fmt.Errorf("trailer to remove is not a string") } - responseHeaders = append(responseHeaders, headerValueOption) + removeTrailers = append(removeTrailers, trailer) } } - return responseHeaders, nil + // Check if there are any trailer mutations + if len(setTrailers) == 0 && len(removeTrailers) == 0 { + return nil, nil // No trailer mutations + } + + headerMutation := &ext_proc_v3.HeaderMutation{ + SetHeaders: setTrailers, + RemoveHeaders: removeTrailers, + } + + return headerMutation, nil } From 9fc246f90534d10b01eb0098b1051c16fae2e90b Mon Sep 17 00:00:00 2001 From: pweiber Date: Wed, 13 Nov 2024 13:45:35 -0300 Subject: [PATCH 05/10] Updating vendor files for the ext_proc Signed-off-by: pweiber --- .../mutation_rules/v3/mutation_rules.pb.go | 26 +- .../v3/mutation_rules.pb.validate.go | 1 + .../v3/mutation_rules_vtproto.pb.go | 338 ++++ .../filters/http/ext_proc/v3/ext_proc.pb.go | 864 ++++++-- .../http/ext_proc/v3/ext_proc.pb.validate.go | 566 +++++- .../http/ext_proc/v3/ext_proc_vtproto.pb.go | 996 ++++++++++ .../http/ext_proc/v3/processing_mode.pb.go | 2 +- .../v3/processing_mode.pb.validate.go | 1 + .../ext_proc/v3/processing_mode_vtproto.pb.go | 110 + .../ext_proc/v3/external_processor.pb.go | 829 ++++---- .../v3/external_processor.pb.validate.go | 78 +- .../ext_proc/v3/external_processor_grpc.pb.go | 147 ++ .../v3/external_processor_vtproto.pb.go | 1767 +++++++++++++++++ 13 files changed, 5031 insertions(+), 694 deletions(-) create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules_vtproto.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc_vtproto.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode_vtproto.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_grpc.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_vtproto.pb.go diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.go index 2cbe78d16..ae79004a4 100644 --- a/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.go +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc v5.26.1 // source: envoy/config/common/mutation_rules/v3/mutation_rules.proto package mutation_rulesv3 @@ -11,9 +11,9 @@ import ( v31 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" v3 "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3" _ "github.com/envoyproxy/protoc-gen-validate/validate" - wrappers "github.com/golang/protobuf/ptypes/wrappers" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" reflect "reflect" sync "sync" ) @@ -60,22 +60,22 @@ type HeaderMutationRules struct { // filters or request routing cannot be modified. These headers are // “host“, “:authority“, “:scheme“, and “:method“. Setting this parameter // to true allows these headers to be modified as well. - AllowAllRouting *wrappers.BoolValue `protobuf:"bytes,1,opt,name=allow_all_routing,json=allowAllRouting,proto3" json:"allow_all_routing,omitempty"` + AllowAllRouting *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=allow_all_routing,json=allowAllRouting,proto3" json:"allow_all_routing,omitempty"` // If true, allow modification of envoy internal headers. By default, these // start with “x-envoy“ but this may be overridden in the “Bootstrap“ // configuration using the // :ref:`header_prefix ` // field. Default is false. - AllowEnvoy *wrappers.BoolValue `protobuf:"bytes,2,opt,name=allow_envoy,json=allowEnvoy,proto3" json:"allow_envoy,omitempty"` + AllowEnvoy *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=allow_envoy,json=allowEnvoy,proto3" json:"allow_envoy,omitempty"` // If true, prevent modification of any system header, defined as a header // that starts with a “:“ character, regardless of any other settings. // A processing server may still override the “:status“ of an HTTP response // using an “ImmediateResponse“ message. Default is false. - DisallowSystem *wrappers.BoolValue `protobuf:"bytes,3,opt,name=disallow_system,json=disallowSystem,proto3" json:"disallow_system,omitempty"` + DisallowSystem *wrapperspb.BoolValue `protobuf:"bytes,3,opt,name=disallow_system,json=disallowSystem,proto3" json:"disallow_system,omitempty"` // If true, prevent modifications of all header values, regardless of any // other settings. A processing server may still override the “:status“ // of an HTTP response using an “ImmediateResponse“ message. Default is false. - DisallowAll *wrappers.BoolValue `protobuf:"bytes,4,opt,name=disallow_all,json=disallowAll,proto3" json:"disallow_all,omitempty"` + DisallowAll *wrapperspb.BoolValue `protobuf:"bytes,4,opt,name=disallow_all,json=disallowAll,proto3" json:"disallow_all,omitempty"` // If set, specifically allow any header that matches this regular // expression. This overrides all other settings except for // “disallow_expression“. @@ -89,7 +89,7 @@ type HeaderMutationRules struct { // parameter, any attempt to set, add, or modify a disallowed header will // cause the “rejected_header_mutations“ counter to be incremented. // Default is false. - DisallowIsError *wrappers.BoolValue `protobuf:"bytes,7,opt,name=disallow_is_error,json=disallowIsError,proto3" json:"disallow_is_error,omitempty"` + DisallowIsError *wrapperspb.BoolValue `protobuf:"bytes,7,opt,name=disallow_is_error,json=disallowIsError,proto3" json:"disallow_is_error,omitempty"` } func (x *HeaderMutationRules) Reset() { @@ -124,28 +124,28 @@ func (*HeaderMutationRules) Descriptor() ([]byte, []int) { return file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescGZIP(), []int{0} } -func (x *HeaderMutationRules) GetAllowAllRouting() *wrappers.BoolValue { +func (x *HeaderMutationRules) GetAllowAllRouting() *wrapperspb.BoolValue { if x != nil { return x.AllowAllRouting } return nil } -func (x *HeaderMutationRules) GetAllowEnvoy() *wrappers.BoolValue { +func (x *HeaderMutationRules) GetAllowEnvoy() *wrapperspb.BoolValue { if x != nil { return x.AllowEnvoy } return nil } -func (x *HeaderMutationRules) GetDisallowSystem() *wrappers.BoolValue { +func (x *HeaderMutationRules) GetDisallowSystem() *wrapperspb.BoolValue { if x != nil { return x.DisallowSystem } return nil } -func (x *HeaderMutationRules) GetDisallowAll() *wrappers.BoolValue { +func (x *HeaderMutationRules) GetDisallowAll() *wrapperspb.BoolValue { if x != nil { return x.DisallowAll } @@ -166,7 +166,7 @@ func (x *HeaderMutationRules) GetDisallowExpression() *v3.RegexMatcher { return nil } -func (x *HeaderMutationRules) GetDisallowIsError() *wrappers.BoolValue { +func (x *HeaderMutationRules) GetDisallowIsError() *wrapperspb.BoolValue { if x != nil { return x.DisallowIsError } @@ -349,7 +349,7 @@ var file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes = m var file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_goTypes = []interface{}{ (*HeaderMutationRules)(nil), // 0: envoy.config.common.mutation_rules.v3.HeaderMutationRules (*HeaderMutation)(nil), // 1: envoy.config.common.mutation_rules.v3.HeaderMutation - (*wrappers.BoolValue)(nil), // 2: google.protobuf.BoolValue + (*wrapperspb.BoolValue)(nil), // 2: google.protobuf.BoolValue (*v3.RegexMatcher)(nil), // 3: envoy.type.matcher.v3.RegexMatcher (*v31.HeaderValueOption)(nil), // 4: envoy.config.core.v3.HeaderValueOption } diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.validate.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.validate.go index d3b7d4c35..0489f7d18 100644 --- a/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.validate.go +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules.pb.validate.go @@ -1,3 +1,4 @@ +//go:build !disable_pgv // Code generated by protoc-gen-validate. DO NOT EDIT. // source: envoy/config/common/mutation_rules/v3/mutation_rules.proto diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules_vtproto.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules_vtproto.pb.go new file mode 100644 index 000000000..d2a80f193 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3/mutation_rules_vtproto.pb.go @@ -0,0 +1,338 @@ +//go:build vtprotobuf +// +build vtprotobuf + +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// source: envoy/config/common/mutation_rules/v3/mutation_rules.proto + +package mutation_rulesv3 + +import ( + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + wrapperspb "github.com/planetscale/vtprotobuf/types/known/wrapperspb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *HeaderMutationRules) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HeaderMutationRules) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HeaderMutationRules) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.DisallowIsError != nil { + size, err := (*wrapperspb.BoolValue)(m.DisallowIsError).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + if m.DisallowExpression != nil { + if vtmsg, ok := interface{}(m.DisallowExpression).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.DisallowExpression) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x32 + } + if m.AllowExpression != nil { + if vtmsg, ok := interface{}(m.AllowExpression).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.AllowExpression) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x2a + } + if m.DisallowAll != nil { + size, err := (*wrapperspb.BoolValue)(m.DisallowAll).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if m.DisallowSystem != nil { + size, err := (*wrapperspb.BoolValue)(m.DisallowSystem).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.AllowEnvoy != nil { + size, err := (*wrapperspb.BoolValue)(m.AllowEnvoy).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.AllowAllRouting != nil { + size, err := (*wrapperspb.BoolValue)(m.AllowAllRouting).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HeaderMutation) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HeaderMutation) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HeaderMutation) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if msg, ok := m.Action.(*HeaderMutation_Append); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Action.(*HeaderMutation_Remove); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *HeaderMutation_Remove) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HeaderMutation_Remove) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Remove) + copy(dAtA[i:], m.Remove) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Remove))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} +func (m *HeaderMutation_Append) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HeaderMutation_Append) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Append != nil { + if vtmsg, ok := interface{}(m.Append).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Append) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *HeaderMutationRules) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AllowAllRouting != nil { + l = (*wrapperspb.BoolValue)(m.AllowAllRouting).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.AllowEnvoy != nil { + l = (*wrapperspb.BoolValue)(m.AllowEnvoy).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.DisallowSystem != nil { + l = (*wrapperspb.BoolValue)(m.DisallowSystem).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.DisallowAll != nil { + l = (*wrapperspb.BoolValue)(m.DisallowAll).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.AllowExpression != nil { + if size, ok := interface{}(m.AllowExpression).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.AllowExpression) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.DisallowExpression != nil { + if size, ok := interface{}(m.DisallowExpression).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.DisallowExpression) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.DisallowIsError != nil { + l = (*wrapperspb.BoolValue)(m.DisallowIsError).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *HeaderMutation) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Action.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *HeaderMutation_Remove) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Remove) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *HeaderMutation_Append) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Append != nil { + if size, ok := interface{}(m.Append).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Append) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.go index 663b06514..de2cf52d9 100644 --- a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.go +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc v5.26.1 // source: envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto package ext_procv3 @@ -12,10 +12,10 @@ import ( v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" v32 "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3" _ "github.com/envoyproxy/protoc-gen-validate/validate" - duration "github.com/golang/protobuf/ptypes/duration" - _struct "github.com/golang/protobuf/ptypes/struct" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + structpb "google.golang.org/protobuf/types/known/structpb" reflect "reflect" sync "sync" ) @@ -27,6 +27,66 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// Describes the route cache action to be taken when an external processor response +// is received in response to request headers. +type ExternalProcessor_RouteCacheAction int32 + +const ( + // The default behavior is to clear the route cache only when the + // :ref:`clear_route_cache ` + // field is set in an external processor response. + ExternalProcessor_DEFAULT ExternalProcessor_RouteCacheAction = 0 + // Always clear the route cache irrespective of the clear_route_cache bit in + // the external processor response. + ExternalProcessor_CLEAR ExternalProcessor_RouteCacheAction = 1 + // Do not clear the route cache irrespective of the clear_route_cache bit in + // the external processor response. Setting to RETAIN is equivalent to set the + // :ref:`disable_clear_route_cache ` + // to true. + ExternalProcessor_RETAIN ExternalProcessor_RouteCacheAction = 2 +) + +// Enum value maps for ExternalProcessor_RouteCacheAction. +var ( + ExternalProcessor_RouteCacheAction_name = map[int32]string{ + 0: "DEFAULT", + 1: "CLEAR", + 2: "RETAIN", + } + ExternalProcessor_RouteCacheAction_value = map[string]int32{ + "DEFAULT": 0, + "CLEAR": 1, + "RETAIN": 2, + } +) + +func (x ExternalProcessor_RouteCacheAction) Enum() *ExternalProcessor_RouteCacheAction { + p := new(ExternalProcessor_RouteCacheAction) + *p = x + return p +} + +func (x ExternalProcessor_RouteCacheAction) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ExternalProcessor_RouteCacheAction) Descriptor() protoreflect.EnumDescriptor { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_enumTypes[0].Descriptor() +} + +func (ExternalProcessor_RouteCacheAction) Type() protoreflect.EnumType { + return &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_enumTypes[0] +} + +func (x ExternalProcessor_RouteCacheAction) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ExternalProcessor_RouteCacheAction.Descriptor instead. +func (ExternalProcessor_RouteCacheAction) EnumDescriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{0, 0} +} + // The filter communicates with an external gRPC service called an "external processor" // that can do a variety of things with the request and response: // @@ -93,7 +153,7 @@ const ( // ` object in a namespace matching the filter // name. // -// [#next-free-field: 16] +// [#next-free-field: 21] type ExternalProcessor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -101,7 +161,15 @@ type ExternalProcessor struct { // Configuration for the gRPC service that the filter will communicate with. // The filter supports both the "Envoy" and "Google" gRPC clients. + // Only one of “grpc_service“ or “http_service“ can be set. + // It is required that one of them must be set. GrpcService *v3.GrpcService `protobuf:"bytes,1,opt,name=grpc_service,json=grpcService,proto3" json:"grpc_service,omitempty"` + // [#not-implemented-hide:] + // Configuration for the HTTP service that the filter will communicate with. + // Only one of “http_service“ or + // :ref:`grpc_service `. + // can be set. It is required that one of them must be set. + HttpService *ExtProcHttpService `protobuf:"bytes,20,opt,name=http_service,json=httpService,proto3" json:"http_service,omitempty"` // By default, if the gRPC stream cannot be established, or if it is closed // prematurely with an error, the filter will fail. Specifically, if the // response headers have not yet been delivered, then it will return a 500 @@ -113,21 +181,12 @@ type ExternalProcessor struct { // Specifies default options for how HTTP headers, trailers, and bodies are // sent. See ProcessingMode for details. ProcessingMode *ProcessingMode `protobuf:"bytes,3,opt,name=processing_mode,json=processingMode,proto3" json:"processing_mode,omitempty"` - // [#not-implemented-hide:] - // If true, send each part of the HTTP request or response specified by ProcessingMode - // asynchronously -- in other words, send the message on the gRPC stream and then continue - // filter processing. If false, which is the default, suspend filter execution after - // each message is sent to the remote service and wait up to "message_timeout" - // for a reply. - AsyncMode bool `protobuf:"varint,4,opt,name=async_mode,json=asyncMode,proto3" json:"async_mode,omitempty"` - // [#not-implemented-hide:] // Envoy provides a number of :ref:`attributes ` // for expressive policies. Each attribute name provided in this field will be // matched against that list and populated in the request_headers message. // See the :ref:`attribute documentation ` // for the list of supported attributes and their types. RequestAttributes []string `protobuf:"bytes,5,rep,name=request_attributes,json=requestAttributes,proto3" json:"request_attributes,omitempty"` - // [#not-implemented-hide:] // Envoy provides a number of :ref:`attributes ` // for expressive policies. Each attribute name provided in this field will be // matched against that list and populated in the response_headers message. @@ -142,7 +201,7 @@ type ExternalProcessor struct { // timeout when the filter is running in asynchronous mode. Zero is a valid // config which means the timer will be triggered immediately. If not // configured, default is 200 milliseconds. - MessageTimeout *duration.Duration `protobuf:"bytes,7,opt,name=message_timeout,json=messageTimeout,proto3" json:"message_timeout,omitempty"` + MessageTimeout *durationpb.Duration `protobuf:"bytes,7,opt,name=message_timeout,json=messageTimeout,proto3" json:"message_timeout,omitempty"` // Optional additional prefix to use when emitting statistics. This allows to distinguish // emitted statistics between configured *ext_proc* filters in an HTTP filter chain. StatPrefix string `protobuf:"bytes,8,opt,name=stat_prefix,json=statPrefix,proto3" json:"stat_prefix,omitempty"` @@ -161,18 +220,14 @@ type ExternalProcessor struct { // Specify the upper bound of // :ref:`override_message_timeout ` // If not specified, by default it is 0, which will effectively disable the “override_message_timeout“ API. - MaxMessageTimeout *duration.Duration `protobuf:"bytes,10,opt,name=max_message_timeout,json=maxMessageTimeout,proto3" json:"max_message_timeout,omitempty"` - // Prevents clearing the route-cache when the - // :ref:`clear_route_cache ` - // field is set in an external processor response. - DisableClearRouteCache bool `protobuf:"varint,11,opt,name=disable_clear_route_cache,json=disableClearRouteCache,proto3" json:"disable_clear_route_cache,omitempty"` + MaxMessageTimeout *durationpb.Duration `protobuf:"bytes,10,opt,name=max_message_timeout,json=maxMessageTimeout,proto3" json:"max_message_timeout,omitempty"` // Allow headers matching the “forward_rules“ to be forwarded to the external processing server. // If not set, all headers are forwarded to the external processing server. ForwardRules *HeaderForwardingRules `protobuf:"bytes,12,opt,name=forward_rules,json=forwardRules,proto3" json:"forward_rules,omitempty"` // Additional metadata to be added to the filter state for logging purposes. The metadata // will be added to StreamInfo's filter state under the namespace corresponding to the // ext_proc filter name. - FilterMetadata *_struct.Struct `protobuf:"bytes,13,opt,name=filter_metadata,json=filterMetadata,proto3" json:"filter_metadata,omitempty"` + FilterMetadata *structpb.Struct `protobuf:"bytes,13,opt,name=filter_metadata,json=filterMetadata,proto3" json:"filter_metadata,omitempty"` // If “allow_mode_override“ is set to true, the filter config :ref:`processing_mode // ` // can be overridden by the response message from the external processing server @@ -185,6 +240,47 @@ type ExternalProcessor struct { // Instead, the stream to the external processor will be closed. There will be no // more external processing for this stream from now on. DisableImmediateResponse bool `protobuf:"varint,15,opt,name=disable_immediate_response,json=disableImmediateResponse,proto3" json:"disable_immediate_response,omitempty"` + // Options related to the sending and receiving of dynamic metadata. + MetadataOptions *MetadataOptions `protobuf:"bytes,16,opt,name=metadata_options,json=metadataOptions,proto3" json:"metadata_options,omitempty"` + // If true, send each part of the HTTP request or response specified by ProcessingMode + // without pausing on filter chain iteration. It is "Send and Go" mode that can be used + // by external processor to observe Envoy data and status. In this mode: + // + // 1. Only STREAMED body processing mode is supported and any other body processing modes will be + // ignored. NONE mode(i.e., skip body processing) will still work as expected. + // + // 2. External processor should not send back processing response, as any responses will be ignored. + // This also means that + // :ref:`message_timeout ` + // restriction doesn't apply to this mode. + // + // 3. External processor may still close the stream to indicate that no more messages are needed. + // + // .. warning:: + // + // Flow control is necessary mechanism to prevent the fast sender (either downstream client or upstream server) + // from overwhelming the external processor when its processing speed is slower. + // This protective measure is being explored and developed but has not been ready yet, so please use your own + // discretion when enabling this feature. + // This work is currently tracked under https://github.com/envoyproxy/envoy/issues/33319. + ObservabilityMode bool `protobuf:"varint,17,opt,name=observability_mode,json=observabilityMode,proto3" json:"observability_mode,omitempty"` + // Prevents clearing the route-cache when the + // :ref:`clear_route_cache ` + // field is set in an external processor response. + // Only one of “disable_clear_route_cache“ or “route_cache_action“ can be set. + // It is recommended to set “route_cache_action“ which supersedes “disable_clear_route_cache“. + DisableClearRouteCache bool `protobuf:"varint,11,opt,name=disable_clear_route_cache,json=disableClearRouteCache,proto3" json:"disable_clear_route_cache,omitempty"` + // Specifies the action to be taken when an external processor response is + // received in response to request headers. It is recommended to set this field than set + // :ref:`disable_clear_route_cache `. + // Only one of “disable_clear_route_cache“ or “route_cache_action“ can be set. + RouteCacheAction ExternalProcessor_RouteCacheAction `protobuf:"varint,18,opt,name=route_cache_action,json=routeCacheAction,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor_RouteCacheAction" json:"route_cache_action,omitempty"` + // Specifies the deferred closure timeout for gRPC stream that connects to external processor. Currently, the deferred stream closure + // is only used in :ref:`observability_mode `. + // In observability mode, gRPC streams may be held open to the external processor longer than the lifetime of the regular client to + // backend stream lifetime. In this case, Envoy will eventually timeout the external processor stream according to this time limit. + // The default value is 5000 milliseconds (5 seconds) if not specified. + DeferredCloseTimeout *durationpb.Duration `protobuf:"bytes,19,opt,name=deferred_close_timeout,json=deferredCloseTimeout,proto3" json:"deferred_close_timeout,omitempty"` } func (x *ExternalProcessor) Reset() { @@ -226,6 +322,13 @@ func (x *ExternalProcessor) GetGrpcService() *v3.GrpcService { return nil } +func (x *ExternalProcessor) GetHttpService() *ExtProcHttpService { + if x != nil { + return x.HttpService + } + return nil +} + func (x *ExternalProcessor) GetFailureModeAllow() bool { if x != nil { return x.FailureModeAllow @@ -240,13 +343,6 @@ func (x *ExternalProcessor) GetProcessingMode() *ProcessingMode { return nil } -func (x *ExternalProcessor) GetAsyncMode() bool { - if x != nil { - return x.AsyncMode - } - return false -} - func (x *ExternalProcessor) GetRequestAttributes() []string { if x != nil { return x.RequestAttributes @@ -261,7 +357,7 @@ func (x *ExternalProcessor) GetResponseAttributes() []string { return nil } -func (x *ExternalProcessor) GetMessageTimeout() *duration.Duration { +func (x *ExternalProcessor) GetMessageTimeout() *durationpb.Duration { if x != nil { return x.MessageTimeout } @@ -282,20 +378,13 @@ func (x *ExternalProcessor) GetMutationRules() *v31.HeaderMutationRules { return nil } -func (x *ExternalProcessor) GetMaxMessageTimeout() *duration.Duration { +func (x *ExternalProcessor) GetMaxMessageTimeout() *durationpb.Duration { if x != nil { return x.MaxMessageTimeout } return nil } -func (x *ExternalProcessor) GetDisableClearRouteCache() bool { - if x != nil { - return x.DisableClearRouteCache - } - return false -} - func (x *ExternalProcessor) GetForwardRules() *HeaderForwardingRules { if x != nil { return x.ForwardRules @@ -303,7 +392,7 @@ func (x *ExternalProcessor) GetForwardRules() *HeaderForwardingRules { return nil } -func (x *ExternalProcessor) GetFilterMetadata() *_struct.Struct { +func (x *ExternalProcessor) GetFilterMetadata() *structpb.Struct { if x != nil { return x.FilterMetadata } @@ -324,6 +413,153 @@ func (x *ExternalProcessor) GetDisableImmediateResponse() bool { return false } +func (x *ExternalProcessor) GetMetadataOptions() *MetadataOptions { + if x != nil { + return x.MetadataOptions + } + return nil +} + +func (x *ExternalProcessor) GetObservabilityMode() bool { + if x != nil { + return x.ObservabilityMode + } + return false +} + +func (x *ExternalProcessor) GetDisableClearRouteCache() bool { + if x != nil { + return x.DisableClearRouteCache + } + return false +} + +func (x *ExternalProcessor) GetRouteCacheAction() ExternalProcessor_RouteCacheAction { + if x != nil { + return x.RouteCacheAction + } + return ExternalProcessor_DEFAULT +} + +func (x *ExternalProcessor) GetDeferredCloseTimeout() *durationpb.Duration { + if x != nil { + return x.DeferredCloseTimeout + } + return nil +} + +// ExtProcHttpService is used for HTTP communication between the filter and the external processing service. +type ExtProcHttpService struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Sets the HTTP service which the external processing requests must be sent to. + HttpService *v3.HttpService `protobuf:"bytes,1,opt,name=http_service,json=httpService,proto3" json:"http_service,omitempty"` +} + +func (x *ExtProcHttpService) Reset() { + *x = ExtProcHttpService{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExtProcHttpService) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExtProcHttpService) ProtoMessage() {} + +func (x *ExtProcHttpService) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExtProcHttpService.ProtoReflect.Descriptor instead. +func (*ExtProcHttpService) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{1} +} + +func (x *ExtProcHttpService) GetHttpService() *v3.HttpService { + if x != nil { + return x.HttpService + } + return nil +} + +// The MetadataOptions structure defines options for the sending and receiving of +// dynamic metadata. Specifically, which namespaces to send to the server, whether +// metadata returned by the server may be written, and how that metadata may be written. +type MetadataOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Describes which typed or untyped dynamic metadata namespaces to forward to + // the external processing server. + ForwardingNamespaces *MetadataOptions_MetadataNamespaces `protobuf:"bytes,1,opt,name=forwarding_namespaces,json=forwardingNamespaces,proto3" json:"forwarding_namespaces,omitempty"` + // Describes which typed or untyped dynamic metadata namespaces to accept from + // the external processing server. Set to empty or leave unset to disallow writing + // any received dynamic metadata. Receiving of typed metadata is not supported. + ReceivingNamespaces *MetadataOptions_MetadataNamespaces `protobuf:"bytes,2,opt,name=receiving_namespaces,json=receivingNamespaces,proto3" json:"receiving_namespaces,omitempty"` +} + +func (x *MetadataOptions) Reset() { + *x = MetadataOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MetadataOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetadataOptions) ProtoMessage() {} + +func (x *MetadataOptions) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MetadataOptions.ProtoReflect.Descriptor instead. +func (*MetadataOptions) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{2} +} + +func (x *MetadataOptions) GetForwardingNamespaces() *MetadataOptions_MetadataNamespaces { + if x != nil { + return x.ForwardingNamespaces + } + return nil +} + +func (x *MetadataOptions) GetReceivingNamespaces() *MetadataOptions_MetadataNamespaces { + if x != nil { + return x.ReceivingNamespaces + } + return nil +} + // The HeaderForwardingRules structure specifies what headers are // allowed to be forwarded to the external processing server. // @@ -352,7 +588,7 @@ type HeaderForwardingRules struct { func (x *HeaderForwardingRules) Reset() { *x = HeaderForwardingRules{} if protoimpl.UnsafeEnabled { - mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[1] + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -365,7 +601,7 @@ func (x *HeaderForwardingRules) String() string { func (*HeaderForwardingRules) ProtoMessage() {} func (x *HeaderForwardingRules) ProtoReflect() protoreflect.Message { - mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[1] + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -378,7 +614,7 @@ func (x *HeaderForwardingRules) ProtoReflect() protoreflect.Message { // Deprecated: Use HeaderForwardingRules.ProtoReflect.Descriptor instead. func (*HeaderForwardingRules) Descriptor() ([]byte, []int) { - return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{1} + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{3} } func (x *HeaderForwardingRules) GetAllowedHeaders() *v32.ListStringMatcher { @@ -412,7 +648,7 @@ type ExtProcPerRoute struct { func (x *ExtProcPerRoute) Reset() { *x = ExtProcPerRoute{} if protoimpl.UnsafeEnabled { - mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[2] + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -425,7 +661,7 @@ func (x *ExtProcPerRoute) String() string { func (*ExtProcPerRoute) ProtoMessage() {} func (x *ExtProcPerRoute) ProtoReflect() protoreflect.Message { - mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[2] + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -438,7 +674,7 @@ func (x *ExtProcPerRoute) ProtoReflect() protoreflect.Message { // Deprecated: Use ExtProcPerRoute.ProtoReflect.Descriptor instead. func (*ExtProcPerRoute) Descriptor() ([]byte, []int) { - return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{2} + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{4} } func (m *ExtProcPerRoute) GetOverride() isExtProcPerRoute_Override { @@ -484,7 +720,7 @@ func (*ExtProcPerRoute_Disabled) isExtProcPerRoute_Override() {} func (*ExtProcPerRoute_Overrides) isExtProcPerRoute_Override() {} // Overrides that may be set on a per-route basis -// [#next-free-field: 6] +// [#next-free-field: 8] type ExtProcOverrides struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -505,12 +741,23 @@ type ExtProcOverrides struct { ResponseAttributes []string `protobuf:"bytes,4,rep,name=response_attributes,json=responseAttributes,proto3" json:"response_attributes,omitempty"` // Set a different gRPC service for this route than the default. GrpcService *v3.GrpcService `protobuf:"bytes,5,opt,name=grpc_service,json=grpcService,proto3" json:"grpc_service,omitempty"` + // Options related to the sending and receiving of dynamic metadata. + // Lists of forwarding and receiving namespaces will be overridden in their entirety, + // meaning the most-specific config that specifies this override will be the final + // config used. It is the prerogative of the control plane to ensure this + // most-specific config contains the correct final overrides. + MetadataOptions *MetadataOptions `protobuf:"bytes,6,opt,name=metadata_options,json=metadataOptions,proto3" json:"metadata_options,omitempty"` + // Additional metadata to include into streams initiated to the ext_proc gRPC + // service. This can be used for scenarios in which additional ad hoc + // authorization headers (e.g. “x-foo-bar: baz-key“) are to be injected or + // when a route needs to partially override inherited metadata. + GrpcInitialMetadata []*v3.HeaderValue `protobuf:"bytes,7,rep,name=grpc_initial_metadata,json=grpcInitialMetadata,proto3" json:"grpc_initial_metadata,omitempty"` } func (x *ExtProcOverrides) Reset() { *x = ExtProcOverrides{} if protoimpl.UnsafeEnabled { - mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[3] + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -523,7 +770,7 @@ func (x *ExtProcOverrides) String() string { func (*ExtProcOverrides) ProtoMessage() {} func (x *ExtProcOverrides) ProtoReflect() protoreflect.Message { - mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[3] + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -536,7 +783,7 @@ func (x *ExtProcOverrides) ProtoReflect() protoreflect.Message { // Deprecated: Use ExtProcOverrides.ProtoReflect.Descriptor instead. func (*ExtProcOverrides) Descriptor() ([]byte, []int) { - return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{3} + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{5} } func (x *ExtProcOverrides) GetProcessingMode() *ProcessingMode { @@ -574,6 +821,81 @@ func (x *ExtProcOverrides) GetGrpcService() *v3.GrpcService { return nil } +func (x *ExtProcOverrides) GetMetadataOptions() *MetadataOptions { + if x != nil { + return x.MetadataOptions + } + return nil +} + +func (x *ExtProcOverrides) GetGrpcInitialMetadata() []*v3.HeaderValue { + if x != nil { + return x.GrpcInitialMetadata + } + return nil +} + +type MetadataOptions_MetadataNamespaces struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Specifies a list of metadata namespaces whose values, if present, + // will be passed to the ext_proc service as an opaque *protobuf::Struct*. + Untyped []string `protobuf:"bytes,1,rep,name=untyped,proto3" json:"untyped,omitempty"` + // Specifies a list of metadata namespaces whose values, if present, + // will be passed to the ext_proc service as a *protobuf::Any*. This allows + // envoy and the external processing server to share the protobuf message + // definition for safe parsing. + Typed []string `protobuf:"bytes,2,rep,name=typed,proto3" json:"typed,omitempty"` +} + +func (x *MetadataOptions_MetadataNamespaces) Reset() { + *x = MetadataOptions_MetadataNamespaces{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MetadataOptions_MetadataNamespaces) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetadataOptions_MetadataNamespaces) ProtoMessage() {} + +func (x *MetadataOptions_MetadataNamespaces) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MetadataOptions_MetadataNamespaces.ProtoReflect.Descriptor instead. +func (*MetadataOptions_MetadataNamespaces) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *MetadataOptions_MetadataNamespaces) GetUntyped() []string { + if x != nil { + return x.Untyped + } + return nil +} + +func (x *MetadataOptions_MetadataNamespaces) GetTyped() []string { + if x != nil { + return x.Typed + } + return nil +} + var File_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto protoreflect.FileDescriptor var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDesc = []byte{ @@ -587,29 +909,45 @@ var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDesc = []by 0x66, 0x69, 0x67, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x27, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x3f, 0x65, 0x6e, 0x76, 0x6f, - 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x73, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, - 0x6f, 0x63, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x65, 0x6e, 0x76, - 0x6f, 0x79, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, - 0x76, 0x33, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, - 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf7, 0x07, 0x0a, 0x11, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x0c, 0x67, - 0x72, 0x70, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0b, - 0x67, 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x66, + 0x6f, 0x1a, 0x1f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x27, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, + 0x33, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x3f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2f, 0x68, + 0x74, 0x74, 0x70, 0x2f, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2f, 0x76, 0x33, 0x2f, + 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0xdd, 0x0c, 0x0a, 0x11, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x63, + 0x65, 0x73, 0x73, 0x6f, 0x72, 0x12, 0x63, 0x0a, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x33, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x1d, + 0xf2, 0x98, 0xfe, 0x8f, 0x05, 0x17, 0x12, 0x15, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x67, + 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7f, 0x0a, 0x0c, 0x68, 0x74, + 0x74, 0x70, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x3d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, + 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x74, + 0x50, 0x72, 0x6f, 0x63, 0x48, 0x74, 0x74, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, + 0x1d, 0xf2, 0x98, 0xfe, 0x8f, 0x05, 0x17, 0x12, 0x15, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, + 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x52, 0x0b, + 0x68, 0x74, 0x74, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x62, 0x0a, 0x0f, 0x70, 0x72, 0x6f, @@ -618,110 +956,179 @@ var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDesc = []by 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x0e, 0x70, - 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x09, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x2d, 0x0a, 0x12, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x13, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x51, 0x0a, 0x0f, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0xaa, 0x01, 0x07, 0x22, 0x03, 0x08, 0x90, 0x1c, 0x32, 0x00, 0x52, - 0x0e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, - 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, - 0x12, 0x61, 0x0a, 0x0e, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, - 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6d, - 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x76, 0x33, - 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x75, 0x6c, 0x65, 0x73, 0x52, 0x0d, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, - 0x6c, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x13, 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xfa, 0x42, 0x0a, - 0xaa, 0x01, 0x07, 0x22, 0x03, 0x08, 0x90, 0x1c, 0x32, 0x00, 0x52, 0x11, 0x6d, 0x61, 0x78, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x39, 0x0a, - 0x19, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x72, - 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x16, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x52, 0x6f, - 0x75, 0x74, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x65, 0x0a, 0x0d, 0x66, 0x6f, 0x72, 0x77, - 0x61, 0x72, 0x64, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x40, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x2d, 0x0a, + 0x12, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x13, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x51, 0x0a, + 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0xaa, 0x01, 0x07, 0x22, 0x03, 0x08, 0x90, 0x1c, 0x32, 0x00, + 0x52, 0x0e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x12, 0x61, 0x0a, 0x0e, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, + 0x6c, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x65, 0x6e, 0x76, 0x6f, + 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x76, + 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x0d, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x75, 0x6c, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x13, 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xfa, 0x42, + 0x0a, 0xaa, 0x01, 0x07, 0x22, 0x03, 0x08, 0x90, 0x1c, 0x32, 0x00, 0x52, 0x11, 0x6d, 0x61, 0x78, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x65, + 0x0a, 0x0d, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, + 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, + 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, + 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x0c, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, + 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x0f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2e, 0x0a, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4d, 0x6f, 0x64, 0x65, 0x4f, + 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x3c, 0x0a, 0x1a, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x5f, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x49, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x10, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x3a, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, + 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0f, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2d, 0x0a, 0x12, + 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6d, 0x6f, + 0x64, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x59, 0x0a, 0x19, 0x64, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x72, 0x6f, 0x75, + 0x74, 0x65, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x42, 0x1e, + 0xf2, 0x98, 0xfe, 0x8f, 0x05, 0x18, 0x12, 0x16, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x72, 0x6f, + 0x75, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x52, 0x16, + 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x52, 0x6f, 0x75, 0x74, + 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x9b, 0x01, 0x0a, 0x12, 0x72, 0x6f, 0x75, 0x74, 0x65, + 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x12, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x4d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, + 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, + 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, + 0x72, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x1e, 0xf2, 0x98, 0xfe, 0x8f, 0x05, 0x18, 0x12, 0x16, 0x63, 0x6c, 0x65, 0x61, + 0x72, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x52, 0x10, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4f, 0x0a, 0x16, 0x64, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, + 0x5f, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x13, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x14, 0x64, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x36, 0x0a, 0x10, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x43, 0x61, + 0x63, 0x68, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, + 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4c, 0x45, 0x41, 0x52, 0x10, + 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x4a, 0x04, 0x08, + 0x04, 0x10, 0x05, 0x52, 0x0a, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x22, + 0x5a, 0x0a, 0x12, 0x45, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x48, 0x74, 0x74, 0x70, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x0b, + 0x68, 0x74, 0x74, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xdf, 0x02, 0x0a, 0x0f, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x82, 0x01, 0x0a, 0x15, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x4d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, - 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, - 0x73, 0x52, 0x0c, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, - 0x40, 0x0a, 0x0f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x2e, 0x0a, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x5f, - 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, - 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4d, 0x6f, 0x64, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, - 0x65, 0x12, 0x3c, 0x0a, 0x1a, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x6d, 0x6d, - 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x6d, - 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0xc3, 0x01, 0x0a, 0x15, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, - 0x64, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x51, 0x0a, 0x0f, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x6c, - 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x57, 0x0a, 0x12, - 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, - 0x65, 0x72, 0x52, 0x11, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x73, 0x22, 0xa6, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x50, 0x72, 0x6f, - 0x63, 0x50, 0x65, 0x72, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x08, 0x64, 0x69, 0x73, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x07, 0xfa, 0x42, 0x04, - 0x6a, 0x02, 0x08, 0x01, 0x48, 0x00, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x12, 0x5b, 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, + 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x14, + 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x73, 0x12, 0x80, 0x01, 0x0a, 0x14, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x69, + 0x6e, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, - 0x45, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, - 0x48, 0x00, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x42, 0x0f, 0x0a, - 0x08, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0xbb, - 0x02, 0x0a, 0x10, 0x45, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, - 0x64, 0x65, 0x73, 0x12, 0x62, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, - 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, - 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, - 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x73, 0x79, 0x6e, 0x63, - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x73, 0x79, - 0x6e, 0x63, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x41, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, - 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, - 0x0b, 0x67, 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0xae, 0x01, 0xba, - 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x02, 0x0a, 0x37, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, - 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x73, 0x52, 0x13, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x69, 0x6e, 0x67, 0x4e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x1a, 0x44, 0x0a, 0x12, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x18, 0x0a, + 0x07, 0x75, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, + 0x75, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x64, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x64, 0x22, 0xc3, 0x01, + 0x0a, 0x15, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, + 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x51, 0x0a, 0x0f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, + 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x28, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x57, 0x0a, 0x12, 0x64, 0x69, + 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, + 0x52, 0x11, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x73, 0x22, 0xa6, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x50, + 0x65, 0x72, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x6a, 0x02, + 0x08, 0x01, 0x48, 0x00, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x5b, + 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x3b, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, + 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, + 0x74, 0x50, 0x72, 0x6f, 0x63, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x48, 0x00, + 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x42, 0x0f, 0x0a, 0x08, 0x6f, + 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0xf9, 0x03, 0x0a, + 0x10, 0x45, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, + 0x73, 0x12, 0x62, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, + 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, + 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, + 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, + 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, + 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x73, 0x79, 0x6e, 0x63, + 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x6e, 0x76, + 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x33, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x0b, 0x67, + 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x65, 0x0a, 0x10, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, - 0x42, 0x0c, 0x45, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x5b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, - 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x73, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2f, - 0x76, 0x33, 0x3b, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x76, 0x33, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x0f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x55, 0x0a, 0x15, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, + 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x13, 0x67, 0x72, 0x70, 0x63, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0xae, 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06, + 0x02, 0x10, 0x02, 0x0a, 0x37, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, + 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, + 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x42, 0x0c, 0x45, 0x78, + 0x74, 0x50, 0x72, 0x6f, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x5b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2f, 0x68, 0x74, + 0x74, 0x70, 0x2f, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2f, 0x76, 0x33, 0x3b, 0x65, + 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -736,37 +1143,53 @@ func file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP() return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescData } -var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_goTypes = []interface{}{ - (*ExternalProcessor)(nil), // 0: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor - (*HeaderForwardingRules)(nil), // 1: envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules - (*ExtProcPerRoute)(nil), // 2: envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute - (*ExtProcOverrides)(nil), // 3: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides - (*v3.GrpcService)(nil), // 4: envoy.config.core.v3.GrpcService - (*ProcessingMode)(nil), // 5: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode - (*duration.Duration)(nil), // 6: google.protobuf.Duration - (*v31.HeaderMutationRules)(nil), // 7: envoy.config.common.mutation_rules.v3.HeaderMutationRules - (*_struct.Struct)(nil), // 8: google.protobuf.Struct - (*v32.ListStringMatcher)(nil), // 9: envoy.type.matcher.v3.ListStringMatcher + (ExternalProcessor_RouteCacheAction)(0), // 0: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.RouteCacheAction + (*ExternalProcessor)(nil), // 1: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor + (*ExtProcHttpService)(nil), // 2: envoy.extensions.filters.http.ext_proc.v3.ExtProcHttpService + (*MetadataOptions)(nil), // 3: envoy.extensions.filters.http.ext_proc.v3.MetadataOptions + (*HeaderForwardingRules)(nil), // 4: envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules + (*ExtProcPerRoute)(nil), // 5: envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute + (*ExtProcOverrides)(nil), // 6: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides + (*MetadataOptions_MetadataNamespaces)(nil), // 7: envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.MetadataNamespaces + (*v3.GrpcService)(nil), // 8: envoy.config.core.v3.GrpcService + (*ProcessingMode)(nil), // 9: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + (*durationpb.Duration)(nil), // 10: google.protobuf.Duration + (*v31.HeaderMutationRules)(nil), // 11: envoy.config.common.mutation_rules.v3.HeaderMutationRules + (*structpb.Struct)(nil), // 12: google.protobuf.Struct + (*v3.HttpService)(nil), // 13: envoy.config.core.v3.HttpService + (*v32.ListStringMatcher)(nil), // 14: envoy.type.matcher.v3.ListStringMatcher + (*v3.HeaderValue)(nil), // 15: envoy.config.core.v3.HeaderValue } var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_depIdxs = []int32{ - 4, // 0: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.grpc_service:type_name -> envoy.config.core.v3.GrpcService - 5, // 1: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.processing_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode - 6, // 2: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.message_timeout:type_name -> google.protobuf.Duration - 7, // 3: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.mutation_rules:type_name -> envoy.config.common.mutation_rules.v3.HeaderMutationRules - 6, // 4: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.max_message_timeout:type_name -> google.protobuf.Duration - 1, // 5: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.forward_rules:type_name -> envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules - 8, // 6: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.filter_metadata:type_name -> google.protobuf.Struct - 9, // 7: envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules.allowed_headers:type_name -> envoy.type.matcher.v3.ListStringMatcher - 9, // 8: envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules.disallowed_headers:type_name -> envoy.type.matcher.v3.ListStringMatcher - 3, // 9: envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute.overrides:type_name -> envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides - 5, // 10: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides.processing_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode - 4, // 11: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides.grpc_service:type_name -> envoy.config.core.v3.GrpcService - 12, // [12:12] is the sub-list for method output_type - 12, // [12:12] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 8, // 0: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.grpc_service:type_name -> envoy.config.core.v3.GrpcService + 2, // 1: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.http_service:type_name -> envoy.extensions.filters.http.ext_proc.v3.ExtProcHttpService + 9, // 2: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.processing_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + 10, // 3: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.message_timeout:type_name -> google.protobuf.Duration + 11, // 4: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.mutation_rules:type_name -> envoy.config.common.mutation_rules.v3.HeaderMutationRules + 10, // 5: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.max_message_timeout:type_name -> google.protobuf.Duration + 4, // 6: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.forward_rules:type_name -> envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules + 12, // 7: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.filter_metadata:type_name -> google.protobuf.Struct + 3, // 8: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.metadata_options:type_name -> envoy.extensions.filters.http.ext_proc.v3.MetadataOptions + 0, // 9: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.route_cache_action:type_name -> envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.RouteCacheAction + 10, // 10: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.deferred_close_timeout:type_name -> google.protobuf.Duration + 13, // 11: envoy.extensions.filters.http.ext_proc.v3.ExtProcHttpService.http_service:type_name -> envoy.config.core.v3.HttpService + 7, // 12: envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.forwarding_namespaces:type_name -> envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.MetadataNamespaces + 7, // 13: envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.receiving_namespaces:type_name -> envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.MetadataNamespaces + 14, // 14: envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules.allowed_headers:type_name -> envoy.type.matcher.v3.ListStringMatcher + 14, // 15: envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules.disallowed_headers:type_name -> envoy.type.matcher.v3.ListStringMatcher + 6, // 16: envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute.overrides:type_name -> envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides + 9, // 17: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides.processing_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + 8, // 18: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides.grpc_service:type_name -> envoy.config.core.v3.GrpcService + 3, // 19: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides.metadata_options:type_name -> envoy.extensions.filters.http.ext_proc.v3.MetadataOptions + 15, // 20: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides.grpc_initial_metadata:type_name -> envoy.config.core.v3.HeaderValue + 21, // [21:21] is the sub-list for method output_type + 21, // [21:21] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name } func init() { file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_init() } @@ -789,7 +1212,7 @@ func file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_init() { } } file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeaderForwardingRules); i { + switch v := v.(*ExtProcHttpService); i { case 0: return &v.state case 1: @@ -801,7 +1224,7 @@ func file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_init() { } } file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExtProcPerRoute); i { + switch v := v.(*MetadataOptions); i { case 0: return &v.state case 1: @@ -813,6 +1236,30 @@ func file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_init() { } } file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeaderForwardingRules); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExtProcPerRoute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExtProcOverrides); i { case 0: return &v.state @@ -824,8 +1271,20 @@ func file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_init() { return nil } } + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MetadataOptions_MetadataNamespaces); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } - file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[2].OneofWrappers = []interface{}{ + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[4].OneofWrappers = []interface{}{ (*ExtProcPerRoute_Disabled)(nil), (*ExtProcPerRoute_Overrides)(nil), } @@ -834,13 +1293,14 @@ func file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, + NumEnums: 1, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, GoTypes: file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_goTypes, DependencyIndexes: file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_depIdxs, + EnumInfos: file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_enumTypes, MessageInfos: file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes, }.Build() File_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto = out.File diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.validate.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.validate.go index 95277a3c9..091bfa7b3 100644 --- a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.validate.go +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.validate.go @@ -1,3 +1,4 @@ +//go:build !disable_pgv // Code generated by protoc-gen-validate. DO NOT EDIT. // source: envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto @@ -57,17 +58,6 @@ func (m *ExternalProcessor) validate(all bool) error { var errors []error - if m.GetGrpcService() == nil { - err := ExternalProcessorValidationError{ - field: "GrpcService", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - if all { switch v := interface{}(m.GetGrpcService()).(type) { case interface{ ValidateAll() error }: @@ -97,6 +87,35 @@ func (m *ExternalProcessor) validate(all bool) error { } } + if all { + switch v := interface{}(m.GetHttpService()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "HttpService", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "HttpService", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHttpService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "HttpService", + reason: "embedded message failed validation", + cause: err, + } + } + } + // no validation rules for FailureModeAllow if all { @@ -128,8 +147,6 @@ func (m *ExternalProcessor) validate(all bool) error { } } - // no validation rules for AsyncMode - if d := m.GetMessageTimeout(); d != nil { dur, err := d.AsDuration(), d.CheckValid() if err != nil { @@ -223,8 +240,6 @@ func (m *ExternalProcessor) validate(all bool) error { } } - // no validation rules for DisableClearRouteCache - if all { switch v := interface{}(m.GetForwardRules()).(type) { case interface{ ValidateAll() error }: @@ -287,6 +302,70 @@ func (m *ExternalProcessor) validate(all bool) error { // no validation rules for DisableImmediateResponse + if all { + switch v := interface{}(m.GetMetadataOptions()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "MetadataOptions", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "MetadataOptions", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMetadataOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "MetadataOptions", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for ObservabilityMode + + // no validation rules for DisableClearRouteCache + + // no validation rules for RouteCacheAction + + if all { + switch v := interface{}(m.GetDeferredCloseTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "DeferredCloseTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "DeferredCloseTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDeferredCloseTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "DeferredCloseTimeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + if len(errors) > 0 { return ExternalProcessorMultiError(errors) } @@ -367,6 +446,295 @@ var _ interface { ErrorName() string } = ExternalProcessorValidationError{} +// Validate checks the field values on ExtProcHttpService with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *ExtProcHttpService) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ExtProcHttpService with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ExtProcHttpServiceMultiError, or nil if none found. +func (m *ExtProcHttpService) ValidateAll() error { + return m.validate(true) +} + +func (m *ExtProcHttpService) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetHttpService()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExtProcHttpServiceValidationError{ + field: "HttpService", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExtProcHttpServiceValidationError{ + field: "HttpService", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHttpService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtProcHttpServiceValidationError{ + field: "HttpService", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return ExtProcHttpServiceMultiError(errors) + } + + return nil +} + +// ExtProcHttpServiceMultiError is an error wrapping multiple validation errors +// returned by ExtProcHttpService.ValidateAll() if the designated constraints +// aren't met. +type ExtProcHttpServiceMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ExtProcHttpServiceMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ExtProcHttpServiceMultiError) AllErrors() []error { return m } + +// ExtProcHttpServiceValidationError is the validation error returned by +// ExtProcHttpService.Validate if the designated constraints aren't met. +type ExtProcHttpServiceValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ExtProcHttpServiceValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ExtProcHttpServiceValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ExtProcHttpServiceValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ExtProcHttpServiceValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ExtProcHttpServiceValidationError) ErrorName() string { + return "ExtProcHttpServiceValidationError" +} + +// Error satisfies the builtin error interface +func (e ExtProcHttpServiceValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sExtProcHttpService.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ExtProcHttpServiceValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ExtProcHttpServiceValidationError{} + +// Validate checks the field values on MetadataOptions with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *MetadataOptions) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on MetadataOptions with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// MetadataOptionsMultiError, or nil if none found. +func (m *MetadataOptions) ValidateAll() error { + return m.validate(true) +} + +func (m *MetadataOptions) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetForwardingNamespaces()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, MetadataOptionsValidationError{ + field: "ForwardingNamespaces", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, MetadataOptionsValidationError{ + field: "ForwardingNamespaces", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetForwardingNamespaces()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MetadataOptionsValidationError{ + field: "ForwardingNamespaces", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetReceivingNamespaces()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, MetadataOptionsValidationError{ + field: "ReceivingNamespaces", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, MetadataOptionsValidationError{ + field: "ReceivingNamespaces", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetReceivingNamespaces()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MetadataOptionsValidationError{ + field: "ReceivingNamespaces", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return MetadataOptionsMultiError(errors) + } + + return nil +} + +// MetadataOptionsMultiError is an error wrapping multiple validation errors +// returned by MetadataOptions.ValidateAll() if the designated constraints +// aren't met. +type MetadataOptionsMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m MetadataOptionsMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m MetadataOptionsMultiError) AllErrors() []error { return m } + +// MetadataOptionsValidationError is the validation error returned by +// MetadataOptions.Validate if the designated constraints aren't met. +type MetadataOptionsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e MetadataOptionsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e MetadataOptionsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e MetadataOptionsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e MetadataOptionsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e MetadataOptionsValidationError) ErrorName() string { return "MetadataOptionsValidationError" } + +// Error satisfies the builtin error interface +func (e MetadataOptionsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMetadataOptions.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = MetadataOptionsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = MetadataOptionsValidationError{} + // Validate checks the field values on HeaderForwardingRules with the rules // defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. @@ -791,6 +1159,69 @@ func (m *ExtProcOverrides) validate(all bool) error { } } + if all { + switch v := interface{}(m.GetMetadataOptions()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "MetadataOptions", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "MetadataOptions", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMetadataOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtProcOverridesValidationError{ + field: "MetadataOptions", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetGrpcInitialMetadata() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: fmt.Sprintf("GrpcInitialMetadata[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: fmt.Sprintf("GrpcInitialMetadata[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtProcOverridesValidationError{ + field: fmt.Sprintf("GrpcInitialMetadata[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + if len(errors) > 0 { return ExtProcOverridesMultiError(errors) } @@ -868,3 +1299,108 @@ var _ interface { Cause() error ErrorName() string } = ExtProcOverridesValidationError{} + +// Validate checks the field values on MetadataOptions_MetadataNamespaces with +// the rules defined in the proto definition for this message. If any rules +// are violated, the first error encountered is returned, or nil if there are +// no violations. +func (m *MetadataOptions_MetadataNamespaces) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on MetadataOptions_MetadataNamespaces +// with the rules defined in the proto definition for this message. If any +// rules are violated, the result is a list of violation errors wrapped in +// MetadataOptions_MetadataNamespacesMultiError, or nil if none found. +func (m *MetadataOptions_MetadataNamespaces) ValidateAll() error { + return m.validate(true) +} + +func (m *MetadataOptions_MetadataNamespaces) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return MetadataOptions_MetadataNamespacesMultiError(errors) + } + + return nil +} + +// MetadataOptions_MetadataNamespacesMultiError is an error wrapping multiple +// validation errors returned by +// MetadataOptions_MetadataNamespaces.ValidateAll() if the designated +// constraints aren't met. +type MetadataOptions_MetadataNamespacesMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m MetadataOptions_MetadataNamespacesMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m MetadataOptions_MetadataNamespacesMultiError) AllErrors() []error { return m } + +// MetadataOptions_MetadataNamespacesValidationError is the validation error +// returned by MetadataOptions_MetadataNamespaces.Validate if the designated +// constraints aren't met. +type MetadataOptions_MetadataNamespacesValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e MetadataOptions_MetadataNamespacesValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e MetadataOptions_MetadataNamespacesValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e MetadataOptions_MetadataNamespacesValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e MetadataOptions_MetadataNamespacesValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e MetadataOptions_MetadataNamespacesValidationError) ErrorName() string { + return "MetadataOptions_MetadataNamespacesValidationError" +} + +// Error satisfies the builtin error interface +func (e MetadataOptions_MetadataNamespacesValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMetadataOptions_MetadataNamespaces.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = MetadataOptions_MetadataNamespacesValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = MetadataOptions_MetadataNamespacesValidationError{} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc_vtproto.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc_vtproto.pb.go new file mode 100644 index 000000000..8dd00a2a2 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc_vtproto.pb.go @@ -0,0 +1,996 @@ +//go:build vtprotobuf +// +build vtprotobuf + +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// source: envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto + +package ext_procv3 + +import ( + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + durationpb "github.com/planetscale/vtprotobuf/types/known/durationpb" + structpb "github.com/planetscale/vtprotobuf/types/known/structpb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *ExternalProcessor) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExternalProcessor) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ExternalProcessor) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.HttpService != nil { + size, err := m.HttpService.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if m.DeferredCloseTimeout != nil { + size, err := (*durationpb.Duration)(m.DeferredCloseTimeout).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if m.RouteCacheAction != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RouteCacheAction)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if m.ObservabilityMode { + i-- + if m.ObservabilityMode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + } + if m.MetadataOptions != nil { + size, err := m.MetadataOptions.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if m.DisableImmediateResponse { + i-- + if m.DisableImmediateResponse { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x78 + } + if m.AllowModeOverride { + i-- + if m.AllowModeOverride { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x70 + } + if m.FilterMetadata != nil { + size, err := (*structpb.Struct)(m.FilterMetadata).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x6a + } + if m.ForwardRules != nil { + size, err := m.ForwardRules.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x62 + } + if m.DisableClearRouteCache { + i-- + if m.DisableClearRouteCache { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if m.MaxMessageTimeout != nil { + size, err := (*durationpb.Duration)(m.MaxMessageTimeout).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + if m.MutationRules != nil { + if vtmsg, ok := interface{}(m.MutationRules).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.MutationRules) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x4a + } + if len(m.StatPrefix) > 0 { + i -= len(m.StatPrefix) + copy(dAtA[i:], m.StatPrefix) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StatPrefix))) + i-- + dAtA[i] = 0x42 + } + if m.MessageTimeout != nil { + size, err := (*durationpb.Duration)(m.MessageTimeout).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + if len(m.ResponseAttributes) > 0 { + for iNdEx := len(m.ResponseAttributes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ResponseAttributes[iNdEx]) + copy(dAtA[i:], m.ResponseAttributes[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ResponseAttributes[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.RequestAttributes) > 0 { + for iNdEx := len(m.RequestAttributes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RequestAttributes[iNdEx]) + copy(dAtA[i:], m.RequestAttributes[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RequestAttributes[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if m.ProcessingMode != nil { + size, err := m.ProcessingMode.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.FailureModeAllow { + i-- + if m.FailureModeAllow { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.GrpcService != nil { + if vtmsg, ok := interface{}(m.GrpcService).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.GrpcService) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ExtProcHttpService) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExtProcHttpService) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ExtProcHttpService) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.HttpService != nil { + if vtmsg, ok := interface{}(m.HttpService).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.HttpService) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MetadataOptions_MetadataNamespaces) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MetadataOptions_MetadataNamespaces) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *MetadataOptions_MetadataNamespaces) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Typed) > 0 { + for iNdEx := len(m.Typed) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Typed[iNdEx]) + copy(dAtA[i:], m.Typed[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Typed[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Untyped) > 0 { + for iNdEx := len(m.Untyped) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Untyped[iNdEx]) + copy(dAtA[i:], m.Untyped[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Untyped[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MetadataOptions) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MetadataOptions) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *MetadataOptions) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ReceivingNamespaces != nil { + size, err := m.ReceivingNamespaces.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.ForwardingNamespaces != nil { + size, err := m.ForwardingNamespaces.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HeaderForwardingRules) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HeaderForwardingRules) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HeaderForwardingRules) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.DisallowedHeaders != nil { + if vtmsg, ok := interface{}(m.DisallowedHeaders).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.DisallowedHeaders) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x12 + } + if m.AllowedHeaders != nil { + if vtmsg, ok := interface{}(m.AllowedHeaders).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.AllowedHeaders) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ExtProcPerRoute) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExtProcPerRoute) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ExtProcPerRoute) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if msg, ok := m.Override.(*ExtProcPerRoute_Overrides); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Override.(*ExtProcPerRoute_Disabled); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *ExtProcPerRoute_Disabled) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ExtProcPerRoute_Disabled) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + i-- + if m.Disabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} +func (m *ExtProcPerRoute_Overrides) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ExtProcPerRoute_Overrides) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Overrides != nil { + size, err := m.Overrides.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *ExtProcOverrides) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExtProcOverrides) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ExtProcOverrides) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.GrpcInitialMetadata) > 0 { + for iNdEx := len(m.GrpcInitialMetadata) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.GrpcInitialMetadata[iNdEx]).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.GrpcInitialMetadata[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x3a + } + } + if m.MetadataOptions != nil { + size, err := m.MetadataOptions.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if m.GrpcService != nil { + if vtmsg, ok := interface{}(m.GrpcService).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.GrpcService) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x2a + } + if len(m.ResponseAttributes) > 0 { + for iNdEx := len(m.ResponseAttributes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ResponseAttributes[iNdEx]) + copy(dAtA[i:], m.ResponseAttributes[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ResponseAttributes[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.RequestAttributes) > 0 { + for iNdEx := len(m.RequestAttributes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RequestAttributes[iNdEx]) + copy(dAtA[i:], m.RequestAttributes[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RequestAttributes[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if m.AsyncMode { + i-- + if m.AsyncMode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.ProcessingMode != nil { + size, err := m.ProcessingMode.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ExternalProcessor) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GrpcService != nil { + if size, ok := interface{}(m.GrpcService).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.GrpcService) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.FailureModeAllow { + n += 2 + } + if m.ProcessingMode != nil { + l = m.ProcessingMode.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.RequestAttributes) > 0 { + for _, s := range m.RequestAttributes { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.ResponseAttributes) > 0 { + for _, s := range m.ResponseAttributes { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.MessageTimeout != nil { + l = (*durationpb.Duration)(m.MessageTimeout).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.StatPrefix) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.MutationRules != nil { + if size, ok := interface{}(m.MutationRules).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.MutationRules) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.MaxMessageTimeout != nil { + l = (*durationpb.Duration)(m.MaxMessageTimeout).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.DisableClearRouteCache { + n += 2 + } + if m.ForwardRules != nil { + l = m.ForwardRules.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.FilterMetadata != nil { + l = (*structpb.Struct)(m.FilterMetadata).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.AllowModeOverride { + n += 2 + } + if m.DisableImmediateResponse { + n += 2 + } + if m.MetadataOptions != nil { + l = m.MetadataOptions.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ObservabilityMode { + n += 3 + } + if m.RouteCacheAction != 0 { + n += 2 + protohelpers.SizeOfVarint(uint64(m.RouteCacheAction)) + } + if m.DeferredCloseTimeout != nil { + l = (*durationpb.Duration)(m.DeferredCloseTimeout).SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.HttpService != nil { + l = m.HttpService.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ExtProcHttpService) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HttpService != nil { + if size, ok := interface{}(m.HttpService).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.HttpService) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *MetadataOptions_MetadataNamespaces) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Untyped) > 0 { + for _, s := range m.Untyped { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Typed) > 0 { + for _, s := range m.Typed { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *MetadataOptions) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ForwardingNamespaces != nil { + l = m.ForwardingNamespaces.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ReceivingNamespaces != nil { + l = m.ReceivingNamespaces.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *HeaderForwardingRules) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AllowedHeaders != nil { + if size, ok := interface{}(m.AllowedHeaders).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.AllowedHeaders) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.DisallowedHeaders != nil { + if size, ok := interface{}(m.DisallowedHeaders).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.DisallowedHeaders) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ExtProcPerRoute) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Override.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *ExtProcPerRoute_Disabled) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + return n +} +func (m *ExtProcPerRoute_Overrides) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Overrides != nil { + l = m.Overrides.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ExtProcOverrides) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProcessingMode != nil { + l = m.ProcessingMode.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.AsyncMode { + n += 2 + } + if len(m.RequestAttributes) > 0 { + for _, s := range m.RequestAttributes { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.ResponseAttributes) > 0 { + for _, s := range m.ResponseAttributes { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.GrpcService != nil { + if size, ok := interface{}(m.GrpcService).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.GrpcService) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.MetadataOptions != nil { + l = m.MetadataOptions.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.GrpcInitialMetadata) > 0 { + for _, e := range m.GrpcInitialMetadata { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.go index 0e60c6c51..633fcd4d8 100644 --- a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.go +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc v5.26.1 // source: envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto package ext_procv3 diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.validate.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.validate.go index 78202c108..7c7a2d909 100644 --- a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.validate.go +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.validate.go @@ -1,3 +1,4 @@ +//go:build !disable_pgv // Code generated by protoc-gen-validate. DO NOT EDIT. // source: envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode_vtproto.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode_vtproto.pb.go new file mode 100644 index 000000000..b59fc6748 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode_vtproto.pb.go @@ -0,0 +1,110 @@ +//go:build vtprotobuf +// +build vtprotobuf + +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// source: envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto + +package ext_procv3 + +import ( + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *ProcessingMode) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProcessingMode) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingMode) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ResponseTrailerMode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ResponseTrailerMode)) + i-- + dAtA[i] = 0x30 + } + if m.RequestTrailerMode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RequestTrailerMode)) + i-- + dAtA[i] = 0x28 + } + if m.ResponseBodyMode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ResponseBodyMode)) + i-- + dAtA[i] = 0x20 + } + if m.RequestBodyMode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RequestBodyMode)) + i-- + dAtA[i] = 0x18 + } + if m.ResponseHeaderMode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ResponseHeaderMode)) + i-- + dAtA[i] = 0x10 + } + if m.RequestHeaderMode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RequestHeaderMode)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProcessingMode) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestHeaderMode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.RequestHeaderMode)) + } + if m.ResponseHeaderMode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ResponseHeaderMode)) + } + if m.RequestBodyMode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.RequestBodyMode)) + } + if m.ResponseBodyMode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ResponseBodyMode)) + } + if m.RequestTrailerMode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.RequestTrailerMode)) + } + if m.ResponseTrailerMode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ResponseTrailerMode)) + } + n += len(m.unknownFields) + return n +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.go index af4069166..d7ca7384e 100644 --- a/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.go +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.go @@ -1,25 +1,22 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc v5.26.1 // source: envoy/service/ext_proc/v3/external_processor.proto package ext_procv3 import ( - context "context" _ "github.com/cncf/xds/go/udpa/annotations" - v31 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" - v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3" + _ "github.com/envoyproxy/go-control-plane/envoy/annotations" + v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + v31 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3" v32 "github.com/envoyproxy/go-control-plane/envoy/type/v3" _ "github.com/envoyproxy/protoc-gen-validate/validate" - duration "github.com/golang/protobuf/ptypes/duration" - _struct "github.com/golang/protobuf/ptypes/struct" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + structpb "google.golang.org/protobuf/types/known/structpb" reflect "reflect" sync "sync" ) @@ -94,23 +91,12 @@ func (CommonResponse_ResponseStatus) EnumDescriptor() ([]byte, []int) { // This represents the different types of messages that Envoy can send // to an external processing server. -// [#next-free-field: 8] +// [#next-free-field: 11] type ProcessingRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Specify whether the filter that sent this request is running in synchronous - // or asynchronous mode. The choice of synchronous or asynchronous mode - // can be set in the filter configuration, and defaults to false. - // - // - A value of “false“ indicates that the server must respond - // to this message by either sending back a matching ProcessingResponse message, - // or by closing the stream. - // - A value of “true“ indicates that the server must not respond to this - // message, although it may still close the stream to indicate that no more messages - // are needed. - AsyncMode bool `protobuf:"varint,1,opt,name=async_mode,json=asyncMode,proto3" json:"async_mode,omitempty"` // Each request message will include one of the following sub-messages. Which // ones are set for a particular HTTP request/response depend on the // processing mode. @@ -124,6 +110,24 @@ type ProcessingRequest struct { // *ProcessingRequest_RequestTrailers // *ProcessingRequest_ResponseTrailers Request isProcessingRequest_Request `protobuf_oneof:"request"` + // Dynamic metadata associated with the request. + MetadataContext *v3.Metadata `protobuf:"bytes,8,opt,name=metadata_context,json=metadataContext,proto3" json:"metadata_context,omitempty"` + // The values of properties selected by the “request_attributes“ + // or “response_attributes“ list in the configuration. Each entry + // in the list is populated from the standard + // :ref:`attributes ` supported across Envoy. + Attributes map[string]*structpb.Struct `protobuf:"bytes,9,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Specify whether the filter that sent this request is running in :ref:`observability_mode + // ` + // and defaults to false. + // + // - A value of “false“ indicates that the server must respond + // to this message by either sending back a matching ProcessingResponse message, + // or by closing the stream. + // - A value of “true“ indicates that the server should not respond to this message, as any + // responses will be ignored. However, it may still close the stream to indicate that no more messages + // are needed. + ObservabilityMode bool `protobuf:"varint,10,opt,name=observability_mode,json=observabilityMode,proto3" json:"observability_mode,omitempty"` } func (x *ProcessingRequest) Reset() { @@ -158,13 +162,6 @@ func (*ProcessingRequest) Descriptor() ([]byte, []int) { return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{0} } -func (x *ProcessingRequest) GetAsyncMode() bool { - if x != nil { - return x.AsyncMode - } - return false -} - func (m *ProcessingRequest) GetRequest() isProcessingRequest_Request { if m != nil { return m.Request @@ -214,57 +211,72 @@ func (x *ProcessingRequest) GetResponseTrailers() *HttpTrailers { return nil } +func (x *ProcessingRequest) GetMetadataContext() *v3.Metadata { + if x != nil { + return x.MetadataContext + } + return nil +} + +func (x *ProcessingRequest) GetAttributes() map[string]*structpb.Struct { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *ProcessingRequest) GetObservabilityMode() bool { + if x != nil { + return x.ObservabilityMode + } + return false +} + type isProcessingRequest_Request interface { isProcessingRequest_Request() } type ProcessingRequest_RequestHeaders struct { // Information about the HTTP request headers, as well as peer info and additional - // properties. Unless “async_mode“ is “true“, the server must send back a + // properties. Unless “observability_mode“ is “true“, the server must send back a // HeaderResponse message, an ImmediateResponse message, or close the stream. RequestHeaders *HttpHeaders `protobuf:"bytes,2,opt,name=request_headers,json=requestHeaders,proto3,oneof"` } type ProcessingRequest_ResponseHeaders struct { // Information about the HTTP response headers, as well as peer info and additional - // properties. Unless “async_mode“ is “true“, the server must send back a + // properties. Unless “observability_mode“ is “true“, the server must send back a // HeaderResponse message or close the stream. ResponseHeaders *HttpHeaders `protobuf:"bytes,3,opt,name=response_headers,json=responseHeaders,proto3,oneof"` } type ProcessingRequest_RequestBody struct { - // A chunk of the HTTP request body. Unless “async_mode“ is true, the server must send back + // A chunk of the HTTP request body. Unless “observability_mode“ is true, the server must send back // a BodyResponse message, an ImmediateResponse message, or close the stream. RequestBody *HttpBody `protobuf:"bytes,4,opt,name=request_body,json=requestBody,proto3,oneof"` } type ProcessingRequest_ResponseBody struct { - // A chunk of the HTTP request body. Unless “async_mode“ is “true“, the server must send back + // A chunk of the HTTP response body. Unless “observability_mode“ is “true“, the server must send back // a BodyResponse message or close the stream. ResponseBody *HttpBody `protobuf:"bytes,5,opt,name=response_body,json=responseBody,proto3,oneof"` } type ProcessingRequest_RequestTrailers struct { - // The HTTP trailers for the request path. Unless “async_mode“ is “true“, the server + // The HTTP trailers for the request path. Unless “observability_mode“ is “true“, the server // must send back a TrailerResponse message or close the stream. // - // This message is only sent if the trailers processing mode is set to “SEND“. - // If there are no trailers on the original downstream request, then this message - // will only be sent (with empty trailers waiting to be populated) if the - // processing mode is set before the request headers are sent, such as - // in the filter configuration. + // This message is only sent if the trailers processing mode is set to “SEND“ and + // the original downstream request has trailers. RequestTrailers *HttpTrailers `protobuf:"bytes,6,opt,name=request_trailers,json=requestTrailers,proto3,oneof"` } type ProcessingRequest_ResponseTrailers struct { - // The HTTP trailers for the response path. Unless “async_mode“ is “true“, the server + // The HTTP trailers for the response path. Unless “observability_mode“ is “true“, the server // must send back a TrailerResponse message or close the stream. // - // This message is only sent if the trailers processing mode is set to “SEND“. - // If there are no trailers on the original downstream request, then this message - // will only be sent (with empty trailers waiting to be populated) if the - // processing mode is set before the request headers are sent, such as - // in the filter configuration. + // This message is only sent if the trailers processing mode is set to “SEND“ and + // the original upstream response has trailers. ResponseTrailers *HttpTrailers `protobuf:"bytes,7,opt,name=response_trailers,json=responseTrailers,proto3,oneof"` } @@ -280,7 +292,7 @@ func (*ProcessingRequest_RequestTrailers) isProcessingRequest_Request() {} func (*ProcessingRequest_ResponseTrailers) isProcessingRequest_Request() {} -// For every ProcessingRequest received by the server with the “async_mode“ field +// For every ProcessingRequest received by the server with the “observability_mode“ field // set to false, the server must send back exactly one ProcessingResponse message. // [#next-free-field: 11] type ProcessingResponse struct { @@ -298,10 +310,10 @@ type ProcessingResponse struct { // *ProcessingResponse_ResponseTrailers // *ProcessingResponse_ImmediateResponse Response isProcessingResponse_Response `protobuf_oneof:"response"` - // [#not-implemented-hide:] - // Optional metadata that will be emitted as dynamic metadata to be consumed by the next - // filter. This metadata will be placed in the namespace “envoy.filters.http.ext_proc“. - DynamicMetadata *_struct.Struct `protobuf:"bytes,8,opt,name=dynamic_metadata,json=dynamicMetadata,proto3" json:"dynamic_metadata,omitempty"` + // Optional metadata that will be emitted as dynamic metadata to be consumed by + // following filters. This metadata will be placed in the namespace(s) specified by the top-level + // field name(s) of the struct. + DynamicMetadata *structpb.Struct `protobuf:"bytes,8,opt,name=dynamic_metadata,json=dynamicMetadata,proto3" json:"dynamic_metadata,omitempty"` // Override how parts of the HTTP request and response are processed // for the duration of this particular request/response only. Servers // may use this to intelligently control how requests are processed @@ -312,7 +324,7 @@ type ProcessingResponse struct { // :ref:`allow_mode_override // ` // is set to false. - ModeOverride *v3.ProcessingMode `protobuf:"bytes,9,opt,name=mode_override,json=modeOverride,proto3" json:"mode_override,omitempty"` + ModeOverride *v31.ProcessingMode `protobuf:"bytes,9,opt,name=mode_override,json=modeOverride,proto3" json:"mode_override,omitempty"` // When ext_proc server receives a request message, in case it needs more // time to process the message, it sends back a ProcessingResponse message // with a new timeout value. When Envoy receives this response message, @@ -326,7 +338,7 @@ type ProcessingResponse struct { // :ref:`max_message_timeout ` // Such message can be sent at most once in a particular Envoy ext_proc filter processing state. // To enable this API, one has to set “max_message_timeout“ to a number >= 1ms. - OverrideMessageTimeout *duration.Duration `protobuf:"bytes,10,opt,name=override_message_timeout,json=overrideMessageTimeout,proto3" json:"override_message_timeout,omitempty"` + OverrideMessageTimeout *durationpb.Duration `protobuf:"bytes,10,opt,name=override_message_timeout,json=overrideMessageTimeout,proto3" json:"override_message_timeout,omitempty"` } func (x *ProcessingResponse) Reset() { @@ -417,21 +429,21 @@ func (x *ProcessingResponse) GetImmediateResponse() *ImmediateResponse { return nil } -func (x *ProcessingResponse) GetDynamicMetadata() *_struct.Struct { +func (x *ProcessingResponse) GetDynamicMetadata() *structpb.Struct { if x != nil { return x.DynamicMetadata } return nil } -func (x *ProcessingResponse) GetModeOverride() *v3.ProcessingMode { +func (x *ProcessingResponse) GetModeOverride() *v31.ProcessingMode { if x != nil { return x.ModeOverride } return nil } -func (x *ProcessingResponse) GetOverrideMessageTimeout() *duration.Duration { +func (x *ProcessingResponse) GetOverrideMessageTimeout() *durationpb.Duration { if x != nil { return x.OverrideMessageTimeout } @@ -512,20 +524,16 @@ type HttpHeaders struct { // The HTTP request headers. All header keys will be // lower-cased, because HTTP header keys are case-insensitive. - // The “headers“ encoding is based on the runtime guard - // envoy_reloadable_features_send_header_raw_value setting. - // When it is true, the header value is encoded in the + // The header value is encoded in the // :ref:`raw_value ` field. - // When it is false, the header value is encoded in the - // :ref:`value ` field. - Headers *v31.HeaderMap `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers,omitempty"` + Headers *v3.HeaderMap `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers,omitempty"` // [#not-implemented-hide:] - // The values of properties selected by the “request_attributes“ - // or “response_attributes“ list in the configuration. Each entry - // in the list is populated - // from the standard :ref:`attributes ` - // supported across Envoy. - Attributes map[string]*_struct.Struct `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // This field is deprecated and not implemented. Attributes will be sent in + // the top-level :ref:`attributes ` field. - // When it is false, the header value is encoded in the - // :ref:`value ` field. - Trailers *v31.HeaderMap `protobuf:"bytes,1,opt,name=trailers,proto3" json:"trailers,omitempty"` + Trailers *v3.HeaderMap `protobuf:"bytes,1,opt,name=trailers,proto3" json:"trailers,omitempty"` } func (x *HttpTrailers) Reset() { @@ -687,7 +692,7 @@ func (*HttpTrailers) Descriptor() ([]byte, []int) { return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{4} } -func (x *HttpTrailers) GetTrailers() *v31.HeaderMap { +func (x *HttpTrailers) GetTrailers() *v3.HeaderMap { if x != nil { return x.Trailers } @@ -865,16 +870,13 @@ type CommonResponse struct { // Add new trailers to the message. This may be used when responding to either a // HttpHeaders or HttpBody message, but only if this message is returned // along with the CONTINUE_AND_REPLACE status. - // The “trailers“ encoding is based on the runtime guard - // envoy_reloadable_features_send_header_raw_value setting. - // When it is true, the header value is encoded in the + // The header value is encoded in the // :ref:`raw_value ` field. - // When it is false, the header value is encoded in the - // :ref:`value ` field. - Trailers *v31.HeaderMap `protobuf:"bytes,4,opt,name=trailers,proto3" json:"trailers,omitempty"` + Trailers *v3.HeaderMap `protobuf:"bytes,4,opt,name=trailers,proto3" json:"trailers,omitempty"` // Clear the route cache for the current client request. This is necessary // if the remote server modified headers that are used to calculate the route. - // This field is ignored in the response direction. + // This field is ignored in the response direction. This field is also ignored + // if the Envoy ext_proc filter is in the upstream filter chain. ClearRouteCache bool `protobuf:"varint,5,opt,name=clear_route_cache,json=clearRouteCache,proto3" json:"clear_route_cache,omitempty"` } @@ -931,7 +933,7 @@ func (x *CommonResponse) GetBodyMutation() *BodyMutation { return nil } -func (x *CommonResponse) GetTrailers() *v31.HeaderMap { +func (x *CommonResponse) GetTrailers() *v3.HeaderMap { if x != nil { return x.Trailers } @@ -963,7 +965,7 @@ type ImmediateResponse struct { Headers *HeaderMutation `protobuf:"bytes,2,opt,name=headers,proto3" json:"headers,omitempty"` // The message body to return with the response which is sent using the // text/plain content type, or encoded in the grpc-message header. - Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` + Body []byte `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` // If set, then include a gRPC status trailer. GrpcStatus *GrpcStatus `protobuf:"bytes,4,opt,name=grpc_status,json=grpcStatus,proto3" json:"grpc_status,omitempty"` // A string detailing why this local reply was sent, which may be included @@ -1018,11 +1020,11 @@ func (x *ImmediateResponse) GetHeaders() *HeaderMutation { return nil } -func (x *ImmediateResponse) GetBody() string { +func (x *ImmediateResponse) GetBody() []byte { if x != nil { return x.Body } - return "" + return nil } func (x *ImmediateResponse) GetGrpcStatus() *GrpcStatus { @@ -1098,13 +1100,9 @@ type HeaderMutation struct { // Add or replace HTTP headers. Attempts to set the value of // any “x-envoy“ header, and attempts to set the “:method“, // “:authority“, “:scheme“, or “host“ headers will be ignored. - // The “set_headers“ encoding is based on the runtime guard - // envoy_reloadable_features_send_header_raw_value setting. - // When it is true, the header value is encoded in the + // The header value is encoded in the // :ref:`raw_value ` field. - // When it is false, the header value is encoded in the - // :ref:`value ` field. - SetHeaders []*v31.HeaderValueOption `protobuf:"bytes,1,rep,name=set_headers,json=setHeaders,proto3" json:"set_headers,omitempty"` + SetHeaders []*v3.HeaderValueOption `protobuf:"bytes,1,rep,name=set_headers,json=setHeaders,proto3" json:"set_headers,omitempty"` // Remove these HTTP headers. Attempts to remove system headers -- // any header starting with “:“, plus “host“ -- will be ignored. RemoveHeaders []string `protobuf:"bytes,2,rep,name=remove_headers,json=removeHeaders,proto3" json:"remove_headers,omitempty"` @@ -1142,7 +1140,7 @@ func (*HeaderMutation) Descriptor() ([]byte, []int) { return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{11} } -func (x *HeaderMutation) GetSetHeaders() []*v31.HeaderValueOption { +func (x *HeaderMutation) GetSetHeaders() []*v3.HeaderValueOption { if x != nil { return x.SetHeaders } @@ -1261,224 +1259,246 @@ var file_envoy_service_ext_proc_v3_external_processor_proto_rawDesc = []byte{ 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x04, 0x0a, 0x11, 0x50, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, - 0x0a, 0x0a, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x09, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x51, 0x0a, - 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, - 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x48, 0x00, - 0x52, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, - 0x12, 0x53, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x6e, 0x76, - 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x73, 0x48, 0x00, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x48, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x6e, - 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, - 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x42, 0x6f, 0x64, 0x79, - 0x48, 0x00, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, - 0x4a, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x62, 0x6f, 0x64, 0x79, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, - 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x42, 0x6f, 0x64, 0x79, 0x48, 0x00, 0x52, 0x0c, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x54, 0x0a, 0x10, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, - 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x48, 0x00, - 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, - 0x73, 0x12, 0x56, 0x0a, 0x11, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x72, - 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, + 0x1a, 0x23, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd1, 0x06, + 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, - 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x54, 0x72, 0x61, - 0x69, 0x6c, 0x65, 0x72, 0x73, 0x48, 0x00, 0x52, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x0e, 0x0a, 0x07, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x81, 0x07, 0x0a, 0x12, 0x50, 0x72, - 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x55, 0x0a, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x6e, 0x76, 0x6f, - 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, - 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x57, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x48, 0x00, 0x52, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x53, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, + 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x48, 0x00, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x48, 0x0a, 0x0c, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, + 0x74, 0x70, 0x42, 0x6f, 0x64, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x4a, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, + 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, + 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x42, 0x6f, 0x64, + 0x79, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6f, 0x64, + 0x79, 0x12, 0x54, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x72, 0x61, + 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, + 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x54, 0x72, 0x61, 0x69, + 0x6c, 0x65, 0x72, 0x73, 0x48, 0x00, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, + 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x56, 0x0a, 0x11, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, + 0x74, 0x74, 0x70, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x48, 0x00, 0x52, 0x10, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x12, + 0x49, 0x0a, 0x10, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x78, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x6e, 0x76, 0x6f, + 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, + 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x5c, 0x0a, 0x0a, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, + 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, + 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x6f, 0x62, 0x73, 0x65, + 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x1a, 0x56, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x75, 0x63, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, + 0x0e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x4a, + 0x04, 0x08, 0x01, 0x10, 0x02, 0x52, 0x0a, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x6f, 0x64, + 0x65, 0x22, 0x81, 0x07, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0f, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, - 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, - 0x12, 0x4c, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6f, 0x64, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, - 0x76, 0x33, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, - 0x00, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x4e, - 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, - 0x33, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, - 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x58, - 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, - 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, - 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x5a, 0x0a, 0x11, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, - 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x48, 0x00, 0x52, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x72, 0x61, 0x69, - 0x6c, 0x65, 0x72, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, - 0x65, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6d, 0x6d, - 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, - 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x10, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x5e, 0x0a, 0x0d, 0x6d, 0x6f, 0x64, 0x65, 0x5f, - 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, - 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, - 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x0c, 0x6d, 0x6f, 0x64, 0x65, 0x4f, - 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x53, 0x0a, 0x18, 0x6f, 0x76, 0x65, 0x72, 0x72, - 0x69, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x16, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x42, 0x0f, 0x0a, 0x08, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x9c, 0x02, - 0x0a, 0x0b, 0x48, 0x74, 0x74, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x39, 0x0a, - 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x61, 0x70, 0x52, - 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x56, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, - 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, - 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, - 0x12, 0x22, 0x0a, 0x0d, 0x65, 0x6e, 0x64, 0x5f, 0x6f, 0x66, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x65, 0x6e, 0x64, 0x4f, 0x66, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x1a, 0x56, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x42, 0x0a, 0x08, - 0x48, 0x74, 0x74, 0x70, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x22, 0x0a, 0x0d, - 0x65, 0x6e, 0x64, 0x5f, 0x6f, 0x66, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0b, 0x65, 0x6e, 0x64, 0x4f, 0x66, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x22, 0x4b, 0x0a, 0x0c, 0x48, 0x74, 0x74, 0x70, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, - 0x12, 0x3b, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x4d, 0x61, 0x70, 0x52, 0x08, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x22, 0x58, 0x0a, - 0x0f, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x45, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x43, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x66, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x69, 0x6c, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0f, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, - 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x55, 0x0a, 0x0c, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x45, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb1, 0x03, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x38, 0x2e, 0x65, 0x6e, 0x76, 0x6f, + 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, + 0x57, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, - 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x52, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, - 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, - 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, - 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x0d, 0x62, 0x6f, 0x64, - 0x79, 0x5f, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x42, 0x6f, 0x64, - 0x79, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x62, 0x6f, 0x64, 0x79, 0x4d, - 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x69, 0x6c, - 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, - 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, - 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x61, 0x70, 0x52, 0x08, 0x74, 0x72, 0x61, 0x69, - 0x6c, 0x65, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x72, 0x6f, - 0x75, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, - 0x22, 0x38, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x4f, 0x4e, 0x54, 0x49, 0x4e, 0x55, 0x45, 0x10, 0x00, - 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4e, 0x54, 0x49, 0x4e, 0x55, 0x45, 0x5f, 0x41, 0x4e, 0x44, - 0x5f, 0x52, 0x45, 0x50, 0x4c, 0x41, 0x43, 0x45, 0x10, 0x01, 0x22, 0x8b, 0x02, 0x0a, 0x11, 0x49, - 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x33, - 0x2e, 0x48, 0x74, 0x74, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, - 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x43, 0x0a, - 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, - 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x6e, + 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x4e, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, + 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x58, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x5f, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2b, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x72, 0x61, + 0x69, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, + 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, + 0x12, 0x5a, 0x0a, 0x11, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x72, 0x61, + 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, - 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x0a, 0x67, 0x72, 0x70, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, - 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x24, 0x0a, 0x0a, 0x47, 0x72, 0x70, 0x63, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x81, - 0x01, 0x0a, 0x0e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x48, 0x0a, 0x0b, 0x73, 0x65, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, + 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x10, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x5d, 0x0a, 0x12, + 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, + 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x10, 0x64, + 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0f, + 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x5e, 0x0a, 0x0d, 0x6d, 0x6f, 0x64, 0x65, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, + 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, + 0x65, 0x52, 0x0c, 0x6d, 0x6f, 0x64, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, + 0x53, 0x0a, 0x18, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x16, 0x6f, 0x76, + 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x42, 0x0f, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0xa9, 0x02, 0x0a, 0x0b, 0x48, 0x74, 0x74, 0x70, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x39, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0a, 0x73, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x72, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x73, 0x22, 0x51, 0x0a, 0x0c, 0x42, 0x6f, 0x64, 0x79, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x1f, 0x0a, 0x0a, 0x63, 0x6c, 0x65, 0x61, - 0x72, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, - 0x63, 0x6c, 0x65, 0x61, 0x72, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x0a, 0x0a, 0x08, 0x6d, 0x75, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x81, 0x01, 0x0a, 0x11, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x12, 0x6c, 0x0a, 0x07, 0x50, - 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, - 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, + 0x61, 0x64, 0x65, 0x72, 0x4d, 0x61, 0x70, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x12, 0x63, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, - 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x98, 0x01, 0xba, 0x80, 0xc8, 0xd1, - 0x06, 0x02, 0x10, 0x02, 0x0a, 0x27, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x42, 0x16, 0x45, + 0x2e, 0x48, 0x74, 0x74, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0b, 0x92, 0xc7, + 0x86, 0xd8, 0x04, 0x03, 0x33, 0x2e, 0x30, 0x18, 0x01, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x65, 0x6e, 0x64, 0x5f, 0x6f, 0x66, 0x5f, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x65, 0x6e, + 0x64, 0x4f, 0x66, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x1a, 0x56, 0x0a, 0x0f, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2d, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0x42, 0x0a, 0x08, 0x48, 0x74, 0x74, 0x70, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x12, 0x0a, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x12, 0x22, 0x0a, 0x0d, 0x65, 0x6e, 0x64, 0x5f, 0x6f, 0x66, 0x5f, 0x73, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x65, 0x6e, 0x64, 0x4f, 0x66, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x22, 0x4b, 0x0a, 0x0c, 0x48, 0x74, 0x74, 0x70, 0x54, 0x72, 0x61, + 0x69, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x3b, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x61, 0x70, 0x52, 0x08, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, + 0x72, 0x73, 0x22, 0x58, 0x0a, 0x0f, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, + 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x66, 0x0a, 0x10, + 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x52, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x75, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x6e, 0x76, 0x6f, + 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, + 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x55, 0x0a, 0x0c, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, + 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb1, 0x03, 0x0a, 0x0e, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x38, + 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, + 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, + 0x10, 0x01, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x52, 0x0a, 0x0f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4c, + 0x0a, 0x0d, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, + 0x33, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, + 0x62, 0x6f, 0x64, 0x79, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x08, + 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x61, 0x70, 0x52, + 0x08, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x65, + 0x61, 0x72, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x52, 0x6f, 0x75, 0x74, 0x65, + 0x43, 0x61, 0x63, 0x68, 0x65, 0x22, 0x38, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x4f, 0x4e, 0x54, 0x49, + 0x4e, 0x55, 0x45, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4e, 0x54, 0x49, 0x4e, 0x55, + 0x45, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x52, 0x45, 0x50, 0x4c, 0x41, 0x43, 0x45, 0x10, 0x01, 0x22, + 0x8b, 0x02, 0x0a, 0x11, 0x49, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x43, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x67, + 0x72, 0x70, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x70, + 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0a, 0x67, 0x72, 0x70, 0x63, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x24, 0x0a, + 0x0a, 0x47, 0x72, 0x70, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x0e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x75, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, 0x0b, 0x73, 0x65, 0x74, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x73, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x22, 0x51, 0x0a, 0x0c, 0x42, 0x6f, 0x64, 0x79, 0x4d, + 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x1f, 0x0a, + 0x0a, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x48, 0x00, 0x52, 0x09, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x0a, + 0x0a, 0x08, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x81, 0x01, 0x0a, 0x11, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, - 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, - 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x65, 0x78, - 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2f, 0x76, 0x33, 0x3b, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, - 0x6f, 0x63, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x6c, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, + 0x70, 0x72, 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, + 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, + 0x6f, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x98, + 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x02, 0x0a, 0x27, 0x69, 0x6f, 0x2e, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2e, + 0x76, 0x33, 0x42, 0x16, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x63, + 0x65, 0x73, 0x73, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2f, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x2f, 0x76, 0x33, 0x3b, 0x65, + 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -1494,7 +1514,7 @@ func file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP() []byt } var file_envoy_service_ext_proc_v3_external_processor_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_envoy_service_ext_proc_v3_external_processor_proto_goTypes = []interface{}{ (CommonResponse_ResponseStatus)(0), // 0: envoy.service.ext_proc.v3.CommonResponse.ResponseStatus (*ProcessingRequest)(nil), // 1: envoy.service.ext_proc.v3.ProcessingRequest @@ -1510,13 +1530,15 @@ var file_envoy_service_ext_proc_v3_external_processor_proto_goTypes = []interfac (*GrpcStatus)(nil), // 11: envoy.service.ext_proc.v3.GrpcStatus (*HeaderMutation)(nil), // 12: envoy.service.ext_proc.v3.HeaderMutation (*BodyMutation)(nil), // 13: envoy.service.ext_proc.v3.BodyMutation - nil, // 14: envoy.service.ext_proc.v3.HttpHeaders.AttributesEntry - (*_struct.Struct)(nil), // 15: google.protobuf.Struct - (*v3.ProcessingMode)(nil), // 16: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode - (*duration.Duration)(nil), // 17: google.protobuf.Duration - (*v31.HeaderMap)(nil), // 18: envoy.config.core.v3.HeaderMap - (*v32.HttpStatus)(nil), // 19: envoy.type.v3.HttpStatus - (*v31.HeaderValueOption)(nil), // 20: envoy.config.core.v3.HeaderValueOption + nil, // 14: envoy.service.ext_proc.v3.ProcessingRequest.AttributesEntry + nil, // 15: envoy.service.ext_proc.v3.HttpHeaders.AttributesEntry + (*v3.Metadata)(nil), // 16: envoy.config.core.v3.Metadata + (*structpb.Struct)(nil), // 17: google.protobuf.Struct + (*v31.ProcessingMode)(nil), // 18: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + (*durationpb.Duration)(nil), // 19: google.protobuf.Duration + (*v3.HeaderMap)(nil), // 20: envoy.config.core.v3.HeaderMap + (*v32.HttpStatus)(nil), // 21: envoy.type.v3.HttpStatus + (*v3.HeaderValueOption)(nil), // 22: envoy.config.core.v3.HeaderValueOption } var file_envoy_service_ext_proc_v3_external_processor_proto_depIdxs = []int32{ 3, // 0: envoy.service.ext_proc.v3.ProcessingRequest.request_headers:type_name -> envoy.service.ext_proc.v3.HttpHeaders @@ -1525,38 +1547,41 @@ var file_envoy_service_ext_proc_v3_external_processor_proto_depIdxs = []int32{ 4, // 3: envoy.service.ext_proc.v3.ProcessingRequest.response_body:type_name -> envoy.service.ext_proc.v3.HttpBody 5, // 4: envoy.service.ext_proc.v3.ProcessingRequest.request_trailers:type_name -> envoy.service.ext_proc.v3.HttpTrailers 5, // 5: envoy.service.ext_proc.v3.ProcessingRequest.response_trailers:type_name -> envoy.service.ext_proc.v3.HttpTrailers - 6, // 6: envoy.service.ext_proc.v3.ProcessingResponse.request_headers:type_name -> envoy.service.ext_proc.v3.HeadersResponse - 6, // 7: envoy.service.ext_proc.v3.ProcessingResponse.response_headers:type_name -> envoy.service.ext_proc.v3.HeadersResponse - 8, // 8: envoy.service.ext_proc.v3.ProcessingResponse.request_body:type_name -> envoy.service.ext_proc.v3.BodyResponse - 8, // 9: envoy.service.ext_proc.v3.ProcessingResponse.response_body:type_name -> envoy.service.ext_proc.v3.BodyResponse - 7, // 10: envoy.service.ext_proc.v3.ProcessingResponse.request_trailers:type_name -> envoy.service.ext_proc.v3.TrailersResponse - 7, // 11: envoy.service.ext_proc.v3.ProcessingResponse.response_trailers:type_name -> envoy.service.ext_proc.v3.TrailersResponse - 10, // 12: envoy.service.ext_proc.v3.ProcessingResponse.immediate_response:type_name -> envoy.service.ext_proc.v3.ImmediateResponse - 15, // 13: envoy.service.ext_proc.v3.ProcessingResponse.dynamic_metadata:type_name -> google.protobuf.Struct - 16, // 14: envoy.service.ext_proc.v3.ProcessingResponse.mode_override:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode - 17, // 15: envoy.service.ext_proc.v3.ProcessingResponse.override_message_timeout:type_name -> google.protobuf.Duration - 18, // 16: envoy.service.ext_proc.v3.HttpHeaders.headers:type_name -> envoy.config.core.v3.HeaderMap - 14, // 17: envoy.service.ext_proc.v3.HttpHeaders.attributes:type_name -> envoy.service.ext_proc.v3.HttpHeaders.AttributesEntry - 18, // 18: envoy.service.ext_proc.v3.HttpTrailers.trailers:type_name -> envoy.config.core.v3.HeaderMap - 9, // 19: envoy.service.ext_proc.v3.HeadersResponse.response:type_name -> envoy.service.ext_proc.v3.CommonResponse - 12, // 20: envoy.service.ext_proc.v3.TrailersResponse.header_mutation:type_name -> envoy.service.ext_proc.v3.HeaderMutation - 9, // 21: envoy.service.ext_proc.v3.BodyResponse.response:type_name -> envoy.service.ext_proc.v3.CommonResponse - 0, // 22: envoy.service.ext_proc.v3.CommonResponse.status:type_name -> envoy.service.ext_proc.v3.CommonResponse.ResponseStatus - 12, // 23: envoy.service.ext_proc.v3.CommonResponse.header_mutation:type_name -> envoy.service.ext_proc.v3.HeaderMutation - 13, // 24: envoy.service.ext_proc.v3.CommonResponse.body_mutation:type_name -> envoy.service.ext_proc.v3.BodyMutation - 18, // 25: envoy.service.ext_proc.v3.CommonResponse.trailers:type_name -> envoy.config.core.v3.HeaderMap - 19, // 26: envoy.service.ext_proc.v3.ImmediateResponse.status:type_name -> envoy.type.v3.HttpStatus - 12, // 27: envoy.service.ext_proc.v3.ImmediateResponse.headers:type_name -> envoy.service.ext_proc.v3.HeaderMutation - 11, // 28: envoy.service.ext_proc.v3.ImmediateResponse.grpc_status:type_name -> envoy.service.ext_proc.v3.GrpcStatus - 20, // 29: envoy.service.ext_proc.v3.HeaderMutation.set_headers:type_name -> envoy.config.core.v3.HeaderValueOption - 15, // 30: envoy.service.ext_proc.v3.HttpHeaders.AttributesEntry.value:type_name -> google.protobuf.Struct - 1, // 31: envoy.service.ext_proc.v3.ExternalProcessor.Process:input_type -> envoy.service.ext_proc.v3.ProcessingRequest - 2, // 32: envoy.service.ext_proc.v3.ExternalProcessor.Process:output_type -> envoy.service.ext_proc.v3.ProcessingResponse - 32, // [32:33] is the sub-list for method output_type - 31, // [31:32] is the sub-list for method input_type - 31, // [31:31] is the sub-list for extension type_name - 31, // [31:31] is the sub-list for extension extendee - 0, // [0:31] is the sub-list for field type_name + 16, // 6: envoy.service.ext_proc.v3.ProcessingRequest.metadata_context:type_name -> envoy.config.core.v3.Metadata + 14, // 7: envoy.service.ext_proc.v3.ProcessingRequest.attributes:type_name -> envoy.service.ext_proc.v3.ProcessingRequest.AttributesEntry + 6, // 8: envoy.service.ext_proc.v3.ProcessingResponse.request_headers:type_name -> envoy.service.ext_proc.v3.HeadersResponse + 6, // 9: envoy.service.ext_proc.v3.ProcessingResponse.response_headers:type_name -> envoy.service.ext_proc.v3.HeadersResponse + 8, // 10: envoy.service.ext_proc.v3.ProcessingResponse.request_body:type_name -> envoy.service.ext_proc.v3.BodyResponse + 8, // 11: envoy.service.ext_proc.v3.ProcessingResponse.response_body:type_name -> envoy.service.ext_proc.v3.BodyResponse + 7, // 12: envoy.service.ext_proc.v3.ProcessingResponse.request_trailers:type_name -> envoy.service.ext_proc.v3.TrailersResponse + 7, // 13: envoy.service.ext_proc.v3.ProcessingResponse.response_trailers:type_name -> envoy.service.ext_proc.v3.TrailersResponse + 10, // 14: envoy.service.ext_proc.v3.ProcessingResponse.immediate_response:type_name -> envoy.service.ext_proc.v3.ImmediateResponse + 17, // 15: envoy.service.ext_proc.v3.ProcessingResponse.dynamic_metadata:type_name -> google.protobuf.Struct + 18, // 16: envoy.service.ext_proc.v3.ProcessingResponse.mode_override:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + 19, // 17: envoy.service.ext_proc.v3.ProcessingResponse.override_message_timeout:type_name -> google.protobuf.Duration + 20, // 18: envoy.service.ext_proc.v3.HttpHeaders.headers:type_name -> envoy.config.core.v3.HeaderMap + 15, // 19: envoy.service.ext_proc.v3.HttpHeaders.attributes:type_name -> envoy.service.ext_proc.v3.HttpHeaders.AttributesEntry + 20, // 20: envoy.service.ext_proc.v3.HttpTrailers.trailers:type_name -> envoy.config.core.v3.HeaderMap + 9, // 21: envoy.service.ext_proc.v3.HeadersResponse.response:type_name -> envoy.service.ext_proc.v3.CommonResponse + 12, // 22: envoy.service.ext_proc.v3.TrailersResponse.header_mutation:type_name -> envoy.service.ext_proc.v3.HeaderMutation + 9, // 23: envoy.service.ext_proc.v3.BodyResponse.response:type_name -> envoy.service.ext_proc.v3.CommonResponse + 0, // 24: envoy.service.ext_proc.v3.CommonResponse.status:type_name -> envoy.service.ext_proc.v3.CommonResponse.ResponseStatus + 12, // 25: envoy.service.ext_proc.v3.CommonResponse.header_mutation:type_name -> envoy.service.ext_proc.v3.HeaderMutation + 13, // 26: envoy.service.ext_proc.v3.CommonResponse.body_mutation:type_name -> envoy.service.ext_proc.v3.BodyMutation + 20, // 27: envoy.service.ext_proc.v3.CommonResponse.trailers:type_name -> envoy.config.core.v3.HeaderMap + 21, // 28: envoy.service.ext_proc.v3.ImmediateResponse.status:type_name -> envoy.type.v3.HttpStatus + 12, // 29: envoy.service.ext_proc.v3.ImmediateResponse.headers:type_name -> envoy.service.ext_proc.v3.HeaderMutation + 11, // 30: envoy.service.ext_proc.v3.ImmediateResponse.grpc_status:type_name -> envoy.service.ext_proc.v3.GrpcStatus + 22, // 31: envoy.service.ext_proc.v3.HeaderMutation.set_headers:type_name -> envoy.config.core.v3.HeaderValueOption + 17, // 32: envoy.service.ext_proc.v3.ProcessingRequest.AttributesEntry.value:type_name -> google.protobuf.Struct + 17, // 33: envoy.service.ext_proc.v3.HttpHeaders.AttributesEntry.value:type_name -> google.protobuf.Struct + 1, // 34: envoy.service.ext_proc.v3.ExternalProcessor.Process:input_type -> envoy.service.ext_proc.v3.ProcessingRequest + 2, // 35: envoy.service.ext_proc.v3.ExternalProcessor.Process:output_type -> envoy.service.ext_proc.v3.ProcessingResponse + 35, // [35:36] is the sub-list for method output_type + 34, // [34:35] is the sub-list for method input_type + 34, // [34:34] is the sub-list for extension type_name + 34, // [34:34] is the sub-list for extension extendee + 0, // [0:34] is the sub-list for field type_name } func init() { file_envoy_service_ext_proc_v3_external_processor_proto_init() } @@ -1749,7 +1774,7 @@ func file_envoy_service_ext_proc_v3_external_processor_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_envoy_service_ext_proc_v3_external_processor_proto_rawDesc, NumEnums: 1, - NumMessages: 14, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, @@ -1763,123 +1788,3 @@ func file_envoy_service_ext_proc_v3_external_processor_proto_init() { file_envoy_service_ext_proc_v3_external_processor_proto_goTypes = nil file_envoy_service_ext_proc_v3_external_processor_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// ExternalProcessorClient is the client API for ExternalProcessor service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ExternalProcessorClient interface { - // This begins the bidirectional stream that Envoy will use to - // give the server control over what the filter does. The actual - // protocol is described by the ProcessingRequest and ProcessingResponse - // messages below. - Process(ctx context.Context, opts ...grpc.CallOption) (ExternalProcessor_ProcessClient, error) -} - -type externalProcessorClient struct { - cc grpc.ClientConnInterface -} - -func NewExternalProcessorClient(cc grpc.ClientConnInterface) ExternalProcessorClient { - return &externalProcessorClient{cc} -} - -func (c *externalProcessorClient) Process(ctx context.Context, opts ...grpc.CallOption) (ExternalProcessor_ProcessClient, error) { - stream, err := c.cc.NewStream(ctx, &_ExternalProcessor_serviceDesc.Streams[0], "/envoy.service.ext_proc.v3.ExternalProcessor/Process", opts...) - if err != nil { - return nil, err - } - x := &externalProcessorProcessClient{stream} - return x, nil -} - -type ExternalProcessor_ProcessClient interface { - Send(*ProcessingRequest) error - Recv() (*ProcessingResponse, error) - grpc.ClientStream -} - -type externalProcessorProcessClient struct { - grpc.ClientStream -} - -func (x *externalProcessorProcessClient) Send(m *ProcessingRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *externalProcessorProcessClient) Recv() (*ProcessingResponse, error) { - m := new(ProcessingResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// ExternalProcessorServer is the server API for ExternalProcessor service. -type ExternalProcessorServer interface { - // This begins the bidirectional stream that Envoy will use to - // give the server control over what the filter does. The actual - // protocol is described by the ProcessingRequest and ProcessingResponse - // messages below. - Process(ExternalProcessor_ProcessServer) error -} - -// UnimplementedExternalProcessorServer can be embedded to have forward compatible implementations. -type UnimplementedExternalProcessorServer struct { -} - -func (*UnimplementedExternalProcessorServer) Process(ExternalProcessor_ProcessServer) error { - return status.Errorf(codes.Unimplemented, "method Process not implemented") -} - -func RegisterExternalProcessorServer(s *grpc.Server, srv ExternalProcessorServer) { - s.RegisterService(&_ExternalProcessor_serviceDesc, srv) -} - -func _ExternalProcessor_Process_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ExternalProcessorServer).Process(&externalProcessorProcessServer{stream}) -} - -type ExternalProcessor_ProcessServer interface { - Send(*ProcessingResponse) error - Recv() (*ProcessingRequest, error) - grpc.ServerStream -} - -type externalProcessorProcessServer struct { - grpc.ServerStream -} - -func (x *externalProcessorProcessServer) Send(m *ProcessingResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *externalProcessorProcessServer) Recv() (*ProcessingRequest, error) { - m := new(ProcessingRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _ExternalProcessor_serviceDesc = grpc.ServiceDesc{ - ServiceName: "envoy.service.ext_proc.v3.ExternalProcessor", - HandlerType: (*ExternalProcessorServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Process", - Handler: _ExternalProcessor_Process_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "envoy/service/ext_proc/v3/external_processor.proto", -} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.validate.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.validate.go index b6215e8f9..382770bc9 100644 --- a/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.validate.go +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.validate.go @@ -1,3 +1,4 @@ +//go:build !disable_pgv // Code generated by protoc-gen-validate. DO NOT EDIT. // source: envoy/service/ext_proc/v3/external_processor.proto @@ -57,7 +58,82 @@ func (m *ProcessingRequest) validate(all bool) error { var errors []error - // no validation rules for AsyncMode + if all { + switch v := interface{}(m.GetMetadataContext()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "MetadataContext", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "MetadataContext", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMetadataContext()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "MetadataContext", + reason: "embedded message failed validation", + cause: err, + } + } + } + + { + sorted_keys := make([]string, len(m.GetAttributes())) + i := 0 + for key := range m.GetAttributes() { + sorted_keys[i] = key + i++ + } + sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) + for _, key := range sorted_keys { + val := m.GetAttributes()[key] + _ = val + + // no validation rules for Attributes[key] + + if all { + switch v := interface{}(val).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: fmt.Sprintf("Attributes[%v]", key), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: fmt.Sprintf("Attributes[%v]", key), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: fmt.Sprintf("Attributes[%v]", key), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + } + + // no validation rules for ObservabilityMode oneofRequestPresent := false switch v := m.Request.(type) { diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_grpc.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_grpc.pb.go new file mode 100644 index 000000000..3415b2cf9 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_grpc.pb.go @@ -0,0 +1,147 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v5.26.1 +// source: envoy/service/ext_proc/v3/external_processor.proto + +package ext_procv3 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ExternalProcessor_Process_FullMethodName = "/envoy.service.ext_proc.v3.ExternalProcessor/Process" +) + +// ExternalProcessorClient is the client API for ExternalProcessor service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ExternalProcessorClient interface { + // This begins the bidirectional stream that Envoy will use to + // give the server control over what the filter does. The actual + // protocol is described by the ProcessingRequest and ProcessingResponse + // messages below. + Process(ctx context.Context, opts ...grpc.CallOption) (ExternalProcessor_ProcessClient, error) +} + +type externalProcessorClient struct { + cc grpc.ClientConnInterface +} + +func NewExternalProcessorClient(cc grpc.ClientConnInterface) ExternalProcessorClient { + return &externalProcessorClient{cc} +} + +func (c *externalProcessorClient) Process(ctx context.Context, opts ...grpc.CallOption) (ExternalProcessor_ProcessClient, error) { + stream, err := c.cc.NewStream(ctx, &ExternalProcessor_ServiceDesc.Streams[0], ExternalProcessor_Process_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &externalProcessorProcessClient{stream} + return x, nil +} + +type ExternalProcessor_ProcessClient interface { + Send(*ProcessingRequest) error + Recv() (*ProcessingResponse, error) + grpc.ClientStream +} + +type externalProcessorProcessClient struct { + grpc.ClientStream +} + +func (x *externalProcessorProcessClient) Send(m *ProcessingRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *externalProcessorProcessClient) Recv() (*ProcessingResponse, error) { + m := new(ProcessingResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ExternalProcessorServer is the server API for ExternalProcessor service. +// All implementations should embed UnimplementedExternalProcessorServer +// for forward compatibility +type ExternalProcessorServer interface { + // This begins the bidirectional stream that Envoy will use to + // give the server control over what the filter does. The actual + // protocol is described by the ProcessingRequest and ProcessingResponse + // messages below. + Process(ExternalProcessor_ProcessServer) error +} + +// UnimplementedExternalProcessorServer should be embedded to have forward compatible implementations. +type UnimplementedExternalProcessorServer struct { +} + +func (UnimplementedExternalProcessorServer) Process(ExternalProcessor_ProcessServer) error { + return status.Errorf(codes.Unimplemented, "method Process not implemented") +} + +// UnsafeExternalProcessorServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ExternalProcessorServer will +// result in compilation errors. +type UnsafeExternalProcessorServer interface { + mustEmbedUnimplementedExternalProcessorServer() +} + +func RegisterExternalProcessorServer(s grpc.ServiceRegistrar, srv ExternalProcessorServer) { + s.RegisterService(&ExternalProcessor_ServiceDesc, srv) +} + +func _ExternalProcessor_Process_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ExternalProcessorServer).Process(&externalProcessorProcessServer{stream}) +} + +type ExternalProcessor_ProcessServer interface { + Send(*ProcessingResponse) error + Recv() (*ProcessingRequest, error) + grpc.ServerStream +} + +type externalProcessorProcessServer struct { + grpc.ServerStream +} + +func (x *externalProcessorProcessServer) Send(m *ProcessingResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *externalProcessorProcessServer) Recv() (*ProcessingRequest, error) { + m := new(ProcessingRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ExternalProcessor_ServiceDesc is the grpc.ServiceDesc for ExternalProcessor service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ExternalProcessor_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "envoy.service.ext_proc.v3.ExternalProcessor", + HandlerType: (*ExternalProcessorServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Process", + Handler: _ExternalProcessor_Process_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "envoy/service/ext_proc/v3/external_processor.proto", +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_vtproto.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_vtproto.pb.go new file mode 100644 index 000000000..509499168 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_vtproto.pb.go @@ -0,0 +1,1767 @@ +//go:build vtprotobuf +// +build vtprotobuf + +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// source: envoy/service/ext_proc/v3/external_processor.proto + +package ext_procv3 + +import ( + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + durationpb "github.com/planetscale/vtprotobuf/types/known/durationpb" + structpb "github.com/planetscale/vtprotobuf/types/known/structpb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *ProcessingRequest) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProcessingRequest) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ObservabilityMode { + i-- + if m.ObservabilityMode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if len(m.Attributes) > 0 { + for k := range m.Attributes { + v := m.Attributes[k] + baseI := i + size, err := (*structpb.Struct)(v).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + if m.MetadataContext != nil { + if vtmsg, ok := interface{}(m.MetadataContext).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.MetadataContext) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x42 + } + if msg, ok := m.Request.(*ProcessingRequest_ResponseTrailers); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Request.(*ProcessingRequest_RequestTrailers); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Request.(*ProcessingRequest_ResponseBody); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Request.(*ProcessingRequest_RequestBody); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Request.(*ProcessingRequest_ResponseHeaders); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Request.(*ProcessingRequest_RequestHeaders); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *ProcessingRequest_RequestHeaders) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingRequest_RequestHeaders) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RequestHeaders != nil { + size, err := m.RequestHeaders.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *ProcessingRequest_ResponseHeaders) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingRequest_ResponseHeaders) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ResponseHeaders != nil { + size, err := m.ResponseHeaders.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *ProcessingRequest_RequestBody) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingRequest_RequestBody) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RequestBody != nil { + size, err := m.RequestBody.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *ProcessingRequest_ResponseBody) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingRequest_ResponseBody) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ResponseBody != nil { + size, err := m.ResponseBody.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *ProcessingRequest_RequestTrailers) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingRequest_RequestTrailers) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RequestTrailers != nil { + size, err := m.RequestTrailers.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *ProcessingRequest_ResponseTrailers) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingRequest_ResponseTrailers) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ResponseTrailers != nil { + size, err := m.ResponseTrailers.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProcessingResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.OverrideMessageTimeout != nil { + size, err := (*durationpb.Duration)(m.OverrideMessageTimeout).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + if m.ModeOverride != nil { + if vtmsg, ok := interface{}(m.ModeOverride).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.ModeOverride) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x4a + } + if m.DynamicMetadata != nil { + size, err := (*structpb.Struct)(m.DynamicMetadata).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + if msg, ok := m.Response.(*ProcessingResponse_ImmediateResponse); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Response.(*ProcessingResponse_ResponseTrailers); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Response.(*ProcessingResponse_RequestTrailers); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Response.(*ProcessingResponse_ResponseBody); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Response.(*ProcessingResponse_RequestBody); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Response.(*ProcessingResponse_ResponseHeaders); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Response.(*ProcessingResponse_RequestHeaders); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *ProcessingResponse_RequestHeaders) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_RequestHeaders) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RequestHeaders != nil { + size, err := m.RequestHeaders.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse_ResponseHeaders) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_ResponseHeaders) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ResponseHeaders != nil { + size, err := m.ResponseHeaders.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse_RequestBody) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_RequestBody) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RequestBody != nil { + size, err := m.RequestBody.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse_ResponseBody) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_ResponseBody) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ResponseBody != nil { + size, err := m.ResponseBody.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse_RequestTrailers) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_RequestTrailers) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RequestTrailers != nil { + size, err := m.RequestTrailers.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse_ResponseTrailers) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_ResponseTrailers) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ResponseTrailers != nil { + size, err := m.ResponseTrailers.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse_ImmediateResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_ImmediateResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ImmediateResponse != nil { + size, err := m.ImmediateResponse.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *HttpHeaders) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HttpHeaders) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HttpHeaders) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.EndOfStream { + i-- + if m.EndOfStream { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.Attributes) > 0 { + for k := range m.Attributes { + v := m.Attributes[k] + baseI := i + size, err := (*structpb.Struct)(v).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.Headers != nil { + if vtmsg, ok := interface{}(m.Headers).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Headers) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HttpBody) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HttpBody) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HttpBody) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.EndOfStream { + i-- + if m.EndOfStream { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Body) > 0 { + i -= len(m.Body) + copy(dAtA[i:], m.Body) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Body))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HttpTrailers) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HttpTrailers) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HttpTrailers) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Trailers != nil { + if vtmsg, ok := interface{}(m.Trailers).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Trailers) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HeadersResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HeadersResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HeadersResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Response != nil { + size, err := m.Response.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TrailersResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TrailersResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *TrailersResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.HeaderMutation != nil { + size, err := m.HeaderMutation.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BodyResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BodyResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *BodyResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Response != nil { + size, err := m.Response.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CommonResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CommonResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *CommonResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ClearRouteCache { + i-- + if m.ClearRouteCache { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.Trailers != nil { + if vtmsg, ok := interface{}(m.Trailers).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Trailers) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x22 + } + if m.BodyMutation != nil { + size, err := m.BodyMutation.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.HeaderMutation != nil { + size, err := m.HeaderMutation.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Status != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ImmediateResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ImmediateResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ImmediateResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Details) > 0 { + i -= len(m.Details) + copy(dAtA[i:], m.Details) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Details))) + i-- + dAtA[i] = 0x2a + } + if m.GrpcStatus != nil { + size, err := m.GrpcStatus.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if len(m.Body) > 0 { + i -= len(m.Body) + copy(dAtA[i:], m.Body) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Body))) + i-- + dAtA[i] = 0x1a + } + if m.Headers != nil { + size, err := m.Headers.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Status != nil { + if vtmsg, ok := interface{}(m.Status).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Status) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GrpcStatus) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GrpcStatus) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *GrpcStatus) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Status != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *HeaderMutation) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HeaderMutation) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HeaderMutation) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.RemoveHeaders) > 0 { + for iNdEx := len(m.RemoveHeaders) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RemoveHeaders[iNdEx]) + copy(dAtA[i:], m.RemoveHeaders[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RemoveHeaders[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.SetHeaders) > 0 { + for iNdEx := len(m.SetHeaders) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.SetHeaders[iNdEx]).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.SetHeaders[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *BodyMutation) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BodyMutation) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *BodyMutation) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if msg, ok := m.Mutation.(*BodyMutation_ClearBody); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Mutation.(*BodyMutation_Body); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *BodyMutation_Body) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *BodyMutation_Body) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Body) + copy(dAtA[i:], m.Body) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Body))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} +func (m *BodyMutation_ClearBody) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *BodyMutation_ClearBody) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + i-- + if m.ClearBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil +} +func (m *ProcessingRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Request.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + if m.MetadataContext != nil { + if size, ok := interface{}(m.MetadataContext).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.MetadataContext) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Attributes) > 0 { + for k, v := range m.Attributes { + _ = k + _ = v + l = 0 + if v != nil { + l = (*structpb.Struct)(v).SizeVT() + } + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + if m.ObservabilityMode { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *ProcessingRequest_RequestHeaders) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestHeaders != nil { + l = m.RequestHeaders.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingRequest_ResponseHeaders) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ResponseHeaders != nil { + l = m.ResponseHeaders.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingRequest_RequestBody) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestBody != nil { + l = m.RequestBody.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingRequest_ResponseBody) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ResponseBody != nil { + l = m.ResponseBody.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingRequest_RequestTrailers) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestTrailers != nil { + l = m.RequestTrailers.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingRequest_ResponseTrailers) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ResponseTrailers != nil { + l = m.ResponseTrailers.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Response.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + if m.DynamicMetadata != nil { + l = (*structpb.Struct)(m.DynamicMetadata).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ModeOverride != nil { + if size, ok := interface{}(m.ModeOverride).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.ModeOverride) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.OverrideMessageTimeout != nil { + l = (*durationpb.Duration)(m.OverrideMessageTimeout).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ProcessingResponse_RequestHeaders) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestHeaders != nil { + l = m.RequestHeaders.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse_ResponseHeaders) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ResponseHeaders != nil { + l = m.ResponseHeaders.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse_RequestBody) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestBody != nil { + l = m.RequestBody.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse_ResponseBody) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ResponseBody != nil { + l = m.ResponseBody.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse_RequestTrailers) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestTrailers != nil { + l = m.RequestTrailers.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse_ResponseTrailers) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ResponseTrailers != nil { + l = m.ResponseTrailers.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse_ImmediateResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ImmediateResponse != nil { + l = m.ImmediateResponse.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *HttpHeaders) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Headers != nil { + if size, ok := interface{}(m.Headers).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Headers) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Attributes) > 0 { + for k, v := range m.Attributes { + _ = k + _ = v + l = 0 + if v != nil { + l = (*structpb.Struct)(v).SizeVT() + } + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + if m.EndOfStream { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *HttpBody) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Body) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.EndOfStream { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *HttpTrailers) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Trailers != nil { + if size, ok := interface{}(m.Trailers).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Trailers) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *HeadersResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Response != nil { + l = m.Response.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *TrailersResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HeaderMutation != nil { + l = m.HeaderMutation.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *BodyResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Response != nil { + l = m.Response.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *CommonResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) + } + if m.HeaderMutation != nil { + l = m.HeaderMutation.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.BodyMutation != nil { + l = m.BodyMutation.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Trailers != nil { + if size, ok := interface{}(m.Trailers).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Trailers) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ClearRouteCache { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *ImmediateResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != nil { + if size, ok := interface{}(m.Status).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Status) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Headers != nil { + l = m.Headers.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Body) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.GrpcStatus != nil { + l = m.GrpcStatus.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Details) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *GrpcStatus) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) + } + n += len(m.unknownFields) + return n +} + +func (m *HeaderMutation) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SetHeaders) > 0 { + for _, e := range m.SetHeaders { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.RemoveHeaders) > 0 { + for _, s := range m.RemoveHeaders { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *BodyMutation) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Mutation.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *BodyMutation_Body) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Body) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *BodyMutation_ClearBody) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + return n +} From db9929d1e172d9607af35c07cd813d5bd75fff32 Mon Sep 17 00:00:00 2001 From: pweiber Date: Wed, 13 Nov 2024 13:47:37 -0300 Subject: [PATCH 06/10] Updating internal code for the ext_proc feature Signed-off-by: pweiber --- internal/internal.go | 275 ++++++++++++++++++++++---------- internal/types/types.go | 8 + opa/decisionlog/decision_log.go | 50 +++++- 3 files changed, 250 insertions(+), 83 deletions(-) create mode 100644 internal/types/types.go diff --git a/internal/internal.go b/internal/internal.go index 20a1119e3..435b8704a 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -7,6 +7,7 @@ package internal import ( "context" "fmt" + "io" "math" "net" "net/url" @@ -53,13 +54,14 @@ import ( "github.com/open-policy-agent/opa-envoy-plugin/envoyauth" "github.com/open-policy-agent/opa-envoy-plugin/envoyextproc" + "github.com/open-policy-agent/opa-envoy-plugin/internal/types" internal_util "github.com/open-policy-agent/opa-envoy-plugin/internal/util" "github.com/open-policy-agent/opa-envoy-plugin/opa/decisionlog" ) const ( - defaultAddr = ":9292" - defaultPath = "envoy.service.ext_proc.v3.ExternalProcessor/Process" + defaultAddr = ":9191" + defaultPath = "envoy/authz/allow" defaultDryRun = false defaultEnableReflection = false defaultSkipRequestBodyParse = false @@ -70,9 +72,9 @@ const ( defaultGRPCServerMaxReceiveMessageSize = 1024 * 1024 * 4 defaultGRPCServerMaxSendMessageSize = math.MaxInt32 - // PluginName is the name to register with the OPA plugin manager - //PluginName = "envoy_ext_authz_grpc" - PluginName = "envoy_ext_proc_grpc" + // AuthZPluginName and ExtProcPluginName Respective names to register with the OPA plugin manager + AuthZPluginName = "envoy_ext_authz_grpc" + ExtProcPluginName = "envoy_ext_proc_grpc" ) var defaultGRPCRequestDurationSecondsBuckets = []float64{ @@ -144,7 +146,7 @@ func Validate(m *plugins.Manager, bs []byte) (*Config, error) { } // New returns a Plugin that implements the Envoy ext_authz API. -func New(m *plugins.Manager, cfg *Config) plugins.Plugin { +func NewAuthZ(m *plugins.Manager, cfg *Config) plugins.Plugin { grpcOpts := []grpc.ServerOption{ grpc.MaxRecvMsgSize(cfg.GRPCMaxRecvMsgSize), grpc.MaxSendMsgSize(cfg.GRPCMaxSendMsgSize), @@ -200,7 +202,7 @@ func New(m *plugins.Manager, cfg *Config) plugins.Plugin { plugin.manager.PrometheusRegister().MustRegister(errorCounter) } - m.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) + m.UpdatePluginStatus(AuthZPluginName, &plugins.Status{State: plugins.StateNotReady}) return plugin } @@ -295,14 +297,14 @@ func (p *envoyExtAuthzGrpcServer) CreatePreparedQueryOnce(opts envoyauth.Prepare } func (p *envoyExtAuthzGrpcServer) Start(ctx context.Context) error { - p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) + p.manager.UpdatePluginStatus(AuthZPluginName, &plugins.Status{State: plugins.StateNotReady}) go p.listen() return nil } func (p *envoyExtAuthzGrpcServer) Stop(ctx context.Context) { p.server.Stop() - p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) + p.manager.UpdatePluginStatus(AuthZPluginName, &plugins.Status{State: plugins.StateNotReady}) } func (p *envoyExtAuthzGrpcServer) Reconfigure(ctx context.Context, config interface{}) { @@ -359,7 +361,7 @@ func (p *envoyExtAuthzGrpcServer) listen() { "enable-reflection": p.cfg.EnableReflection, }).Info("Starting gRPC server.") - p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateOK}) + p.manager.UpdatePluginStatus(AuthZPluginName, &plugins.Status{State: plugins.StateOK}) if err := p.server.Serve(l); err != nil { logger.WithFields(map[string]interface{}{"err": err}).Error("Listener failed.") @@ -367,7 +369,7 @@ func (p *envoyExtAuthzGrpcServer) listen() { } logger.Info("Listener exited.") - p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) + p.manager.UpdatePluginStatus(AuthZPluginName, &plugins.Status{State: plugins.StateNotReady}) } // Check is envoy.service.auth.v3.Authorization/Check @@ -736,12 +738,24 @@ type envoyExtProcGrpcServer struct { manager *plugins.Manager preparedQuery *rego.PreparedEvalQuery preparedQueryDoOnce *sync.Once + preparedQueryErr error interQueryBuiltinCache iCache.InterQueryCache distributedTracingOpts tracing.Options metricExtProcDuration prometheus.HistogramVec metricErrorCounter prometheus.CounterVec } +func (p *envoyExtProcGrpcServer) CreatePreparedQueryOnce(opts envoyextproc.PrepareQueryOpts) (*rego.PreparedEvalQuery, error) { + p.preparedQueryDoOnce.Do(func() { + pq, err := rego.New(opts.Opts...).PrepareForEval(context.Background()) + + p.preparedQuery = &pq + p.preparedQueryErr = err + }) + + return p.preparedQuery, p.preparedQueryErr +} + // NewExtProc creates a new instance of the ext_proc gRPC server. func NewExtProc(m *plugins.Manager, cfg *Config) plugins.Plugin { grpcOpts := []grpc.ServerOption{ @@ -799,14 +813,14 @@ func NewExtProc(m *plugins.Manager, cfg *Config) plugins.Plugin { plugin.manager.PrometheusRegister().MustRegister(errorCounter) } - m.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) + m.UpdatePluginStatus(ExtProcPluginName, &plugins.Status{State: plugins.StateNotReady}) return plugin } // Start starts the gRPC server for the ext_proc plugin. func (p *envoyExtProcGrpcServer) Start(ctx context.Context) error { - p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) + p.manager.UpdatePluginStatus(ExtProcPluginName, &plugins.Status{State: plugins.StateNotReady}) go p.listen() return nil } @@ -814,7 +828,7 @@ func (p *envoyExtProcGrpcServer) Start(ctx context.Context) error { // Stop stops the gRPC server for the ext_proc plugin. func (p *envoyExtProcGrpcServer) Stop(ctx context.Context) { p.server.Stop() - p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) + p.manager.UpdatePluginStatus(ExtProcPluginName, &plugins.Status{State: plugins.StateNotReady}) } // Reconfigure is not implemented for this plugin. @@ -864,7 +878,7 @@ func (p *envoyExtProcGrpcServer) listen() { "enable-reflection": p.cfg.EnableReflection, }).Info("Starting gRPC server.") - p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateOK}) + p.manager.UpdatePluginStatus(ExtProcPluginName, &plugins.Status{State: plugins.StateOK}) if err := p.server.Serve(l); err != nil { logger.WithFields(map[string]interface{}{"err": err}).Error("Listener failed.") @@ -872,107 +886,223 @@ func (p *envoyExtProcGrpcServer) listen() { } logger.Info("Listener exited.") - p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) + p.manager.UpdatePluginStatus(ExtProcPluginName, &plugins.Status{State: plugins.StateNotReady}) } -// Process handles the processing of incoming ext_proc requests. func (p *envoyExtProcGrpcServer) Process(stream ext_proc_v3.ExternalProcessor_ProcessServer) error { logger := p.manager.Logger() logger.Info("Processing incoming stream") + // Initialize the state object + state := &types.StreamState{} + for { + var err error + req, err := stream.Recv() if err != nil { + if err == io.EOF { + logger.Info("Stream closed by client") + return nil + } logger.Error(fmt.Sprintf("Failed to receive request: %v", err)) return err } - logger.Info(fmt.Sprintf("Received request: %v", req)) + logger.Info(fmt.Sprintf("Received request: %v \n\n", req)) start := time.Now() - logger.Info("LOG - Step 1") // Initialize evaluation result - result, _, err := envoyextproc.NewExtProcEvalResult() + result, stopFunc, err := envoyextproc.NewEvalResult() if err != nil { logger.WithFields(map[string]interface{}{"err": err}).Error("Unable to start new evaluation.") return err } - logger.Info("LOG - Step 2") // Start a new storage transaction txn, txnClose, err := result.GetTxn(stream.Context(), p.Store()) if err != nil { logger.WithFields(map[string]interface{}{"err": err}).Error("Unable to start new storage transaction.") return err } - defer txnClose(stream.Context(), err) result.Txn = txn - logger.Info("LOG - Step 3") - logger.Info(fmt.Sprintf("req: %v", req)) - // Convert request to input - input, err := RequestToInput(req, logger, p.cfg.protoSet, p.cfg.SkipRequestBodyParse) + input, err := envoyextproc.RequestToInput(req, logger, p.cfg.protoSet, p.cfg.SkipRequestBodyParse, state) if err != nil { + logger.Error(fmt.Sprintf("Failed to convert request to input: %v \n\n", err)) + txnClose(stream.Context(), err) + stopFunc() return err } - input = map[string]interface{}{ - "request_headers": map[string]interface{}{ - "headers": map[string]interface{}{ - "headers": []map[string]interface{}{ - { - "key": "some-key", - "raw_value": "some-value", - }, - }, - }, - }, - } - - logger.Info(fmt.Sprintf("input: %v", input)) - - logger.Info("LOG - Step 4") - if stream.Context().Err() != nil { err = errors.Wrap(stream.Context().Err(), "process request timed out before query execution") + txnClose(stream.Context(), err) + stopFunc() return err } - logger.Info("LOG - Step 5") - // Convert input to ast.Value inputValue, err := ast.InterfaceToValue(input) if err != nil { + txnClose(stream.Context(), err) + stopFunc() return err } - logger.Info("LOG - Step 6") - logger.Info(fmt.Sprintf("Input to be evaluated: %v", inputValue)) + logger.Info(fmt.Sprintf("Input to ast.Value: %v \n\n", inputValue)) - // Evaluate the policy - if err = envoyextproc.ExtProcEval(stream.Context(), p, inputValue, result); err != nil { + // Perform the evaluation + err = envoyextproc.Eval(stream.Context(), p, inputValue, result) + if err != nil { + logger.Error(fmt.Sprintf("Policy evaluation error: %v \n\n", err)) + txnClose(stream.Context(), err) + stopFunc() return err } - logger.Info("LOG - Step 7") + logger.Info(fmt.Sprintf("Policy decision: %v", result.Decision)) - response := &ext_proc_v3.ProcessingResponse{} + // Handle the decision + // Check for immediate response + immediateResponse, err := result.GetImmediateResponse() + if err != nil { + txnClose(stream.Context(), err) + stopFunc() + return err + } + if immediateResponse != nil { + response := &ext_proc_v3.ProcessingResponse{ + Response: &ext_proc_v3.ProcessingResponse_ImmediateResponse{ + ImmediateResponse: immediateResponse, + }, + } + // Send the immediate response + if sendErr := stream.Send(response); sendErr != nil { + txnClose(stream.Context(), sendErr) + stopFunc() + return sendErr + } + // Clean up and terminate the stream + txnClose(stream.Context(), nil) + stopFunc() + return nil + } - // Apply OPA evaluation results to the response - // Setting headers, status, etc., based on the decision + commonResponse, err := result.GetCommonResponse() + if err != nil { + txnClose(stream.Context(), err) + stopFunc() + return err + } - // Send the response to the client - if err := stream.Send(response); err != nil { - logger.Error(fmt.Sprintf("Failed to send response: %v", err)) + // Include dynamic metadata if any + dynamicMetadata, err := result.GetDynamicMetadata() + if err != nil { + txnClose(stream.Context(), err) + stopFunc() return err } + var processingResponse *ext_proc_v3.ProcessingResponse + + switch req.Request.(type) { + case *ext_proc_v3.ProcessingRequest_RequestHeaders: + headersResponse := &ext_proc_v3.HeadersResponse{ + Response: commonResponse, + } + processingResponse = &ext_proc_v3.ProcessingResponse{ + Response: &ext_proc_v3.ProcessingResponse_RequestHeaders{ + RequestHeaders: headersResponse, + }, + } + case *ext_proc_v3.ProcessingRequest_RequestBody: + bodyResponse := &ext_proc_v3.BodyResponse{ + Response: commonResponse, + } + processingResponse = &ext_proc_v3.ProcessingResponse{ + Response: &ext_proc_v3.ProcessingResponse_RequestBody{ + RequestBody: bodyResponse, + }, + } + case *ext_proc_v3.ProcessingRequest_RequestTrailers: + trailerMutation, err := result.GetTrailerMutation() + if err != nil { + txnClose(stream.Context(), err) + stopFunc() + return err + } + + trailersResponse := &ext_proc_v3.TrailersResponse{} + if trailerMutation != nil { + trailersResponse.HeaderMutation = trailerMutation + } + + processingResponse = &ext_proc_v3.ProcessingResponse{ + Response: &ext_proc_v3.ProcessingResponse_RequestTrailers{ + RequestTrailers: trailersResponse, + }, + } + case *ext_proc_v3.ProcessingRequest_ResponseHeaders: + headersResponse := &ext_proc_v3.HeadersResponse{ + Response: commonResponse, + } + processingResponse = &ext_proc_v3.ProcessingResponse{ + Response: &ext_proc_v3.ProcessingResponse_ResponseHeaders{ + ResponseHeaders: headersResponse, + }, + } + case *ext_proc_v3.ProcessingRequest_ResponseBody: + bodyResponse := &ext_proc_v3.BodyResponse{ + Response: commonResponse, + } + processingResponse = &ext_proc_v3.ProcessingResponse{ + Response: &ext_proc_v3.ProcessingResponse_ResponseBody{ + ResponseBody: bodyResponse, + }, + } + case *ext_proc_v3.ProcessingRequest_ResponseTrailers: + trailerMutation, err := result.GetTrailerMutation() + if err != nil { + txnClose(stream.Context(), err) + stopFunc() + return err + } + + trailersResponse := &ext_proc_v3.TrailersResponse{} + if trailerMutation != nil { + trailersResponse.HeaderMutation = trailerMutation + } + + processingResponse = &ext_proc_v3.ProcessingResponse{ + Response: &ext_proc_v3.ProcessingResponse_ResponseTrailers{ + ResponseTrailers: trailersResponse, + }, + } + default: + logger.Error("Unsupported request type") + txnClose(stream.Context(), fmt.Errorf("unsupported request type")) + stopFunc() + return fmt.Errorf("unsupported request type") + } + + if dynamicMetadata != nil { + processingResponse.DynamicMetadata = dynamicMetadata + } + + // Send the response back to Envoy + if sendErr := stream.Send(processingResponse); sendErr != nil { + txnClose(stream.Context(), sendErr) + stopFunc() + return sendErr + } + // Log the total decision time totalDecisionTime := time.Since(start) if p.cfg.EnablePerformanceMetrics { - p.metricExtProcDuration.With(prometheus.Labels{"handler": "process"}).Observe(float64(totalDecisionTime.Seconds())) + p.metricExtProcDuration.With(prometheus.Labels{"handler": "process"}).Observe(totalDecisionTime.Seconds()) } p.manager.Logger().WithFields(map[string]interface{}{ @@ -983,13 +1113,11 @@ func (p *envoyExtProcGrpcServer) Process(stream ext_proc_v3.ExternalProcessor_Pr "metrics": result.Metrics.All(), "total_decision_time": totalDecisionTime, }).Debug("Returning policy decision.") - } -} -// RequestToInput converts an incoming ext_proc request to an input map for policy evaluation. -func RequestToInput(req *ext_proc_v3.ProcessingRequest, logger logging.Logger, protoSet *protoregistry.Files, skipRequestBodyParse bool) (map[string]interface{}, error) { - // This is a placeholder implementation for now. - return map[string]interface{}{}, nil + // Clean up the transaction and evaluation result before the next iteration + txnClose(stream.Context(), nil) + stopFunc() + } } // compilerUpdated resets the prepared query when the compiler is updated. @@ -1022,26 +1150,11 @@ func (p *envoyExtProcGrpcServer) Runtime() *ast.Term { return p.manager.Info } -// PreparedQueryDoOnce returns the sync.Once for the prepared query. -func (p *envoyExtProcGrpcServer) PreparedQueryDoOnce() *sync.Once { - return p.preparedQueryDoOnce -} - // InterQueryBuiltinCache returns the inter-query cache. func (p *envoyExtProcGrpcServer) InterQueryBuiltinCache() iCache.InterQueryCache { return p.interQueryBuiltinCache } -// PreparedQuery returns the prepared evaluation query. -func (p *envoyExtProcGrpcServer) PreparedQuery() *rego.PreparedEvalQuery { - return p.preparedQuery -} - -// SetPreparedQuery sets the prepared evaluation query. -func (p *envoyExtProcGrpcServer) SetPreparedQuery(pq *rego.PreparedEvalQuery) { - p.preparedQuery = pq -} - // Logger returns the logger associated with the OPA instance. func (p *envoyExtProcGrpcServer) Logger() logging.Logger { return p.manager.Logger() @@ -1053,7 +1166,7 @@ func (p *envoyExtProcGrpcServer) DistributedTracing() tracing.Options { } // Log logs the decision to the decision log. -func (p *envoyExtProcGrpcServer) log(ctx context.Context, input interface{}, result *envoyextproc.ExtProcEvalResult, err error) error { +func (p *envoyExtProcGrpcServer) log(ctx context.Context, input interface{}, result *envoyextproc.EvalResult, err error) error { info := &server.Info{ Timestamp: time.Now(), Input: &input, @@ -1081,7 +1194,5 @@ func (p *envoyExtProcGrpcServer) log(ctx context.Context, input interface{}, res info.NDBuiltinCache = &x } - // Use the adapter to convert ExtProcEvalResult to EvalResult - adaptedResult := result.ToEnvoyAuthEvalResult() - return decisionlog.LogDecision(ctx, p.manager, info, adaptedResult, err) + return decisionlog.LogDecisionExtProc(ctx, p.manager, info, result, err) } diff --git a/internal/types/types.go b/internal/types/types.go new file mode 100644 index 000000000..51eb4a480 --- /dev/null +++ b/internal/types/types.go @@ -0,0 +1,8 @@ +package types + +// StreamState holds the state across the processing stream. +type StreamState struct { + Headers map[string]string + Path string + Method string +} diff --git a/opa/decisionlog/decision_log.go b/opa/decisionlog/decision_log.go index 9c459fbba..736a05f42 100644 --- a/opa/decisionlog/decision_log.go +++ b/opa/decisionlog/decision_log.go @@ -3,13 +3,15 @@ package decisionlog import ( "context" - "github.com/open-policy-agent/opa-envoy-plugin/envoyauth" "github.com/open-policy-agent/opa/ast" "github.com/open-policy-agent/opa/plugins" "github.com/open-policy-agent/opa/plugins/logs" "github.com/open-policy-agent/opa/server" "github.com/open-policy-agent/opa/storage" "github.com/open-policy-agent/opa/topdown" + + "github.com/open-policy-agent/opa-envoy-plugin/envoyauth" + "github.com/open-policy-agent/opa-envoy-plugin/envoyextproc" ) type internalError struct { @@ -65,3 +67,49 @@ func LogDecision(ctx context.Context, manager *plugins.Manager, info *server.Inf return plugin.Log(ctx, info) } + +// LogDecision - Logs a decision log event +func LogDecisionExtProc(ctx context.Context, manager *plugins.Manager, info *server.Info, result *envoyextproc.EvalResult, err error) error { + plugin := logs.Lookup(manager) + if plugin == nil { + return nil + } + + info.Revision = result.Revision + + bundles := map[string]server.BundleInfo{} + for name, rev := range result.Revisions { + bundles[name] = server.BundleInfo{Revision: rev} + } + info.Bundles = bundles + + info.DecisionID = result.DecisionID + info.Metrics = result.Metrics + info.Txn = result.Txn + + if err != nil { + switch err.(type) { + case *storage.Error, *ast.Error, ast.Errors: + break + case *topdown.Error: + if topdown.IsCancel(err) { + err = &topdown.Error{ + Code: topdown.CancelErr, + Message: "context deadline reached during query execution", + } + } + default: + // Wrap errors that may not serialize to JSON well (e.g., fmt.Errorf, etc.) + err = &internalError{Message: err.Error()} + } + info.Error = err + } else { + var x interface{} + if result != nil { + x = result.Decision + } + info.Results = &x + } + + return plugin.Log(ctx, info) +} From 80c8208d6e66e62598ec44f67fc887e9ab982c1d Mon Sep 17 00:00:00 2001 From: pweiber Date: Wed, 13 Nov 2024 13:49:22 -0300 Subject: [PATCH 07/10] Updating plugin structure to allow multiple plugins Signed-off-by: pweiber --- cmd/opa-envoy-plugin/main.go | 5 +++-- plugin/plugin.go | 34 +++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/cmd/opa-envoy-plugin/main.go b/cmd/opa-envoy-plugin/main.go index 540e58b7a..2ba0dce9b 100644 --- a/cmd/opa-envoy-plugin/main.go +++ b/cmd/opa-envoy-plugin/main.go @@ -14,8 +14,9 @@ import ( ) func main() { - //runtime.RegisterPlugin("envoy.ext_authz.grpc", plugin.Factory{}) // for backwards compatibility - runtime.RegisterPlugin(plugin.PluginName, plugin.Factory{}) + runtime.RegisterPlugin("envoy.ext_authz.grpc", plugin.AuthZFactory{}) // for backwards compatibility + runtime.RegisterPlugin(plugin.AuthZPluginName, plugin.AuthZFactory{}) + runtime.RegisterPlugin(plugin.ExtProcPluginName, plugin.ExtProcFactory{}) if err := cmd.RootCommand.Execute(); err != nil { os.Exit(1) diff --git a/plugin/plugin.go b/plugin/plugin.go index 1f63a0a67..0edf563c0 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -10,18 +10,34 @@ import ( "github.com/open-policy-agent/opa-envoy-plugin/internal" ) -// Factory defines the interface OPA uses to instantiate a plugin. -type Factory struct{} +// AuthZFactory defines the factory for the AuthZ plugin. +type AuthZFactory struct{} -// PluginName is the name to register with the OPA plugin manager -const PluginName = internal.PluginName +// ExtProcFactory defines the factory for the ExtProc plugin. +type ExtProcFactory struct{} -// New returns the object initialized with a valid plugin configuration. -func (Factory) New(m *plugins.Manager, config interface{}) plugins.Plugin { +// Plugin names to register with the OPA plugin manager. +const ( + AuthZPluginName = "envoy_ext_authz_grpc" + ExtProcPluginName = "envoy_ext_proc_grpc" +) + +// New method for AuthZFactory. +func (AuthZFactory) New(m *plugins.Manager, config interface{}) plugins.Plugin { + return internal.NewAuthZ(m, config.(*internal.Config)) +} + +// Validate method for AuthZFactory. +func (AuthZFactory) Validate(m *plugins.Manager, configBytes []byte) (interface{}, error) { + return internal.Validate(m, configBytes) +} + +// New method for ExtProcFactory. +func (ExtProcFactory) New(m *plugins.Manager, config interface{}) plugins.Plugin { return internal.NewExtProc(m, config.(*internal.Config)) } -// Validate returns a valid configuration to instantiate the plugin. -func (Factory) Validate(m *plugins.Manager, config []byte) (interface{}, error) { - return internal.Validate(m, config) +// Validate method for ExtProcFactory. +func (ExtProcFactory) Validate(m *plugins.Manager, configBytes []byte) (interface{}, error) { + return internal.Validate(m, configBytes) } From 2ce574da64bfc41cd7e1aad157c19d43603abbcc Mon Sep 17 00:00:00 2001 From: pweiber Date: Wed, 13 Nov 2024 13:50:37 -0300 Subject: [PATCH 08/10] Updating internal test for the new structure and adding the initial evaluation test for ext_proc Signed-off-by: pweiber --- envoyextproc/evaluation_test.go | 444 ++++++++++++++++++++++++++++++++ internal/internal_test.go | 34 +-- 2 files changed, 462 insertions(+), 16 deletions(-) create mode 100644 envoyextproc/evaluation_test.go diff --git a/envoyextproc/evaluation_test.go b/envoyextproc/evaluation_test.go new file mode 100644 index 000000000..c90fbedc2 --- /dev/null +++ b/envoyextproc/evaluation_test.go @@ -0,0 +1,444 @@ +package envoyextproc + +import ( + "context" + "encoding/json" + "reflect" + "strings" + "sync" + "testing" + + "github.com/open-policy-agent/opa/ast" + "github.com/open-policy-agent/opa/config" + "github.com/open-policy-agent/opa/logging" + loggingtest "github.com/open-policy-agent/opa/logging/test" + "github.com/open-policy-agent/opa/plugins" + "github.com/open-policy-agent/opa/rego" + "github.com/open-policy-agent/opa/storage" + "github.com/open-policy-agent/opa/storage/inmem" + iCache "github.com/open-policy-agent/opa/topdown/cache" + "github.com/open-policy-agent/opa/tracing" +) + +type evalTestCase struct { + name string + input map[string]interface{} + expected map[string]interface{} + expectError bool +} + +var testCases = []evalTestCase{ + { + name: "Immediate Response - Forbidden", + input: map[string]interface{}{ + "path": "/forbidden", + }, + expected: map[string]interface{}{ + "immediate_response": map[string]interface{}{ + "status": json.Number("403"), + "body": "Access Denied", + "headers": []interface{}{ + map[string]interface{}{"key": "Content-Type", "value": "text/plain"}, + map[string]interface{}{"key": "X-Immediate-Response", "value": "True"}, + }, + "grpc_status": json.Number("7"), + "details": "Unauthorized access attempt", + }, + }, + }, + { + name: "Add Headers", + input: map[string]interface{}{ + "path": "/add-headers", + }, + expected: map[string]interface{}{ + "headers_to_add": []interface{}{ + map[string]interface{}{ + "key": "X-Added-Header", + "value": "HeaderValue", + "header_append_action": "OVERWRITE_IF_EXISTS_OR_ADD", + }, + }, + }, + }, + { + name: "Remove Headers", + input: map[string]interface{}{ + "path": "/remove-headers", + }, + expected: map[string]interface{}{ + "headers_to_remove": []interface{}{ + "X-Remove-Header", + "X-Another-Header", + }, + }, + }, + { + name: "Replace Body", + input: map[string]interface{}{ + "path": "/replace-body", + "request_type": "request_body", + }, + expected: map[string]interface{}{ + "body": "This is the new body content", + }, + }, + { + name: "Dynamic Metadata", + input: map[string]interface{}{ + "path": "/dynamic-metadata", + "headers": map[string]interface{}{ + "x-user-id": "12345", + "x-session-id": "abcde-12345", + }, + }, + expected: map[string]interface{}{ + "dynamic_metadata": map[string]interface{}{ + "my_extension": map[string]interface{}{ + "user_id": "12345", + "session_id": "abcde-12345", + }, + }, + }, + }, + { + name: "Combined Headers and Body", + input: map[string]interface{}{ + "path": "/combined", + }, + expected: map[string]interface{}{ + "headers_to_add": []interface{}{ + map[string]interface{}{ + "key": "X-Combined-Header", + "value": "CombinedValue", + }, + }, + "body": "Combined response with headers and body changes", + }, + }, + { + name: "Modify Trailers", + input: map[string]interface{}{ + "path": "/modify-trailers", + "request_type": "request_trailers", + }, + expected: map[string]interface{}{ + "trailers_to_add": []interface{}{ + map[string]interface{}{ + "key": "X-Trailer-Added", + "value": "TrailerValue", + }, + }, + }, + }, + { + name: "Modify Response Headers", + input: map[string]interface{}{ + "path": "/modify-response-headers", + "request_type": "response_headers", + }, + expected: map[string]interface{}{ + "headers_to_add": []interface{}{ + map[string]interface{}{ + "key": "X-Response-Header", + "value": "ResponseHeaderValue", + }, + }, + }, + }, + { + name: "Default Deny", + input: map[string]interface{}{ + "path": "/unknown-path", + }, + expected: map[string]interface{}{ + "immediate_response": map[string]interface{}{ + "status": json.Number("403"), + "body": "Default Deny", + "headers": []interface{}{ + map[string]interface{}{"key": "Content-Type", "value": "text/plain"}, + map[string]interface{}{"key": "X-Default-Deny", "value": "True"}, + }, + }, + }, + }, +} + +func TestEval(t *testing.T) { + ctx := context.Background() + + logger := loggingtest.New() + server, err := testExtProcServer(logger) + if err != nil { + t.Fatal(err) + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + inputValue := ast.MustInterfaceToValue(tc.input) + + res, stop, err := NewEvalResult() + if err != nil { + t.Fatal(err) + } + defer stop() + + err = Eval(ctx, server, inputValue, res) + if tc.expectError { + if err == nil { + t.Errorf("Expected error but got none") + } + return + } + if err != nil { + t.Fatalf("Eval failed: %v", err) + } + + // Compare the decision with the expected result + decisionMap, ok := res.Decision.(map[string]interface{}) + if !ok { + t.Fatalf("Decision is not a map") + } + + if !reflect.DeepEqual(decisionMap, tc.expected) { + t.Errorf("Test case '%s' failed. Expected decision %v but got %v", tc.name, tc.expected, decisionMap) + } + }) + } +} + +func testExtProcServer(logger logging.Logger) (*mockExtProcServer, error) { + module := ` + package ext_proc + + # Default response is an empty object + default response = {} + + # Immediate response with custom status code, body, and headers + response = { + "immediate_response": { + "status": 403, + "body": "Access Denied", + "headers": [ + {"key": "Content-Type", "value": "text/plain"}, + {"key": "X-Immediate-Response", "value": "True"} + ], + "grpc_status": 7, # PERMISSION_DENIED + "details": "Unauthorized access attempt" + } + } { + input.path == "/forbidden" + } + + # Add headers to the request or response + response = { + "headers_to_add": [ + { + "key": "X-Added-Header", + "value": "HeaderValue", + "header_append_action": "OVERWRITE_IF_EXISTS_OR_ADD" + } + ] + } { + input.path == "/add-headers" + } + + # Remove headers from the request or response + response = { + "headers_to_remove": [ + "X-Remove-Header", + "X-Another-Header" + ] + } { + input.path == "/remove-headers" + } + + # Replace the body of the request or response + response = { + "body": "This is the new body content" + } { + input.request_type == "request_body" + input.path == "/replace-body" + } + + # Provide dynamic metadata + response = { + "dynamic_metadata": { + "my_extension": { + "user_id": input.headers["x-user-id"], + "session_id": input.headers["x-session-id"] + } + } + } { + input.path == "/dynamic-metadata" + } + + # Combine header mutation and body replacement + response = { + "headers_to_add": [ + { + "key": "X-Combined-Header", + "value": "CombinedValue" + } + ], + "body": "Combined response with headers and body changes" + } { + input.path == "/combined" + } + + # Handle request trailers + response = { + "trailers_to_add": [ + { + "key": "X-Trailer-Added", + "value": "TrailerValue" + } + ] + } { + input.request_type == "request_trailers" + input.path == "/modify-trailers" + } + + # Handle response headers + response = { + "headers_to_add": [ + { + "key": "X-Response-Header", + "value": "ResponseHeaderValue" + } + ] + } { + input.request_type == "response_headers" + input.path == "/modify-response-headers" + } + + # Deny all other requests by default with an immediate response + response = { + "immediate_response": { + "status": 403, + "body": "Default Deny", + "headers": [ + {"key": "Content-Type", "value": "text/plain"}, + {"key": "X-Default-Deny", "value": "True"} + ] + } + } { + not allowed_paths[input.path] + } + + allowed_paths = { + "/forbidden", + "/add-headers", + "/remove-headers", + "/replace-body", + "/dynamic-metadata", + "/combined", + "/modify-trailers", + "/modify-response-headers" + } + ` + + ctx := context.Background() + store := inmem.New() + txn := storage.NewTransactionOrDie(ctx, store, storage.WriteParams) + + err := store.UpsertPolicy(ctx, txn, "example.rego", []byte(module)) + if err != nil { + return nil, err + } + + err = store.Commit(ctx, txn) + if err != nil { + return nil, err + } + + m, err := plugins.New([]byte{}, "test", store, + plugins.EnablePrintStatements(true), + plugins.Logger(logger), + ) + if err != nil { + return nil, err + } + + // Start the plugins manager + if err := m.Start(ctx); err != nil { + return nil, err + } + + path := "ext_proc/response" + query := "data." + strings.ReplaceAll(path, "/", ".") + parsedQuery, err := ast.ParseBody(query) + if err != nil { + return nil, err + } + + cfg := Config{ + Addr: ":0", + Path: path, + parsedQuery: parsedQuery, + } + + return &mockExtProcServer{ + cfg: cfg, + manager: m, + preparedQueryDoOnce: new(sync.Once), + }, nil +} + +type Config struct { + Addr string `json:"addr"` + Path string `json:"path"` + parsedQuery ast.Body +} + +type mockExtProcServer struct { + cfg Config + manager *plugins.Manager + preparedQuery *rego.PreparedEvalQuery + preparedQueryDoOnce *sync.Once + preparedQueryErr error + distributedTracingOpts tracing.Options +} + +func (m *mockExtProcServer) ParsedQuery() ast.Body { + return m.cfg.parsedQuery +} + +func (m *mockExtProcServer) Store() storage.Store { + return m.manager.Store +} + +func (m *mockExtProcServer) Compiler() *ast.Compiler { + return m.manager.GetCompiler() +} + +func (m *mockExtProcServer) Runtime() *ast.Term { + return m.manager.Info +} + +func (m *mockExtProcServer) Config() *config.Config { + return m.manager.Config +} + +func (*mockExtProcServer) InterQueryBuiltinCache() iCache.InterQueryCache { + return nil +} + +func (m *mockExtProcServer) Logger() logging.Logger { + return m.manager.Logger() +} + +func (m *mockExtProcServer) DistributedTracing() tracing.Options { + return m.distributedTracingOpts +} + +func (m *mockExtProcServer) CreatePreparedQueryOnce(opts PrepareQueryOpts) (*rego.PreparedEvalQuery, error) { + m.preparedQueryDoOnce.Do(func() { + pq, err := rego.New(opts.Opts...).PrepareForEval(context.Background()) + + m.preparedQuery = &pq + m.preparedQueryErr = err + }) + + return m.preparedQuery, m.preparedQueryErr +} diff --git a/internal/internal_test.go b/internal/internal_test.go index f4edb1f28..28d76f43d 100644 --- a/internal/internal_test.go +++ b/internal/internal_test.go @@ -8,8 +8,6 @@ import ( "context" "errors" "fmt" - ext_type_v2 "github.com/envoyproxy/go-control-plane/envoy/type" - ext_type_v3 "github.com/envoyproxy/go-control-plane/envoy/type/v3" "net/http" "net/http/httptest" "reflect" @@ -18,6 +16,9 @@ import ( "testing" "time" + ext_type_v2 "github.com/envoyproxy/go-control-plane/envoy/type" + ext_type_v3 "github.com/envoyproxy/go-control-plane/envoy/type/v3" + ext_core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" ext_authz_v2 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v2" ext_authz "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3" @@ -26,7 +27,6 @@ import ( "google.golang.org/genproto/googleapis/rpc/code" "google.golang.org/protobuf/proto" - "github.com/open-policy-agent/opa-envoy-plugin/envoyauth" "github.com/open-policy-agent/opa/ast" "github.com/open-policy-agent/opa/plugins" "github.com/open-policy-agent/opa/plugins/logs" @@ -34,6 +34,8 @@ import ( "github.com/open-policy-agent/opa/storage/inmem" "github.com/open-policy-agent/opa/topdown" "github.com/open-policy-agent/opa/util" + + "github.com/open-policy-agent/opa-envoy-plugin/envoyauth" ) const exampleAllowedRequest = `{ @@ -1848,12 +1850,12 @@ func TestPluginStatusLifeCycle(t *testing.T) { t.Fatalf("Unexpected error: %s", err) } - p := New(m, &Config{ + p := NewAuthZ(m, &Config{ Addr: ":0", }) - m.Register(PluginName, p) + m.Register(AuthZPluginName, p) - assertPluginState(t, m, plugins.StateNotReady) + assertAuthZPluginState(t, m, plugins.StateNotReady) ctx := context.Background() err = m.Start(ctx) @@ -1863,14 +1865,14 @@ func TestPluginStatusLifeCycle(t *testing.T) { // Wait a short time for the plugin to reach OK state // If it hits this timeout something bad has almost definitely happened - waitForPluginState(t, m, plugins.StateOK, 5*time.Second) + waitForAuthZPluginState(t, m, plugins.StateOK, 5*time.Second) m.Stop(ctx) - assertPluginState(t, m, plugins.StateNotReady) + assertAuthZPluginState(t, m, plugins.StateNotReady) } -func waitForPluginState(t *testing.T, m *plugins.Manager, desired plugins.State, timeout time.Duration) { +func waitForAuthZPluginState(t *testing.T, m *plugins.Manager, desired plugins.State, timeout time.Duration) { after := time.After(timeout) tick := time.Tick(10 * time.Microsecond) for { @@ -1878,7 +1880,7 @@ func waitForPluginState(t *testing.T, m *plugins.Manager, desired plugins.State, case <-after: t.Fatal("Plugin failed to reach OK state in time") case <-tick: - state, err := getPluginState(t, m) + state, err := getAuthZPluginState(t, m) if err == nil && state == desired { return } @@ -1886,11 +1888,11 @@ func waitForPluginState(t *testing.T, m *plugins.Manager, desired plugins.State, } } -func getPluginState(t *testing.T, m *plugins.Manager) (plugins.State, error) { +func getAuthZPluginState(t *testing.T, m *plugins.Manager) (plugins.State, error) { t.Helper() - status, ok := m.PluginStatus()[PluginName] + status, ok := m.PluginStatus()[AuthZPluginName] if !ok { - return plugins.StateNotReady, fmt.Errorf("expected plugin %s to be in manager plugin status map", PluginName) + return plugins.StateNotReady, fmt.Errorf("expected plugin %s to be in manager plugin status map", AuthZPluginName) } if status == nil { return plugins.StateNotReady, errors.New("expected a non-nil status value") @@ -1898,9 +1900,9 @@ func getPluginState(t *testing.T, m *plugins.Manager) (plugins.State, error) { return status.State, nil } -func assertPluginState(t *testing.T, m *plugins.Manager, expected plugins.State) { +func assertAuthZPluginState(t *testing.T, m *plugins.Manager, expected plugins.State) { t.Helper() - state, err := getPluginState(t, m) + state, err := getAuthZPluginState(t, m) if err != nil { t.Fatal(err) } @@ -2006,7 +2008,7 @@ func testAuthzServerWithModule(module string, path string, customConfig *Config, } } - s := New(m, &cfg) + s := NewAuthZ(m, &cfg) return s.(*envoyExtAuthzGrpcServer) } From ed84777e95daa1b7187ee908f21494e0c2227919 Mon Sep 17 00:00:00 2001 From: pweiber Date: Wed, 13 Nov 2024 13:51:22 -0300 Subject: [PATCH 09/10] Adding the example run and configs for the ext_proc scenario Signed-off-by: pweiber --- examples/extproc/client.go | 349 +++++++++++++++++++++++++++++++++++ examples/extproc/config.yaml | 19 ++ examples/extproc/policy.rego | 127 +++++++++++++ 3 files changed, 495 insertions(+) create mode 100644 examples/extproc/client.go create mode 100644 examples/extproc/config.yaml create mode 100644 examples/extproc/policy.rego diff --git a/examples/extproc/client.go b/examples/extproc/client.go new file mode 100644 index 000000000..c33e1961d --- /dev/null +++ b/examples/extproc/client.go @@ -0,0 +1,349 @@ +package main + +import ( + "context" + "flag" + "io" + "log" + "time" + + base "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + ext_proc_v3 "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" + "google.golang.org/grpc" +) + +func main() { + addr := flag.String("addr", "0.0.0.0:9292", "Address of the ext_proc server") + testCase := flag.String("test_case", "add_headers", "Test case to run") + flag.Parse() + + conn, err := grpc.Dial(*addr, grpc.WithInsecure()) + if err != nil { + log.Fatalf("Failed to connect: %v", err) + } + defer conn.Close() + + // Set a context with timeout for the stream + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + client := ext_proc_v3.NewExternalProcessorClient(conn) + stream, err := client.Process(ctx) + if err != nil { + log.Fatalf("Failed to create stream: %v", err) + } + + // Construct the ProcessingRequest message based on the test case + var request *ext_proc_v3.ProcessingRequest + + switch *testCase { + case "forbidden": + // Test Immediate Response + request = &ext_proc_v3.ProcessingRequest{ + Request: &ext_proc_v3.ProcessingRequest_RequestHeaders{ + RequestHeaders: &ext_proc_v3.HttpHeaders{ + Headers: &base.HeaderMap{ + Headers: []*base.HeaderValue{ + {Key: ":method", Value: "GET"}, + {Key: ":path", Value: "/forbidden"}, + }, + }, + }, + }, + } + case "add_headers": + // Test Header Mutation - Add Headers + request = &ext_proc_v3.ProcessingRequest{ + Request: &ext_proc_v3.ProcessingRequest_RequestHeaders{ + RequestHeaders: &ext_proc_v3.HttpHeaders{ + Headers: &base.HeaderMap{ + Headers: []*base.HeaderValue{ + {Key: ":method", Value: "GET"}, + {Key: ":path", Value: "/add-headers"}, + }, + }, + }, + }, + } + case "remove_headers": + // Test Header Mutation - Remove Headers + request = &ext_proc_v3.ProcessingRequest{ + Request: &ext_proc_v3.ProcessingRequest_RequestHeaders{ + RequestHeaders: &ext_proc_v3.HttpHeaders{ + Headers: &base.HeaderMap{ + Headers: []*base.HeaderValue{ + {Key: ":method", Value: "GET"}, + {Key: ":path", Value: "/remove-headers"}, + {Key: "X-Remove-Header", Value: "ValueToRemove"}, + {Key: "X-Another-Header", Value: "AnotherValue"}, + }, + }, + }, + }, + } + case "replace_body": + requestHeaders := &ext_proc_v3.ProcessingRequest{ + Request: &ext_proc_v3.ProcessingRequest_RequestHeaders{ + RequestHeaders: &ext_proc_v3.HttpHeaders{ + Headers: &base.HeaderMap{ + Headers: []*base.HeaderValue{ + {Key: ":method", Value: "POST"}, + {Key: ":path", Value: "/replace-body"}, + {Key: "content-type", Value: "application/json"}, // Added Content-Type + }, + }, + }, + }, + } + if err := stream.Send(requestHeaders); err != nil { + log.Fatalf("Failed to send request headers: %v", err) + } + log.Println("Sent RequestHeaders") + receiveResponse(stream) + + // Now send RequestBody + jsonBody := `{"key": "value"}` + log.Printf("Sending RequestBody: %s", jsonBody) // Log the body being sent + request = &ext_proc_v3.ProcessingRequest{ + Request: &ext_proc_v3.ProcessingRequest_RequestBody{ + RequestBody: &ext_proc_v3.HttpBody{ + Body: []byte(jsonBody), // JSON body + EndOfStream: true, + }, + }, + } + if err := stream.Send(request); err != nil { + log.Fatalf("Failed to send request body: %v", err) + } + log.Println("Sent RequestBody") + receiveResponse(stream) + case "dynamic_metadata": + // Test Dynamic Metadata + request = &ext_proc_v3.ProcessingRequest{ + Request: &ext_proc_v3.ProcessingRequest_RequestHeaders{ + RequestHeaders: &ext_proc_v3.HttpHeaders{ + Headers: &base.HeaderMap{ + Headers: []*base.HeaderValue{ + {Key: ":method", Value: "GET"}, + {Key: ":path", Value: "/dynamic-metadata"}, + {Key: "x-user-id", Value: "12345"}, + {Key: "x-session-id", Value: "abcde-12345"}, + }, + }, + }, + }, + } + case "combined": + // Test Combined Header and Body Mutation + request = &ext_proc_v3.ProcessingRequest{ + Request: &ext_proc_v3.ProcessingRequest_RequestHeaders{ + RequestHeaders: &ext_proc_v3.HttpHeaders{ + Headers: &base.HeaderMap{ + Headers: []*base.HeaderValue{ + {Key: ":method", Value: "POST"}, + {Key: ":path", Value: "/combined"}, + }, + }, + }, + }, + } + case "modify_trailers": + // Test Request Trailers + // Send RequestHeaders first + requestHeaders := &ext_proc_v3.ProcessingRequest{ + Request: &ext_proc_v3.ProcessingRequest_RequestHeaders{ + RequestHeaders: &ext_proc_v3.HttpHeaders{ + Headers: &base.HeaderMap{ + Headers: []*base.HeaderValue{ + {Key: ":method", Value: "GET"}, + {Key: ":path", Value: "/modify-trailers"}, + }, + }, + }, + }, + } + if err := stream.Send(requestHeaders); err != nil { + log.Fatalf("Failed to send request headers: %v", err) + } + receiveResponse(stream) + + // Now send RequestTrailers + request = &ext_proc_v3.ProcessingRequest{ + Request: &ext_proc_v3.ProcessingRequest_RequestTrailers{ + RequestTrailers: &ext_proc_v3.HttpTrailers{ + Trailers: &base.HeaderMap{ + Headers: []*base.HeaderValue{ + {Key: "original-trailer", Value: "original-value"}, + }, + }, + }, + }, + } + case "modify_response_headers": + // Test Response Headers + request = &ext_proc_v3.ProcessingRequest{ + Request: &ext_proc_v3.ProcessingRequest_ResponseHeaders{ + ResponseHeaders: &ext_proc_v3.HttpHeaders{ + Headers: &base.HeaderMap{ + Headers: []*base.HeaderValue{ + {Key: ":status", Value: "200"}, + {Key: "Content-Type", Value: "text/plain"}, + {Key: ":path", Value: "/modify-response-headers"}, + }, + }, + }, + }, + } + default: + log.Fatalf("Unknown test case: %s", *testCase) + } + + // Send the ProcessingRequest message + if err := stream.Send(request); err != nil { + log.Fatalf("Failed to send request: %v", err) + } + + receiveResponse(stream) + + // Close the stream + if err := stream.CloseSend(); err != nil { + log.Fatalf("Failed to close stream: %v", err) + } +} + +func receiveResponse(stream ext_proc_v3.ExternalProcessor_ProcessClient) { + // Set a timeout context for receiving the response + recvCtx, recvCancel := context.WithTimeout(context.Background(), 5*time.Second) + defer recvCancel() + + responseCh := make(chan *ext_proc_v3.ProcessingResponse) + errCh := make(chan error) + + go func() { + response, err := stream.Recv() + if err != nil { + errCh <- err + } else { + responseCh <- response + } + }() + + select { + case <-recvCtx.Done(): + log.Printf("No response received within timeout (possible observability mode)") + case err := <-errCh: + if err == io.EOF { + log.Printf("Stream closed by server") + } else if err == context.DeadlineExceeded { + log.Printf("No response received (possible observability mode)") + } else { + log.Fatalf("Failed to receive response: %v", err) + } + case response := <-responseCh: + processResponse(response) + } +} + +func processResponse(response *ext_proc_v3.ProcessingResponse) { + if response == nil { + log.Println("Received empty response") + return + } + + switch res := response.Response.(type) { + case *ext_proc_v3.ProcessingResponse_RequestHeaders: + log.Printf("Received RequestHeaders response") + if res.RequestHeaders != nil && res.RequestHeaders.Response != nil { + mutations := res.RequestHeaders.Response.HeaderMutation + if mutations != nil { + for _, setHeader := range mutations.SetHeaders { + header := setHeader.GetHeader() + log.Printf("Header to add: %s: %s", header.GetKey(), header.GetValue()) + } + for _, removeHeader := range mutations.RemoveHeaders { + log.Printf("Header to remove: %s", removeHeader) + } + } + if res.RequestHeaders.Response.BodyMutation != nil { + bodyMutation := res.RequestHeaders.Response.BodyMutation + if body, ok := bodyMutation.Mutation.(*ext_proc_v3.BodyMutation_Body); ok { + log.Printf("Body to replace: %s", string(body.Body)) + } + } + } + case *ext_proc_v3.ProcessingResponse_RequestBody: + log.Printf("Received RequestBody response") + if res.RequestBody != nil && res.RequestBody.Response != nil { + if res.RequestBody.Response.BodyMutation != nil { + bodyMutation := res.RequestBody.Response.BodyMutation + if body, ok := bodyMutation.Mutation.(*ext_proc_v3.BodyMutation_Body); ok { + log.Printf("Body to replace: %s", string(body.Body)) + } + } + } + case *ext_proc_v3.ProcessingResponse_RequestTrailers: + log.Printf("Received RequestTrailers response") + if res.RequestTrailers != nil { + mutations := res.RequestTrailers.HeaderMutation + if mutations != nil { + for _, setHeader := range mutations.SetHeaders { + header := setHeader.GetHeader() + log.Printf("Trailer to add: %s: %s", header.GetKey(), header.GetValue()) + } + for _, removeHeader := range mutations.RemoveHeaders { + log.Printf("Trailer to remove: %s", removeHeader) + } + } + } + case *ext_proc_v3.ProcessingResponse_ResponseHeaders: + log.Printf("Received ResponseHeaders response") + if res.ResponseHeaders != nil && res.ResponseHeaders.Response != nil { + mutations := res.ResponseHeaders.Response.HeaderMutation + if mutations != nil { + for _, setHeader := range mutations.SetHeaders { + header := setHeader.GetHeader() + log.Printf("Response header to add: %s: %s", header.GetKey(), header.GetValue()) + } + for _, removeHeader := range mutations.RemoveHeaders { + log.Printf("Response header to remove: %s", removeHeader) + } + } + if res.ResponseHeaders.Response.BodyMutation != nil { + bodyMutation := res.ResponseHeaders.Response.BodyMutation + if body, ok := bodyMutation.Mutation.(*ext_proc_v3.BodyMutation_Body); ok { + log.Printf("Response body to replace: %s", string(body.Body)) + } + } + } + case *ext_proc_v3.ProcessingResponse_ImmediateResponse: + log.Printf("Received ImmediateResponse") + immediateResponse := res.ImmediateResponse + if immediateResponse != nil { + status := immediateResponse.Status + if status != nil { + statusCode := int32(status.Code) + log.Printf("Immediate response status: %d", statusCode) + } else { + log.Printf("Immediate response status: nil") + } + body := immediateResponse.Body + log.Printf("Immediate response body: %s", string(body)) + if immediateResponse.Headers != nil { + for _, setHeader := range immediateResponse.Headers.SetHeaders { + header := setHeader.GetHeader() + log.Printf("Immediate response header: %s: %s", header.GetKey(), header.GetValue()) + } + } + } + default: + log.Printf("Received unknown response type: %v", response) + } + + // Handle DynamicMetadata if present + if response.DynamicMetadata != nil { + log.Printf("Received Dynamic Metadata:") + for k, v := range response.DynamicMetadata.Fields { + log.Printf(" %s: %v", k, v) + } + } +} diff --git a/examples/extproc/config.yaml b/examples/extproc/config.yaml new file mode 100644 index 000000000..44d28448e --- /dev/null +++ b/examples/extproc/config.yaml @@ -0,0 +1,19 @@ +plugins: + envoy_ext_authz_grpc: + addr: "0.0.0.0:9191" + path: "envoy/authz/allow" + dry-run: false + enable-reflection: false + skip-request-body-parse: false + enable-performance-metrics: false + + envoy_ext_proc_grpc: + addr: "0.0.0.0:9292" + path: "ext_proc/response" + dry-run: false + enable-reflection: false + skip-request-body-parse: false + enable-performance-metrics: false + +logging: + level: "debug" diff --git a/examples/extproc/policy.rego b/examples/extproc/policy.rego new file mode 100644 index 000000000..993faaf1f --- /dev/null +++ b/examples/extproc/policy.rego @@ -0,0 +1,127 @@ +package ext_proc + +# Default response is an empty object +default response = {} + +# Immediate response with custom status code, body, and headers +response = { + "immediate_response": { + "status": 403, + "body": "Access Denied", + "headers": [ + {"key": "Content-Type", "value": "text/plain"}, + {"key": "X-Immediate-Response", "value": "True"} + ], + "grpc_status": 7, # PERMISSION_DENIED + "details": "Unauthorized access attempt" + } +} { + input.path == "/forbidden" +} + +# Add headers to the request or response +response = { + "headers_to_add": [ + { + "key": "X-Added-Header", + "value": "HeaderValue", + "header_append_action": "OVERWRITE_IF_EXISTS_OR_ADD" + } + ] +} { + input.path == "/add-headers" +} + +# Remove headers from the request or response +response = { + "headers_to_remove": [ + "X-Remove-Header", + "X-Another-Header" + ] +} { + input.path == "/remove-headers" +} + +# Replace the body of the request or response +response = { + "body": "This is the new body content" +} { + input.request_type == "request_body" + input.path == "/replace-body" +} + +# Provide dynamic metadata +response = { + "dynamic_metadata": { + "my_extension": { + "user_id": input.headers["x-user-id"], + "session_id": input.headers["x-session-id"] + } + } +} { + input.path == "/dynamic-metadata" +} + +# Combine header mutation and body replacement +response = { + "headers_to_add": [ + { + "key": "X-Combined-Header", + "value": "CombinedValue" + } + ], + "body": "Combined response with headers and body changes" +} { + input.path == "/combined" +} + +# Handle request trailers +response = { + "trailers_to_add": [ + { + "key": "X-Trailer-Added", + "value": "TrailerValue" + } + ] +} { + input.request_type == "request_trailers" + input.path == "/modify-trailers" +} + +# Handle response headers +response = { + "headers_to_add": [ + { + "key": "X-Response-Header", + "value": "ResponseHeaderValue" + } + ] +} { + input.request_type == "response_headers" + input.path == "/modify-response-headers" +} + +# Deny all other requests by default with an immediate response +response = { + "immediate_response": { + "status": 403, + "body": "Default Deny", + "headers": [ + {"key": "Content-Type", "value": "text/plain"}, + {"key": "X-Default-Deny", "value": "True"} + ] + } +} { + not allowed_paths[input.path] +} + +allowed_paths = { + "/forbidden", + "/add-headers", + "/remove-headers", + "/replace-body", + "/dynamic-metadata", + "/combined", + "/modify-trailers", + "/modify-response-headers" +} From c0220b73f1e221a2ab9e36ab583a5a9bedae6d45 Mon Sep 17 00:00:00 2001 From: pweiber Date: Mon, 18 Nov 2024 17:44:01 -0300 Subject: [PATCH 10/10] Moving back to original Factory and PluginName for authz backwards compatibility Signed-off-by: pweiber --- cmd/opa-envoy-plugin/main.go | 4 ++-- internal/internal.go | 16 ++++++++-------- internal/internal_test.go | 26 +++++++++++++------------- plugin/plugin.go | 20 ++++++++++---------- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/cmd/opa-envoy-plugin/main.go b/cmd/opa-envoy-plugin/main.go index 2ba0dce9b..4e3cd6e9c 100644 --- a/cmd/opa-envoy-plugin/main.go +++ b/cmd/opa-envoy-plugin/main.go @@ -14,8 +14,8 @@ import ( ) func main() { - runtime.RegisterPlugin("envoy.ext_authz.grpc", plugin.AuthZFactory{}) // for backwards compatibility - runtime.RegisterPlugin(plugin.AuthZPluginName, plugin.AuthZFactory{}) + runtime.RegisterPlugin("envoy.ext_authz.grpc", plugin.Factory{}) // for backwards compatibility + runtime.RegisterPlugin(plugin.PluginName, plugin.Factory{}) runtime.RegisterPlugin(plugin.ExtProcPluginName, plugin.ExtProcFactory{}) if err := cmd.RootCommand.Execute(); err != nil { diff --git a/internal/internal.go b/internal/internal.go index 435b8704a..b4f71f7f6 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -72,8 +72,8 @@ const ( defaultGRPCServerMaxReceiveMessageSize = 1024 * 1024 * 4 defaultGRPCServerMaxSendMessageSize = math.MaxInt32 - // AuthZPluginName and ExtProcPluginName Respective names to register with the OPA plugin manager - AuthZPluginName = "envoy_ext_authz_grpc" + // PluginName and ExtProcPluginName Respective names to register with the OPA plugin manager + PluginName = "envoy_ext_authz_grpc" ExtProcPluginName = "envoy_ext_proc_grpc" ) @@ -146,7 +146,7 @@ func Validate(m *plugins.Manager, bs []byte) (*Config, error) { } // New returns a Plugin that implements the Envoy ext_authz API. -func NewAuthZ(m *plugins.Manager, cfg *Config) plugins.Plugin { +func New(m *plugins.Manager, cfg *Config) plugins.Plugin { grpcOpts := []grpc.ServerOption{ grpc.MaxRecvMsgSize(cfg.GRPCMaxRecvMsgSize), grpc.MaxSendMsgSize(cfg.GRPCMaxSendMsgSize), @@ -202,7 +202,7 @@ func NewAuthZ(m *plugins.Manager, cfg *Config) plugins.Plugin { plugin.manager.PrometheusRegister().MustRegister(errorCounter) } - m.UpdatePluginStatus(AuthZPluginName, &plugins.Status{State: plugins.StateNotReady}) + m.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) return plugin } @@ -297,14 +297,14 @@ func (p *envoyExtAuthzGrpcServer) CreatePreparedQueryOnce(opts envoyauth.Prepare } func (p *envoyExtAuthzGrpcServer) Start(ctx context.Context) error { - p.manager.UpdatePluginStatus(AuthZPluginName, &plugins.Status{State: plugins.StateNotReady}) + p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) go p.listen() return nil } func (p *envoyExtAuthzGrpcServer) Stop(ctx context.Context) { p.server.Stop() - p.manager.UpdatePluginStatus(AuthZPluginName, &plugins.Status{State: plugins.StateNotReady}) + p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) } func (p *envoyExtAuthzGrpcServer) Reconfigure(ctx context.Context, config interface{}) { @@ -361,7 +361,7 @@ func (p *envoyExtAuthzGrpcServer) listen() { "enable-reflection": p.cfg.EnableReflection, }).Info("Starting gRPC server.") - p.manager.UpdatePluginStatus(AuthZPluginName, &plugins.Status{State: plugins.StateOK}) + p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateOK}) if err := p.server.Serve(l); err != nil { logger.WithFields(map[string]interface{}{"err": err}).Error("Listener failed.") @@ -369,7 +369,7 @@ func (p *envoyExtAuthzGrpcServer) listen() { } logger.Info("Listener exited.") - p.manager.UpdatePluginStatus(AuthZPluginName, &plugins.Status{State: plugins.StateNotReady}) + p.manager.UpdatePluginStatus(PluginName, &plugins.Status{State: plugins.StateNotReady}) } // Check is envoy.service.auth.v3.Authorization/Check diff --git a/internal/internal_test.go b/internal/internal_test.go index 28d76f43d..c12a171b7 100644 --- a/internal/internal_test.go +++ b/internal/internal_test.go @@ -1850,12 +1850,12 @@ func TestPluginStatusLifeCycle(t *testing.T) { t.Fatalf("Unexpected error: %s", err) } - p := NewAuthZ(m, &Config{ + p := New(m, &Config{ Addr: ":0", }) - m.Register(AuthZPluginName, p) + m.Register(PluginName, p) - assertAuthZPluginState(t, m, plugins.StateNotReady) + assertPluginState(t, m, plugins.StateNotReady) ctx := context.Background() err = m.Start(ctx) @@ -1865,14 +1865,14 @@ func TestPluginStatusLifeCycle(t *testing.T) { // Wait a short time for the plugin to reach OK state // If it hits this timeout something bad has almost definitely happened - waitForAuthZPluginState(t, m, plugins.StateOK, 5*time.Second) + waitForPluginState(t, m, plugins.StateOK, 5*time.Second) m.Stop(ctx) - assertAuthZPluginState(t, m, plugins.StateNotReady) + assertPluginState(t, m, plugins.StateNotReady) } -func waitForAuthZPluginState(t *testing.T, m *plugins.Manager, desired plugins.State, timeout time.Duration) { +func waitForPluginState(t *testing.T, m *plugins.Manager, desired plugins.State, timeout time.Duration) { after := time.After(timeout) tick := time.Tick(10 * time.Microsecond) for { @@ -1880,7 +1880,7 @@ func waitForAuthZPluginState(t *testing.T, m *plugins.Manager, desired plugins.S case <-after: t.Fatal("Plugin failed to reach OK state in time") case <-tick: - state, err := getAuthZPluginState(t, m) + state, err := getPluginState(t, m) if err == nil && state == desired { return } @@ -1888,11 +1888,11 @@ func waitForAuthZPluginState(t *testing.T, m *plugins.Manager, desired plugins.S } } -func getAuthZPluginState(t *testing.T, m *plugins.Manager) (plugins.State, error) { +func getPluginState(t *testing.T, m *plugins.Manager) (plugins.State, error) { t.Helper() - status, ok := m.PluginStatus()[AuthZPluginName] + status, ok := m.PluginStatus()[PluginName] if !ok { - return plugins.StateNotReady, fmt.Errorf("expected plugin %s to be in manager plugin status map", AuthZPluginName) + return plugins.StateNotReady, fmt.Errorf("expected plugin %s to be in manager plugin status map", PluginName) } if status == nil { return plugins.StateNotReady, errors.New("expected a non-nil status value") @@ -1900,9 +1900,9 @@ func getAuthZPluginState(t *testing.T, m *plugins.Manager) (plugins.State, error return status.State, nil } -func assertAuthZPluginState(t *testing.T, m *plugins.Manager, expected plugins.State) { +func assertPluginState(t *testing.T, m *plugins.Manager, expected plugins.State) { t.Helper() - state, err := getAuthZPluginState(t, m) + state, err := getPluginState(t, m) if err != nil { t.Fatal(err) } @@ -2008,7 +2008,7 @@ func testAuthzServerWithModule(module string, path string, customConfig *Config, } } - s := NewAuthZ(m, &cfg) + s := New(m, &cfg) return s.(*envoyExtAuthzGrpcServer) } diff --git a/plugin/plugin.go b/plugin/plugin.go index 0edf563c0..432b4b29e 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -10,34 +10,34 @@ import ( "github.com/open-policy-agent/opa-envoy-plugin/internal" ) -// AuthZFactory defines the factory for the AuthZ plugin. -type AuthZFactory struct{} +// Factory defines the interface OPA uses to instantiate a plugin. +type Factory struct{} // ExtProcFactory defines the factory for the ExtProc plugin. type ExtProcFactory struct{} // Plugin names to register with the OPA plugin manager. const ( - AuthZPluginName = "envoy_ext_authz_grpc" + PluginName = internal.PluginName ExtProcPluginName = "envoy_ext_proc_grpc" ) -// New method for AuthZFactory. -func (AuthZFactory) New(m *plugins.Manager, config interface{}) plugins.Plugin { - return internal.NewAuthZ(m, config.(*internal.Config)) +// New returns the object initialized with a valid plugin configuration. +func (Factory) New(m *plugins.Manager, config interface{}) plugins.Plugin { + return internal.New(m, config.(*internal.Config)) } -// Validate method for AuthZFactory. -func (AuthZFactory) Validate(m *plugins.Manager, configBytes []byte) (interface{}, error) { +// Validate returns a valid configuration to instantiate the plugin. +func (Factory) Validate(m *plugins.Manager, configBytes []byte) (interface{}, error) { return internal.Validate(m, configBytes) } -// New method for ExtProcFactory. +// New returns the object initialized with a valid plugin configuration. func (ExtProcFactory) New(m *plugins.Manager, config interface{}) plugins.Plugin { return internal.NewExtProc(m, config.(*internal.Config)) } -// Validate method for ExtProcFactory. +// Validate returns a valid configuration to instantiate the plugin. func (ExtProcFactory) Validate(m *plugins.Manager, configBytes []byte) (interface{}, error) { return internal.Validate(m, configBytes) }