cuelang.org/go@v0.10.1/encoding/protobuf/testdata/mixer/v1/attributes.proto (about) 1 // Copyright 2016 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 syntax = "proto3"; 16 17 package istio.mixer.v1; 18 19 option go_package = "istio.io/api/mixer/v1"; 20 21 import "gogoproto/gogo.proto"; 22 import "google/protobuf/duration.proto"; 23 import "google/protobuf/timestamp.proto"; 24 25 option (gogoproto.goproto_getters_all) = false; 26 option (gogoproto.equal_all) = false; 27 option (gogoproto.gostring_all) = false; 28 option (gogoproto.stable_marshaler_all) = true; 29 option cc_enable_arenas = true; 30 31 // Attributes represents a set of typed name/value pairs. Many of Mixer's 32 // API either consume and/or return attributes. 33 // 34 // Istio uses attributes to control the runtime behavior of services running in the service mesh. 35 // Attributes are named and typed pieces of metadata describing ingress and egress traffic and the 36 // environment this traffic occurs in. An Istio attribute carries a specific piece 37 // of information such as the error code of an API request, the latency of an API request, or the 38 // original IP address of a TCP connection. For example: 39 // 40 // ```yaml 41 // request.path: xyz/abc 42 // request.size: 234 43 // request.time: 12:34:56.789 04/17/2017 44 // source.ip: 192.168.0.1 45 // target.service: example 46 // ``` 47 // 48 // A given Istio deployment has a fixed vocabulary of attributes that it understands. 49 // The specific vocabulary is determined by the set of attribute producers being used 50 // in the deployment. The primary attribute producer in Istio is Envoy, although 51 // specialized Mixer adapters and services can also generate attributes. 52 // 53 // The common baseline set of attributes available in most Istio deployments is defined 54 // [here](https://istio.io/docs/reference/config/policy-and-telemetry/attribute-vocabulary/). 55 // 56 // Attributes are strongly typed. The supported attribute types are defined by 57 // [ValueType](https://github.com/istio/api/blob/master/policy/v1beta1/value_type.proto). 58 // Each type of value is encoded into one of the so-called transport types present 59 // in this message. 60 // 61 // Defines a map of attributes in uncompressed format. 62 // Following places may use this message: 63 // 1) Configure Istio/Proxy with static per-proxy attributes, such as source.uid. 64 // 2) Service IDL definition to extract api attributes for active requests. 65 // 3) Forward attributes from client proxy to server proxy for HTTP requests. 66 message Attributes { 67 // A map of attribute name to its value. 68 map<string, AttributeValue> attributes = 1; 69 70 // Specifies one attribute value with different type. 71 message AttributeValue { 72 // The attribute value. 73 oneof value { 74 // Used for values of type STRING, DNS_NAME, EMAIL_ADDRESS, and URI 75 string string_value = 2; 76 77 // Used for values of type INT64 78 int64 int64_value = 3; 79 80 // Used for values of type DOUBLE 81 double double_value = 4; 82 83 // Used for values of type BOOL 84 bool bool_value = 5; 85 86 // Used for values of type BYTES 87 bytes bytes_value = 6; 88 89 // Used for values of type TIMESTAMP 90 google.protobuf.Timestamp timestamp_value = 7; 91 92 // Used for values of type DURATION 93 google.protobuf.Duration duration_value = 8; 94 95 // Used for values of type STRING_MAP 96 StringMap string_map_value = 9; 97 } 98 } 99 100 // Defines a string map. 101 message StringMap { 102 // Holds a set of name/value pairs. 103 map<string, string> entries = 1; 104 } 105 } 106 107 // Defines a list of attributes in compressed format optimized for transport. 108 // Within this message, strings are referenced using integer indices into 109 // one of two string dictionaries. Positive integers index into the global 110 // deployment-wide dictionary, whereas negative integers index into the message-level 111 // dictionary instead. The message-level dictionary is carried by the 112 // `words` field of this message, the deployment-wide dictionary is determined via 113 // configuration. 114 message CompressedAttributes { 115 // The message-level dictionary. 116 repeated string words = 1; 117 118 // Holds attributes of type STRING, DNS_NAME, EMAIL_ADDRESS, URI 119 map<sint32, sint32> strings = 2; 120 121 // Holds attributes of type INT64 122 map<sint32, int64> int64s = 3; 123 124 // Holds attributes of type DOUBLE 125 map<sint32, double> doubles = 4; 126 127 // Holds attributes of type BOOL 128 map<sint32, bool> bools = 5; 129 130 // Holds attributes of type TIMESTAMP 131 map<sint32, google.protobuf.Timestamp> timestamps = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; 132 133 // Holds attributes of type DURATION 134 map<sint32, google.protobuf.Duration> durations = 7 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; 135 136 // Holds attributes of type BYTES 137 map<sint32, bytes> bytes = 8; 138 139 // Holds attributes of type STRING_MAP 140 map<sint32, StringMap> string_maps = 9 [(gogoproto.nullable) = false]; 141 } 142 143 // A map of string to string. The keys and values in this map are dictionary 144 // indices (see the [Attributes][istio.mixer.v1.CompressedAttributes] message for an explanation) 145 message StringMap { 146 // Holds a set of name/value pairs. 147 map<sint32, sint32> entries = 1; 148 }