cuelang.org/go@v0.10.1/encoding/protobuf/testdata/istio.io/api/mixer/v1/mixer_proto_gen.cue (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 // This package defines the Mixer API that the sidecar proxy uses to perform 16 // precondition checks, manage quotas, and report telemetry. 17 package v1 18 19 import ( 20 status_1 "google.golang.org/genproto/googleapis/rpc/status" 21 "time" 22 ) 23 24 // Used to get a thumbs-up/thumbs-down before performing an action. 25 #CheckRequest: { 26 // parameters for a quota allocation 27 #QuotaParams: { 28 // Amount of quota to allocate 29 amount?: int64 @protobuf(1,int64) 30 31 // When true, supports returning less quota than what was requested. 32 bestEffort?: bool @protobuf(2,bool,name=best_effort) 33 } 34 35 // The attributes to use for this request. 36 // 37 // Mixer's configuration determines how these attributes are used to 38 // establish the result returned in the response. 39 attributes?: #CompressedAttributes @protobuf(1,CompressedAttributes,"(gogoproto.nullable)=false") 40 41 // The number of words in the global dictionary, used with to populate the attributes. 42 // This value is used as a quick way to determine whether the client is using a dictionary that 43 // the server understands. 44 globalWordCount?: uint32 @protobuf(2,uint32,name=global_word_count) 45 46 // Used for deduplicating `Check` calls in the case of failed RPCs and retries. This should be a UUID 47 // per call, where the same UUID is used for retries of the same call. 48 deduplicationId?: string @protobuf(3,string,name=deduplication_id) 49 50 // The individual quotas to allocate 51 quotas?: { 52 [string]: #QuotaParams 53 } @protobuf(4,map[string]QuotaParams,"(gogoproto.nullable)=false") 54 } 55 56 // The response generated by the Check method. 57 #CheckResponse: { 58 // Expresses the result of a precondition check. 59 #PreconditionResult: { 60 // A status code of OK indicates all preconditions were satisfied. Any other code indicates not 61 // all preconditions were satisfied and details describe why. 62 status?: status_1.#Status @protobuf(1,google.rpc.Status,"(gogoproto.nullable)=false") 63 64 // The amount of time for which this result can be considered valid. 65 validDuration?: time.Duration @protobuf(2,google.protobuf.Duration,name=valid_duration,"(gogoproto.nullable)=false","(gogoproto.stdduration)") 66 67 // The number of uses for which this result can be considered valid. 68 validUseCount?: int32 @protobuf(3,int32,name=valid_use_count) 69 70 // The total set of attributes that were used in producing the result 71 // along with matching conditions. 72 referencedAttributes?: #ReferencedAttributes @protobuf(5,ReferencedAttributes,name=referenced_attributes) 73 74 // An optional routing directive, used to manipulate the traffic metadata 75 // whenever all preconditions are satisfied. 76 routeDirective?: #RouteDirective @protobuf(6,RouteDirective,name=route_directive) 77 } 78 79 // Expresses the result of a quota allocation. 80 #QuotaResult: { 81 // The amount of time for which this result can be considered valid. 82 validDuration?: time.Duration @protobuf(1,google.protobuf.Duration,name=valid_duration,"(gogoproto.nullable)=false","(gogoproto.stdduration)") 83 84 // The amount of granted quota. When `QuotaParams.best_effort` is true, this will be >= 0. 85 // If `QuotaParams.best_effort` is false, this will be either 0 or >= `QuotaParams.amount`. 86 grantedAmount?: int64 @protobuf(2,int64,name=granted_amount) 87 88 // The total set of attributes that were used in producing the result 89 // along with matching conditions. 90 referencedAttributes?: #ReferencedAttributes @protobuf(5,ReferencedAttributes,name=referenced_attributes,"(gogoproto.nullable)=false") 91 } 92 93 // The precondition check results. 94 precondition?: #PreconditionResult @protobuf(2,PreconditionResult,"(gogoproto.nullable)=false") 95 96 // The resulting quota, one entry per requested quota. 97 quotas?: { 98 [string]: #QuotaResult 99 } @protobuf(3,map[string]QuotaResult,"(gogoproto.nullable)=false") 100 } 101 102 // Describes the attributes that were used to determine the response. 103 // This can be used to construct a response cache. 104 #ReferencedAttributes: { 105 // How an attribute's value was matched 106 #Condition: { 107 "CONDITION_UNSPECIFIED" // should not occur 108 #enumValue: 0 109 } | { 110 "ABSENCE" // match when attribute doesn't exist 111 #enumValue: 1 112 } | { 113 "EXACT" // match when attribute value is an exact byte-for-byte match 114 #enumValue: 2 115 } | { 116 "REGEX" // match when attribute value matches the included regex 117 #enumValue: 3 118 } 119 120 #Condition_value: { 121 "CONDITION_UNSPECIFIED": 0 122 "ABSENCE": 1 123 "EXACT": 2 124 "REGEX": 3 125 } 126 127 // Describes a single attribute match. 128 #AttributeMatch: { 129 // The name of the attribute. This is a dictionary index encoded in a manner identical 130 // to all strings in the [CompressedAttributes][istio.mixer.v1.CompressedAttributes] message. 131 name?: int32 @protobuf(1,sint32) 132 133 // The kind of match against the attribute value. 134 condition?: #Condition @protobuf(2,Condition) 135 136 // If a REGEX condition is provided for a STRING_MAP attribute, 137 // clients should use the regex value to match against map keys. 138 regex?: string @protobuf(3,string) 139 140 // A key in a STRING_MAP. When multiple keys from a STRING_MAP 141 // attribute were referenced, there will be multiple AttributeMatch 142 // messages with different map_key values. Values for map_key SHOULD 143 // be ignored for attributes that are not STRING_MAP. 144 // 145 // Indices for the keys are used (taken either from the 146 // message dictionary from the `words` field or the global dictionary). 147 // 148 // If no map_key value is provided for a STRING_MAP attribute, the 149 // entire STRING_MAP will be used. 150 mapKey?: int32 @protobuf(4,sint32,name=map_key) 151 } 152 153 // The message-level dictionary. Refer to [CompressedAttributes][istio.mixer.v1.CompressedAttributes] for information 154 // on using dictionaries. 155 words?: [...string] @protobuf(1,string) 156 157 // Describes a set of attributes. 158 attributeMatches?: [...#AttributeMatch] @protobuf(2,AttributeMatch,name=attribute_matches,"(gogoproto.nullable)=false") 159 } 160 161 // Operation on HTTP headers to replace, append, or remove a header. Header 162 // names are normalized to lower-case with dashes, e.g. "x-request-id". 163 // Pseudo-headers ":path", ":authority", and ":method" are supported to modify 164 // the request headers. 165 #HeaderOperation: { 166 // Operation type. 167 #Operation: { 168 "REPLACE" // replaces the header with the given name 169 #enumValue: 0 170 } | { 171 "REMOVE" // removes the header with the given name (the value is ignored) 172 #enumValue: 1 173 } | { 174 "APPEND" // appends the value to the header value, or sets it if not present 175 #enumValue: 2 176 } 177 178 #Operation_value: { 179 "REPLACE": 0 180 "REMOVE": 1 181 "APPEND": 2 182 } 183 184 // Header name. 185 name?: string @protobuf(1,string) 186 187 // Header value. 188 value?: string @protobuf(2,string) 189 190 // Header operation. 191 operation?: #Operation @protobuf(3,Operation) 192 } 193 194 // Expresses the routing manipulation actions to be performed on behalf of 195 // Mixer in response to a precondition check. 196 #RouteDirective: { 197 // Operations on the request headers. 198 requestHeaderOperations?: [...#HeaderOperation] @protobuf(1,HeaderOperation,name=request_header_operations,"(gogoproto.nullable)=false") 199 200 // Operations on the response headers. 201 responseHeaderOperations?: [...#HeaderOperation] @protobuf(2,HeaderOperation,name=response_header_operations,"(gogoproto.nullable)=false") 202 203 // If set, enables a direct response without proxying the request to the routing 204 // destination. Required to be a value in the 2xx or 3xx range. 205 directResponseCode?: uint32 @protobuf(3,uint32,name=direct_response_code) 206 207 // Supplies the response body for the direct response. 208 // If this setting is omitted, no body is included in the generated response. 209 directResponseBody?: string @protobuf(4,string,name=direct_response_body) 210 } 211 212 // Used to report telemetry after performing one or more actions. 213 #ReportRequest: { 214 // next value: 5 215 216 // Used to signal how the sets of compressed attributes should be reconstitued server-side. 217 #RepeatedAttributesSemantics: { 218 // Use delta encoding between sets of compressed attributes to reduce the overall on-wire 219 // request size. Each individual set of attributes is used to modify the previous set. 220 // NOTE: There is no way with this encoding to specify attribute value deletion. This 221 // option should be used with extreme caution. 222 "DELTA_ENCODING" 223 #enumValue: 0 224 } | { 225 // Treat each set of compressed attributes as complete - independent from other sets 226 // in this request. This will result in on-wire duplication of attributes and values, but 227 // will allow for proper accounting of absent values in overall encoding. 228 "INDEPENDENT_ENCODING" 229 #enumValue: 1 230 } 231 232 #RepeatedAttributesSemantics_value: { 233 "DELTA_ENCODING": 0 234 "INDEPENDENT_ENCODING": 1 235 } 236 237 // The attributes to use for this request. 238 // 239 // Each `Attributes` element represents the state of a single action. Multiple actions 240 // can be provided in a single message in order to improve communication efficiency. The 241 // client can accumulate a set of actions and send them all in one single message. 242 attributes?: [...#CompressedAttributes] @protobuf(1,CompressedAttributes,"(gogoproto.nullable)=false") 243 244 // Indicates how to decode the attributes sets in this request. 245 repeatedAttributesSemantics?: #RepeatedAttributesSemantics @protobuf(4,RepeatedAttributesSemantics,name=repeated_attributes_semantics) 246 247 // The default message-level dictionary for all the attributes. 248 // Individual attribute messages can have their own dictionaries, but if they don't 249 // then this set of words, if it is provided, is used instead. 250 // 251 // This makes it possible to share the same dictionary for all attributes in this 252 // request, which can substantially reduce the overall request size. 253 defaultWords?: [...string] @protobuf(2,string,name=default_words) 254 255 // The number of words in the global dictionary. 256 // To detect global dictionary out of sync between client and server. 257 globalWordCount?: uint32 @protobuf(3,uint32,name=global_word_count) 258 } 259 260 // Used to carry responses to telemetry reports 261 #ReportResponse: {}