diff --git a/policy/v1beta1/cfg.proto b/policy/v1beta1/cfg.proto index 7edfba36948..11d73fa38d5 100644 --- a/policy/v1beta1/cfg.proto +++ b/policy/v1beta1/cfg.proto @@ -124,6 +124,34 @@ message Rule { // Optional. The actions that will be executed when match evaluates to `true`. repeated Action actions = 2; + + // A template for an HTTP header manipulation. + message HeaderOperationTemplate { + + // Required. Header name. + string name = 1; + + // Optional. Header values to replace or append. + repeated string values = 2; + + // Header operation type. + enum Operation { + REPLACE = 0; // replaces the header with the given name + REMOVE = 1; // removes the header with the given name (the value is ignored) + APPEND = 2; // appends the values to the existing values (preserving existing values) + } + + // Optional. Header operation type. Default operation is to replace the value of the header by name. + Operation operation = 3; + } + + // Optional. Templatized operations on the request headers using attributes produced by the + // rule actions. + repeated HeaderOperationTemplate request_header_operations = 3; + + // Optional. Templatized operations on the response headers using attributes produced by the + // rule actions. + repeated HeaderOperationTemplate response_header_operations = 4; } // Action describes which [Handler][istio.policy.v1beta1.Handler] to invoke and what data to pass to it for processing. @@ -146,6 +174,9 @@ message Action { // Referenced instances are evaluated by resolving the attributes/literals for all the fields. // The constructed objects are then passed to the `handler` referenced within this action. repeated string instances = 3; + + // Optional. A handle to refer to the results of the action. + string name = 4; } // An Instance tells Mixer how to create instances for particular template. diff --git a/policy/v1beta1/fixed_cfg.pb.go b/policy/v1beta1/fixed_cfg.pb.go index b349ed77e85..eb3877ffe99 100644 --- a/policy/v1beta1/fixed_cfg.pb.go +++ b/policy/v1beta1/fixed_cfg.pb.go @@ -32,6 +32,33 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +// Header operation type. +type Rule_HeaderOperationTemplate_Operation int32 + +const ( + Rule_HeaderOperationTemplate_REPLACE Rule_HeaderOperationTemplate_Operation = 0 + Rule_HeaderOperationTemplate_REMOVE Rule_HeaderOperationTemplate_Operation = 1 + Rule_HeaderOperationTemplate_APPEND Rule_HeaderOperationTemplate_Operation = 2 +) + +var Rule_HeaderOperationTemplate_Operation_name = map[int32]string{ + 0: "REPLACE", + 1: "REMOVE", + 2: "APPEND", +} +var Rule_HeaderOperationTemplate_Operation_value = map[string]int32{ + "REPLACE": 0, + "REMOVE": 1, + "APPEND": 2, +} + +func (x Rule_HeaderOperationTemplate_Operation) String() string { + return proto.EnumName(Rule_HeaderOperationTemplate_Operation_name, int32(x)) +} +func (Rule_HeaderOperationTemplate_Operation) EnumDescriptor() ([]byte, []int) { + return fileDescriptorCfg, []int{1, 0, 0} +} + // AttributeManifest describes a set of Attributes produced by some component // of an Istio deployment. type AttributeManifest struct { @@ -180,6 +207,12 @@ type Rule struct { Match string `protobuf:"bytes,1,opt,name=match,proto3" json:"match,omitempty"` // Optional. The actions that will be executed when match evaluates to `true`. Actions []*Action `protobuf:"bytes,2,rep,name=actions" json:"actions,omitempty"` + // Optional. Templatized operations on the request headers using attributes produced by the + // rule actions. + RequestHeaderOperations []*Rule_HeaderOperationTemplate `protobuf:"bytes,3,rep,name=request_header_operations,json=requestHeaderOperations" json:"request_header_operations,omitempty"` + // Optional. Templatized operations on the response headers using attributes produced by the + // rule actions. + ResponseHeaderOperations []*Rule_HeaderOperationTemplate `protobuf:"bytes,4,rep,name=response_header_operations,json=responseHeaderOperations" json:"response_header_operations,omitempty"` } func (m *Rule) Reset() { *m = Rule{} } @@ -201,6 +234,58 @@ func (m *Rule) GetActions() []*Action { return nil } +func (m *Rule) GetRequestHeaderOperations() []*Rule_HeaderOperationTemplate { + if m != nil { + return m.RequestHeaderOperations + } + return nil +} + +func (m *Rule) GetResponseHeaderOperations() []*Rule_HeaderOperationTemplate { + if m != nil { + return m.ResponseHeaderOperations + } + return nil +} + +// A template for an HTTP header manipulation. +type Rule_HeaderOperationTemplate struct { + // Required. Header name. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Optional. Header values to replace or append. + Values []string `protobuf:"bytes,2,rep,name=values" json:"values,omitempty"` + // Optional. Header operation type. Default operation is to replace the value of the header by name. + Operation Rule_HeaderOperationTemplate_Operation `protobuf:"varint,3,opt,name=operation,proto3,enum=istio.policy.v1beta1.Rule_HeaderOperationTemplate_Operation" json:"operation,omitempty"` +} + +func (m *Rule_HeaderOperationTemplate) Reset() { *m = Rule_HeaderOperationTemplate{} } +func (m *Rule_HeaderOperationTemplate) String() string { return proto.CompactTextString(m) } +func (*Rule_HeaderOperationTemplate) ProtoMessage() {} +func (*Rule_HeaderOperationTemplate) Descriptor() ([]byte, []int) { + return fileDescriptorCfg, []int{1, 0} +} + +func (m *Rule_HeaderOperationTemplate) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Rule_HeaderOperationTemplate) GetValues() []string { + if m != nil { + return m.Values + } + return nil +} + +func (m *Rule_HeaderOperationTemplate) GetOperation() Rule_HeaderOperationTemplate_Operation { + if m != nil { + return m.Operation + } + return Rule_HeaderOperationTemplate_REPLACE +} + // Action describes which [Handler][istio.policy.v1beta1.Handler] to invoke and what data to pass to it for processing. // // The following example instructs Mixer to invoke 'prometheus-handler' handler and pass it the object @@ -220,6 +305,8 @@ type Action struct { // Referenced instances are evaluated by resolving the attributes/literals for all the fields. // The constructed objects are then passed to the `handler` referenced within this action. Instances []string `protobuf:"bytes,3,rep,name=instances" json:"instances,omitempty"` + // Optional. A handle to refer to the results of the action. + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` } func (m *Action) Reset() { *m = Action{} } @@ -241,6 +328,13 @@ func (m *Action) GetInstances() []string { return nil } +func (m *Action) GetName() string { + if m != nil { + return m.Name + } + return "" +} + // An Instance tells Mixer how to create instances for particular template. // // Instance is defined by the operator. Instance is defined relative to a known @@ -452,47 +546,58 @@ func init() { proto.RegisterType((*AttributeManifest)(nil), "istio.policy.v1beta1.AttributeManifest") proto.RegisterType((*AttributeManifest_AttributeInfo)(nil), "istio.policy.v1beta1.AttributeManifest.AttributeInfo") proto.RegisterType((*Rule)(nil), "istio.policy.v1beta1.Rule") + proto.RegisterType((*Rule_HeaderOperationTemplate)(nil), "istio.policy.v1beta1.Rule.HeaderOperationTemplate") proto.RegisterType((*Action)(nil), "istio.policy.v1beta1.Action") proto.RegisterType((*Instance)(nil), "istio.policy.v1beta1.Instance") proto.RegisterType((*Handler)(nil), "istio.policy.v1beta1.Handler") proto.RegisterType((*Connection)(nil), "istio.policy.v1beta1.Connection") + proto.RegisterEnum("istio.policy.v1beta1.Rule_HeaderOperationTemplate_Operation", Rule_HeaderOperationTemplate_Operation_name, Rule_HeaderOperationTemplate_Operation_value) } func init() { proto.RegisterFile("policy/v1beta1/cfg.proto", fileDescriptorCfg) } var fileDescriptorCfg = []byte{ - // 519 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xdd, 0x6e, 0xd3, 0x30, - 0x14, 0x56, 0xd6, 0xae, 0x5d, 0x4f, 0x05, 0xdb, 0xac, 0x49, 0x44, 0xa5, 0x68, 0x51, 0x2e, 0xd0, - 0x2e, 0x50, 0xa2, 0x15, 0xf1, 0x23, 0x2e, 0xd0, 0x06, 0x42, 0x62, 0x42, 0xdc, 0x84, 0x0a, 0x24, - 0x6e, 0x2a, 0x37, 0x71, 0x3b, 0x8b, 0xc4, 0x36, 0xb6, 0x53, 0x29, 0x0f, 0xc0, 0x53, 0xf0, 0x04, - 0xbc, 0x11, 0x2f, 0xc1, 0x1d, 0x0f, 0x80, 0x62, 0x3b, 0x49, 0x19, 0xe5, 0x62, 0x77, 0x3e, 0xe7, - 0xfb, 0xce, 0x39, 0xdf, 0xf9, 0x31, 0xf8, 0x82, 0xe7, 0x34, 0xad, 0xe2, 0xcd, 0xf9, 0x92, 0x68, - 0x7c, 0x1e, 0xa7, 0xab, 0x75, 0x24, 0x24, 0xd7, 0x1c, 0x9d, 0x50, 0xa5, 0x29, 0x8f, 0x2c, 0x1e, - 0x39, 0x7c, 0x32, 0x5d, 0x73, 0xbe, 0xce, 0x49, 0x6c, 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 0xc5, - 0xac, 0x81, 0x9e, 0xc2, 0x10, 0xa7, 0x75, 0x77, 0xca, 0xdf, 0x33, 0xc3, 0x9d, 0xfe, 0xa7, 0xa0, - 0x21, 0x25, 0x0d, 0x39, 0xbc, 0x80, 0x81, 0x75, 0x21, 0x1f, 0x86, 0xd7, 0x98, 0x65, 0x39, 0x91, - 0x6e, 0x71, 0x8d, 0x89, 0xa6, 0x30, 0xa2, 0x4c, 0x69, 0xcc, 0x52, 0xb7, 0xba, 0x51, 0xd2, 0x39, - 0xc2, 0xef, 0x1e, 0x1c, 0x5c, 0x39, 0xab, 0x5d, 0xbd, 0xb7, 0xb5, 0xfa, 0x08, 0x8e, 0x53, 0x5e, - 0x08, 0x9a, 0x93, 0x6c, 0xa1, 0x49, 0x21, 0x72, 0xac, 0x89, 0xff, 0xfb, 0xd7, 0x8f, 0xc0, 0x70, - 0x8e, 0x1a, 0x6c, 0xee, 0xa0, 0xfa, 0xb4, 0x5a, 0x9a, 0x55, 0xd2, 0xda, 0x28, 0x86, 0x81, 0xc0, - 0x12, 0x17, 0xb5, 0x8e, 0x7a, 0xac, 0xf7, 0x22, 0x7b, 0xdc, 0x51, 0x73, 0xdc, 0xd1, 0x07, 0x73, - 0xdc, 0x89, 0xa3, 0x85, 0x3f, 0x3d, 0x18, 0xbe, 0x75, 0x7d, 0xec, 0x12, 0xf7, 0x08, 0x5a, 0x01, - 0x0b, 0x9c, 0x61, 0xa1, 0x89, 0xec, 0xb4, 0x1d, 0x36, 0xd0, 0xa5, 0x45, 0xea, 0x19, 0x35, 0x24, - 0x37, 0x23, 0x67, 0xde, 0x5a, 0x18, 0xba, 0x00, 0x48, 0x39, 0x63, 0xc4, 0x0c, 0xdf, 0xef, 0x9b, - 0xa0, 0x60, 0xf7, 0xce, 0x5e, 0xb7, 0xbc, 0x64, 0x2b, 0x26, 0x7c, 0x08, 0xd0, 0x21, 0x56, 0x5a, - 0x26, 0x89, 0x52, 0x9d, 0x34, 0x63, 0xbe, 0x7a, 0xf0, 0xf9, 0xbe, 0x4d, 0x4b, 0x79, 0x8c, 0x05, - 0x8d, 0xff, 0xfe, 0xf0, 0xcb, 0x81, 0x51, 0xf8, 0xf8, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3d, - 0xa4, 0x90, 0x01, 0x57, 0x04, 0x00, 0x00, + // 667 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcd, 0x6e, 0xd3, 0x4a, + 0x14, 0xbe, 0x4e, 0xd2, 0xa4, 0x3e, 0xd1, 0xbd, 0x4d, 0x47, 0xd5, 0xad, 0xaf, 0x6f, 0x51, 0x23, + 0x2f, 0x50, 0x17, 0xc8, 0xa6, 0x41, 0xfc, 0x08, 0x21, 0x44, 0x28, 0x91, 0x5a, 0x41, 0x69, 0x35, + 0x54, 0x45, 0xea, 0x26, 0x9a, 0x38, 0x27, 0xad, 0x85, 0x63, 0xbb, 0x33, 0x93, 0x48, 0x79, 0x00, + 0x76, 0xbc, 0x01, 0x4f, 0xc0, 0xf3, 0xb0, 0xe1, 0x25, 0xd8, 0xf1, 0x00, 0xc8, 0x33, 0xfe, 0x09, + 0xc1, 0x5d, 0x94, 0xdd, 0x9c, 0x73, 0xbe, 0xf3, 0x9d, 0xef, 0x7c, 0x1e, 0x0f, 0x58, 0x49, 0x1c, + 0x06, 0xfe, 0xc2, 0x9b, 0xef, 0x8f, 0x50, 0xb2, 0x7d, 0xcf, 0x9f, 0x5c, 0xba, 0x09, 0x8f, 0x65, + 0x4c, 0xb6, 0x02, 0x21, 0x83, 0xd8, 0xd5, 0x75, 0x37, 0xab, 0xdb, 0x3b, 0x97, 0x71, 0x7c, 0x19, + 0xa2, 0xa7, 0x30, 0xa3, 0xd9, 0xc4, 0x13, 0x92, 0xcf, 0x7c, 0xa9, 0x7b, 0xec, 0xdd, 0x15, 0xb6, + 0x39, 0x0b, 0x67, 0x38, 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c, 0xfa, 0xf1, 0x34, 0x09, 0x42, 0x1c, 0x0f, 0x65, 0xb6, 0x92, 0xf5, 0xe3, 0xfb, 0x97, + 0xae, 0xc2, 0x74, 0xf2, 0x5a, 0x61, 0xb0, 0x0d, 0xeb, 0x05, 0x4c, 0xab, 0x2b, 0x62, 0xe2, 0x41, + 0x33, 0x61, 0x9c, 0x4d, 0x85, 0x72, 0xb3, 0xdd, 0xdb, 0x76, 0xf5, 0x4b, 0xe5, 0xe6, 0x2f, 0x95, + 0xfb, 0x4e, 0xbd, 0x54, 0x34, 0x83, 0x39, 0xdf, 0x0c, 0x68, 0x1d, 0x66, 0xbb, 0x55, 0x89, 0xbb, + 0x07, 0x85, 0x80, 0x21, 0x1b, 0xb3, 0x44, 0x22, 0x2f, 0xb5, 0x6d, 0xe4, 0xa5, 0xbe, 0xae, 0xa4, + 0xbe, 0xe5, 0xa0, 0xcc, 0xb7, 0x2c, 0xbc, 0xb5, 0x30, 0xf2, 0x02, 0xc0, 0x8f, 0xa3, 0x08, 0xd5, + 0x07, 0x51, 0x86, 0xb6, 0x7b, 0xdd, 0xea, 0xbb, 0x71, 0x50, 0xe0, 0xe8, 0x52, 0x8f, 0x73, 0x17, + 0xa0, 0xac, 0x68, 0x69, 0x63, 0x8e, 0x42, 0x94, 0xd2, 0x54, 0xf8, 0xf2, 0xce, 0xc5, 0xff, 0x9a, + 0x36, 0x88, 0x3d, 0x96, 0x04, 0xde, 0xaf, 0xaf, 0xf7, 0xa8, 0xa9, 0x14, 0x3e, 0xf8, 0x19, 0x00, + 0x00, 0xff, 0xff, 0x09, 0xa6, 0x8b, 0x9b, 0x24, 0x06, 0x00, 0x00, } diff --git a/policy/v1beta1/istio.policy.v1beta1.pb.html b/policy/v1beta1/istio.policy.v1beta1.pb.html index 37c2253141f..623be9a244c 100644 --- a/policy/v1beta1/istio.policy.v1beta1.pb.html +++ b/policy/v1beta1/istio.policy.v1beta1.pb.html @@ -4,7 +4,7 @@ location: https://istio.io/docs/reference/config/policy-and-telemetry/istio.policy.v1beta1.html layout: protoc-gen-docs generator: protoc-gen-docs -number_of_entries: 15 +number_of_entries: 17 ---

Describes the rules used to configure Mixer’s policy and telemetry features.

@@ -47,6 +47,14 @@

Action

Referenced instances are evaluated by resolving the attributes/literals for all the fields. The constructed objects are then passed to the handler referenced within this action.

+ + + +name +string + +

Optional. A handle to refer to the results of the action.

+ @@ -559,6 +567,100 @@

Rule

Optional. The actions that will be executed when match evaluates to true.

+ + + +requestHeaderOperations +Rule.HeaderOperationTemplate[] + +

Optional. Templatized operations on the request headers using attributes produced by the +rule actions.

+ + + + +responseHeaderOperations +Rule.HeaderOperationTemplate[] + +

Optional. Templatized operations on the response headers using attributes produced by the +rule actions.

+ + + + + + +

Rule.HeaderOperationTemplate

+
+

A template for an HTTP header manipulation.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
namestring +

Required. Header name.

+ +
valuesstring[] +

Optional. Header values to replace or append.

+ +
operationRule.HeaderOperationTemplate.Operation +

Optional. Header operation type. Default operation is to replace the value of the header by name.

+ +
+
+

Rule.HeaderOperationTemplate.Operation

+
+

Header operation type.

+ + + + + + + + + + + + + + + + + + + + diff --git a/python/istio_api/policy/v1beta1/cfg_pb2.py b/python/istio_api/policy/v1beta1/cfg_pb2.py index ffbfcce79f9..52f8a082fd0 100644 --- a/python/istio_api/policy/v1beta1/cfg_pb2.py +++ b/python/istio_api/policy/v1beta1/cfg_pb2.py @@ -21,12 +21,38 @@ name='policy/v1beta1/cfg.proto', package='istio.policy.v1beta1', syntax='proto3', - serialized_pb=_b('\n\x18policy/v1beta1/cfg.proto\x12\x14istio.policy.v1beta1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fpolicy/v1beta1/value_type.proto\"\xc5\x02\n\x11\x41ttributeManifest\x12\x10\n\x08revision\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12K\n\nattributes\x18\x03 \x03(\x0b\x32\x37.istio.policy.v1beta1.AttributeManifest.AttributesEntry\x1aY\n\rAttributeInfo\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x33\n\nvalue_type\x18\x02 \x01(\x0e\x32\x1f.istio.policy.v1beta1.ValueType\x1ah\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x44\n\x05value\x18\x02 \x01(\x0b\x32\x35.istio.policy.v1beta1.AttributeManifest.AttributeInfo:\x02\x38\x01\"D\n\x04Rule\x12\r\n\x05match\x18\x01 \x01(\t\x12-\n\x07\x61\x63tions\x18\x02 \x03(\x0b\x32\x1c.istio.policy.v1beta1.Action\",\n\x06\x41\x63tion\x12\x0f\n\x07handler\x18\x02 \x01(\t\x12\x11\n\tinstances\x18\x03 \x03(\t\"q\n\x08Instance\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1c\n\x11\x63ompiled_template\x18\xf4\xed\xa9 \x01(\t\x12\x10\n\x08template\x18\x02 \x01(\t\x12\'\n\x06params\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\"\xa4\x01\n\x07Handler\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1b\n\x10\x63ompiled_adapter\x18\xf4\xed\xa9 \x01(\t\x12\x0f\n\x07\x61\x64\x61pter\x18\x02 \x01(\t\x12\'\n\x06params\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x34\n\nconnection\x18\x04 \x01(\x0b\x32 .istio.policy.v1beta1.Connection\"\x1d\n\nConnection\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x1dZ\x1bistio.io/api/policy/v1beta1b\x06proto3') + serialized_pb=_b('\n\x18policy/v1beta1/cfg.proto\x12\x14istio.policy.v1beta1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fpolicy/v1beta1/value_type.proto\"\xc5\x02\n\x11\x41ttributeManifest\x12\x10\n\x08revision\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12K\n\nattributes\x18\x03 \x03(\x0b\x32\x37.istio.policy.v1beta1.AttributeManifest.AttributesEntry\x1aY\n\rAttributeInfo\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x33\n\nvalue_type\x18\x02 \x01(\x0e\x32\x1f.istio.policy.v1beta1.ValueType\x1ah\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x44\n\x05value\x18\x02 \x01(\x0b\x32\x35.istio.policy.v1beta1.AttributeManifest.AttributeInfo:\x02\x38\x01\"\xb0\x03\n\x04Rule\x12\r\n\x05match\x18\x01 \x01(\t\x12-\n\x07\x61\x63tions\x18\x02 \x03(\x0b\x32\x1c.istio.policy.v1beta1.Action\x12U\n\x19request_header_operations\x18\x03 \x03(\x0b\x32\x32.istio.policy.v1beta1.Rule.HeaderOperationTemplate\x12V\n\x1aresponse_header_operations\x18\x04 \x03(\x0b\x32\x32.istio.policy.v1beta1.Rule.HeaderOperationTemplate\x1a\xba\x01\n\x17HeaderOperationTemplate\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06values\x18\x02 \x03(\t\x12O\n\toperation\x18\x03 \x01(\x0e\x32<.istio.policy.v1beta1.Rule.HeaderOperationTemplate.Operation\"0\n\tOperation\x12\x0b\n\x07REPLACE\x10\x00\x12\n\n\x06REMOVE\x10\x01\x12\n\n\x06\x41PPEND\x10\x02\":\n\x06\x41\x63tion\x12\x0f\n\x07handler\x18\x02 \x01(\t\x12\x11\n\tinstances\x18\x03 \x03(\t\x12\x0c\n\x04name\x18\x04 \x01(\t\"q\n\x08Instance\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1c\n\x11\x63ompiled_template\x18\xf4\xed\xa9 \x01(\t\x12\x10\n\x08template\x18\x02 \x01(\t\x12\'\n\x06params\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\"\xa4\x01\n\x07Handler\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1b\n\x10\x63ompiled_adapter\x18\xf4\xed\xa9 \x01(\t\x12\x0f\n\x07\x61\x64\x61pter\x18\x02 \x01(\t\x12\'\n\x06params\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x34\n\nconnection\x18\x04 \x01(\x0b\x32 .istio.policy.v1beta1.Connection\"\x1d\n\nConnection\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x1dZ\x1bistio.io/api/policy/v1beta1b\x06proto3') , dependencies=[google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,policy_dot_v1beta1_dot_value__type__pb2.DESCRIPTOR,]) +_RULE_HEADEROPERATIONTEMPLATE_OPERATION = _descriptor.EnumDescriptor( + name='Operation', + full_name='istio.policy.v1beta1.Rule.HeaderOperationTemplate.Operation', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='REPLACE', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='REMOVE', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='APPEND', index=2, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=826, + serialized_end=874, +) +_sym_db.RegisterEnumDescriptor(_RULE_HEADEROPERATIONTEMPLATE_OPERATION) + _ATTRIBUTEMANIFEST_ATTRIBUTEINFO = _descriptor.Descriptor( name='AttributeInfo', @@ -147,6 +173,51 @@ ) +_RULE_HEADEROPERATIONTEMPLATE = _descriptor.Descriptor( + name='HeaderOperationTemplate', + full_name='istio.policy.v1beta1.Rule.HeaderOperationTemplate', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='istio.policy.v1beta1.Rule.HeaderOperationTemplate.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='values', full_name='istio.policy.v1beta1.Rule.HeaderOperationTemplate.values', index=1, + number=2, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='operation', full_name='istio.policy.v1beta1.Rule.HeaderOperationTemplate.operation', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _RULE_HEADEROPERATIONTEMPLATE_OPERATION, + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=688, + serialized_end=874, +) + _RULE = _descriptor.Descriptor( name='Rule', full_name='istio.policy.v1beta1.Rule', @@ -168,10 +239,24 @@ message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='request_header_operations', full_name='istio.policy.v1beta1.Rule.request_header_operations', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='response_header_operations', full_name='istio.policy.v1beta1.Rule.response_header_operations', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), ], extensions=[ ], - nested_types=[], + nested_types=[_RULE_HEADEROPERATIONTEMPLATE, ], enum_types=[ ], options=None, @@ -180,8 +265,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=441, - serialized_end=509, + serialized_start=442, + serialized_end=874, ) @@ -206,6 +291,13 @@ message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='name', full_name='istio.policy.v1beta1.Action.name', index=2, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -218,8 +310,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=511, - serialized_end=555, + serialized_start=876, + serialized_end=934, ) @@ -270,8 +362,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=557, - serialized_end=670, + serialized_start=936, + serialized_end=1049, ) @@ -329,8 +421,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=673, - serialized_end=837, + serialized_start=1052, + serialized_end=1216, ) @@ -360,8 +452,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=839, - serialized_end=868, + serialized_start=1218, + serialized_end=1247, ) _ATTRIBUTEMANIFEST_ATTRIBUTEINFO.fields_by_name['value_type'].enum_type = policy_dot_v1beta1_dot_value__type__pb2._VALUETYPE @@ -369,7 +461,12 @@ _ATTRIBUTEMANIFEST_ATTRIBUTESENTRY.fields_by_name['value'].message_type = _ATTRIBUTEMANIFEST_ATTRIBUTEINFO _ATTRIBUTEMANIFEST_ATTRIBUTESENTRY.containing_type = _ATTRIBUTEMANIFEST _ATTRIBUTEMANIFEST.fields_by_name['attributes'].message_type = _ATTRIBUTEMANIFEST_ATTRIBUTESENTRY +_RULE_HEADEROPERATIONTEMPLATE.fields_by_name['operation'].enum_type = _RULE_HEADEROPERATIONTEMPLATE_OPERATION +_RULE_HEADEROPERATIONTEMPLATE.containing_type = _RULE +_RULE_HEADEROPERATIONTEMPLATE_OPERATION.containing_type = _RULE_HEADEROPERATIONTEMPLATE _RULE.fields_by_name['actions'].message_type = _ACTION +_RULE.fields_by_name['request_header_operations'].message_type = _RULE_HEADEROPERATIONTEMPLATE +_RULE.fields_by_name['response_header_operations'].message_type = _RULE_HEADEROPERATIONTEMPLATE _INSTANCE.fields_by_name['params'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT _HANDLER.fields_by_name['params'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT _HANDLER.fields_by_name['connection'].message_type = _CONNECTION @@ -405,11 +502,19 @@ _sym_db.RegisterMessage(AttributeManifest.AttributesEntry) Rule = _reflection.GeneratedProtocolMessageType('Rule', (_message.Message,), dict( + + HeaderOperationTemplate = _reflection.GeneratedProtocolMessageType('HeaderOperationTemplate', (_message.Message,), dict( + DESCRIPTOR = _RULE_HEADEROPERATIONTEMPLATE, + __module__ = 'policy.v1beta1.cfg_pb2' + # @@protoc_insertion_point(class_scope:istio.policy.v1beta1.Rule.HeaderOperationTemplate) + )) + , DESCRIPTOR = _RULE, __module__ = 'policy.v1beta1.cfg_pb2' # @@protoc_insertion_point(class_scope:istio.policy.v1beta1.Rule) )) _sym_db.RegisterMessage(Rule) +_sym_db.RegisterMessage(Rule.HeaderOperationTemplate) Action = _reflection.GeneratedProtocolMessageType('Action', (_message.Message,), dict( DESCRIPTOR = _ACTION,
NameDescription
REPLACE +

replaces the header with the given name

+ +
REMOVE +

removes the header with the given name (the value is ignored)

+ +
APPEND +

appends the values to the existing values (preserving existing values)

+