cuelang.org/go@v0.10.1/encoding/protobuf/testdata/client_config.proto.out.cue (about)

     1  // Copyright 2017 Istio Authors
     2  //
     3  //   Licensed under the Apache License, Version 2.0 (the "License");
     4  //   you may not use this file except in compliance with the License.
     5  //   You may obtain a copy of the License at
     6  //
     7  //       http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  //   Unless required by applicable law or agreed to in writing, software
    10  //   distributed under the License is distributed on an "AS IS" BASIS,
    11  //   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  //   See the License for the specific language governing permissions and
    13  //   limitations under the License.
    14  
    15  // $title: Mixer Client
    16  // $description: Configuration state for the Mixer client library.
    17  // $location: https://istio.io/docs/reference/config/policy-and-telemetry/istio.mixer.v1.config.client
    18  
    19  // Describes the configuration state for the Mixer client library that's built into Envoy.
    20  package client
    21  
    22  import (
    23  	"time"
    24  	"istio.io/api/mixer/v1"
    25  )
    26  
    27  // Specifies the behavior when the client is unable to connect to Mixer.
    28  #NetworkFailPolicy: {
    29  	// Example of single-value enum.
    30  	#FailPolicy: {
    31  		// If network connection fails, request is allowed and delivered to the
    32  		// service.
    33  		"FAIL_OPEN"
    34  		#enumValue: 0
    35  	}
    36  
    37  	#FailPolicy_value: FAIL_OPEN: 0
    38  
    39  	// Specifies the behavior when the client is unable to connect to Mixer.
    40  	policy?: #FailPolicy @protobuf(1,FailPolicy)
    41  
    42  	// Max retries on transport error.
    43  	maxRetry?: uint32 @protobuf(2,uint32,name=max_retry)
    44  
    45  	// Base time to wait between retries.  Will be adjusted by exponential
    46  	// backoff and jitter.
    47  	baseRetryWait?: time.Duration @protobuf(3,google.protobuf.Duration,name=base_retry_wait)
    48  
    49  	// Max time to wait between retries.
    50  	maxRetryWait?: time.Duration @protobuf(4,google.protobuf.Duration,name=max_retry_wait)
    51  }
    52  
    53  // Defines the per-service client configuration.
    54  #ServiceConfig: {
    55  	// If true, do not call Mixer Check.
    56  	disableCheckCalls?: bool @protobuf(1,bool,name=disable_check_calls)
    57  
    58  	// If true, do not call Mixer Report.
    59  	disableReportCalls?: bool @protobuf(2,bool,name=disable_report_calls)
    60  
    61  	// Send these attributes to Mixer in both Check and Report. This
    62  	// typically includes the "destination.service" attribute.
    63  	// In case of a per-route override, per-route attributes take precedence
    64  	// over the attributes supplied in the client configuration.
    65  	mixerAttributes?: v1.#Attributes @protobuf(3,Attributes,name=mixer_attributes)
    66  
    67  	// HTTP API specifications to generate API attributes.
    68  	httpApiSpec?: [...#HTTPAPISpec] @protobuf(4,HTTPAPISpec,name=http_api_spec)
    69  
    70  	// Quota specifications to generate quota requirements.
    71  	quotaSpec?: [...#QuotaSpec] @protobuf(5,QuotaSpec,name=quota_spec)
    72  
    73  	// Specifies the behavior when the client is unable to connect to Mixer.
    74  	// This is the service-level policy. It overrides
    75  	// [mesh-level
    76  	// policy][istio.mixer.v1.config.client.TransportConfig.network_fail_policy].
    77  	networkFailPolicy?: #NetworkFailPolicy @protobuf(7,NetworkFailPolicy,name=network_fail_policy)
    78  
    79  	// Default attributes to forward to upstream. This typically
    80  	// includes the "source.ip" and "source.uid" attributes.
    81  	// In case of a per-route override, per-route attributes take precedence
    82  	// over the attributes supplied in the client configuration.
    83  	//
    84  	// Forwarded attributes take precedence over the static Mixer attributes.
    85  	// The full order of application is as follows:
    86  	// 1. static Mixer attributes from the filter config;
    87  	// 2. static Mixer attributes from the route config;
    88  	// 3. forwarded attributes from the source filter config (if any);
    89  	// 4. forwarded attributes from the source route config (if any);
    90  	// 5. derived attributes from the request metadata.
    91  	forwardAttributes?: v1.#Attributes @protobuf(8,Attributes,name=forward_attributes)
    92  }
    93  
    94  // Defines the transport config on how to call Mixer.
    95  #TransportConfig: {
    96  	// The flag to disable check cache.
    97  	disableCheckCache?: bool @protobuf(1,bool,name=disable_check_cache)
    98  
    99  	// The flag to disable quota cache.
   100  	disableQuotaCache?: bool @protobuf(2,bool,name=disable_quota_cache)
   101  
   102  	// The flag to disable report batch.
   103  	disableReportBatch?: bool @protobuf(3,bool,name=disable_report_batch)
   104  
   105  	// Specifies the behavior when the client is unable to connect to Mixer.
   106  	// This is the mesh level policy. The default value for policy is FAIL_OPEN.
   107  	networkFailPolicy?: #NetworkFailPolicy @protobuf(4,NetworkFailPolicy,name=network_fail_policy)
   108  
   109  	// Specify refresh interval to write Mixer client statistics to Envoy share
   110  	// memory. If not specified, the interval is 10 seconds.
   111  	statsUpdateInterval?: time.Duration @protobuf(5,google.protobuf.Duration,name=stats_update_interval)
   112  
   113  	// Name of the cluster that will forward check calls to a pool of mixer
   114  	// servers. Defaults to "mixer_server". By using different names for
   115  	// checkCluster and reportCluster, it is possible to have one set of
   116  	// Mixer servers handle check calls, while another set of Mixer servers
   117  	// handle report calls.
   118  	//
   119  	// NOTE: Any value other than the default "mixer_server" will require the
   120  	// Istio Grafana dashboards to be reconfigured to use the new name.
   121  	checkCluster?: string @protobuf(6,string,name=check_cluster)
   122  
   123  	// Name of the cluster that will forward report calls to a pool of mixer
   124  	// servers. Defaults to "mixer_server". By using different names for
   125  	// checkCluster and reportCluster, it is possible to have one set of
   126  	// Mixer servers handle check calls, while another set of Mixer servers
   127  	// handle report calls.
   128  	//
   129  	// NOTE: Any value other than the default "mixer_server" will require the
   130  	// Istio Grafana dashboards to be reconfigured to use the new name.
   131  	reportCluster?: string @protobuf(7,string,name=report_cluster)
   132  
   133  	// Default attributes to forward to Mixer upstream. This typically
   134  	// includes the "source.ip" and "source.uid" attributes. These
   135  	// attributes are consumed by the proxy in front of mixer.
   136  	attributesForMixerProxy?: v1.#Attributes @protobuf(8,Attributes,name=attributes_for_mixer_proxy)
   137  }
   138  
   139  // Defines the client config for HTTP.
   140  #HttpClientConfig: {
   141  	// The transport config.
   142  	transport?: #TransportConfig @protobuf(1,TransportConfig)
   143  
   144  	// Map of control configuration indexed by destination.service. This
   145  	// is used to support per-service configuration for cases where a
   146  	// mixerclient serves multiple services.
   147  	serviceConfigs?: {
   148  		[string]: #ServiceConfig
   149  	} @protobuf(2,map[string]ServiceConfig,service_configs)
   150  
   151  	// Default destination service name if none was specified in the
   152  	// client request.
   153  	defaultDestinationService?: string @protobuf(3,string,name=default_destination_service)
   154  
   155  	// Default attributes to send to Mixer in both Check and
   156  	// Report. This typically includes "destination.ip" and
   157  	// "destination.uid" attributes.
   158  	mixerAttributes?: v1.#Attributes @protobuf(4,Attributes,name=mixer_attributes)
   159  
   160  	// Default attributes to forward to upstream. This typically
   161  	// includes the "source.ip" and "source.uid" attributes.
   162  	forwardAttributes?: v1.#Attributes @protobuf(5,Attributes,name=forward_attributes)
   163  }
   164  
   165  // Defines the client config for TCP.
   166  #TcpClientConfig: {
   167  	// The transport config.
   168  	transport?: #TransportConfig @protobuf(1,TransportConfig)
   169  
   170  	// Default attributes to send to Mixer in both Check and
   171  	// Report. This typically includes "destination.ip" and
   172  	// "destination.uid" attributes.
   173  	mixerAttributes?: v1.#Attributes @protobuf(2,Attributes,name=mixer_attributes)
   174  
   175  	// If set to true, disables Mixer check calls.
   176  	disableCheckCalls?: bool @protobuf(3,bool,name=disable_check_calls)
   177  
   178  	// If set to true, disables Mixer check calls.
   179  	disableReportCalls?: bool @protobuf(4,bool,name=disable_report_calls)
   180  
   181  	// Quota specifications to generate quota requirements.
   182  	// It applies on the new TCP connections.
   183  	connectionQuotaSpec?: #QuotaSpec @protobuf(5,QuotaSpec,name=connection_quota_spec)
   184  
   185  	// Specify report interval to send periodical reports for long TCP
   186  	// connections. If not specified, the interval is 10 seconds. This interval
   187  	// should not be less than 1 second, otherwise it will be reset to 1 second.
   188  	reportInterval?: time.Duration @protobuf(6,google.protobuf.Duration,name=report_interval)
   189  }