diff --git a/extensions/v1alpha1/wasm.pb.go b/extensions/v1alpha1/wasm.pb.go index 43f375c777f..d5a8b27d902 100644 --- a/extensions/v1alpha1/wasm.pb.go +++ b/extensions/v1alpha1/wasm.pb.go @@ -224,6 +224,67 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// PluginType indicates the type of Wasm Extension to be used. +// There are two types of Extensions: `HTTP` and `NETWORK`. +// HTTP Extension work at "Layer 7"(for example as an HTTP filters in Envoy). +// The detailed HTTP interface for can be found at [C++] (https://github.com/proxy-wasm/proxy-wasm-cpp-host/blob/b7e690703c7f26707438a2f1ebd7c197bc8f0296/include/proxy-wasm/context_interface.h#L199) +// and [Rust] (https://github.com/proxy-wasm/proxy-wasm-rust-sdk/blob/6b47aec926bc29971c727471d6f4c972ec407c7f/src/traits.rs#L309). +// NETWORK Extension work at "Layer 4"(for example, as a network filter in Envoy). +// The detailed NETWORK interface for can be found at [C++] (https://github.com/proxy-wasm/proxy-wasm-cpp-host/blob/b7e690703c7f26707438a2f1ebd7c197bc8f0296/include/proxy-wasm/context_interface.h#L257) +// and [Rust] (https://github.com/proxy-wasm/proxy-wasm-rust-sdk/blob/6b47aec926bc29971c727471d6f4c972ec407c7f/src/traits.rs#L257). +// The NETWORK Extension can be applied to HTTP traffic as well. +type PluginType int32 + +const ( + // Defaults to HTTP. + PluginType_UNSPECIFIED_PLUGIN_TYPE PluginType = 0 + // Use HTTP Wasm Extension. + PluginType_HTTP PluginType = 1 + // Use Network Wasm Extension. + PluginType_NETWORK PluginType = 2 +) + +// Enum value maps for PluginType. +var ( + PluginType_name = map[int32]string{ + 0: "UNSPECIFIED_PLUGIN_TYPE", + 1: "HTTP", + 2: "NETWORK", + } + PluginType_value = map[string]int32{ + "UNSPECIFIED_PLUGIN_TYPE": 0, + "HTTP": 1, + "NETWORK": 2, + } +) + +func (x PluginType) Enum() *PluginType { + p := new(PluginType) + *p = x + return p +} + +func (x PluginType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PluginType) Descriptor() protoreflect.EnumDescriptor { + return file_extensions_v1alpha1_wasm_proto_enumTypes[0].Descriptor() +} + +func (PluginType) Type() protoreflect.EnumType { + return &file_extensions_v1alpha1_wasm_proto_enumTypes[0] +} + +func (x PluginType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PluginType.Descriptor instead. +func (PluginType) EnumDescriptor() ([]byte, []int) { + return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{0} +} + // The phase in the filter chain where the plugin will be injected. type PluginPhase int32 @@ -267,11 +328,11 @@ func (x PluginPhase) String() string { } func (PluginPhase) Descriptor() protoreflect.EnumDescriptor { - return file_extensions_v1alpha1_wasm_proto_enumTypes[0].Descriptor() + return file_extensions_v1alpha1_wasm_proto_enumTypes[1].Descriptor() } func (PluginPhase) Type() protoreflect.EnumType { - return &file_extensions_v1alpha1_wasm_proto_enumTypes[0] + return &file_extensions_v1alpha1_wasm_proto_enumTypes[1] } func (x PluginPhase) Number() protoreflect.EnumNumber { @@ -280,7 +341,7 @@ func (x PluginPhase) Number() protoreflect.EnumNumber { // Deprecated: Use PluginPhase.Descriptor instead. func (PluginPhase) EnumDescriptor() ([]byte, []int) { - return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{0} + return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{1} } // The pull behaviour to be applied when fetching a Wam module, @@ -329,11 +390,11 @@ func (x PullPolicy) String() string { } func (PullPolicy) Descriptor() protoreflect.EnumDescriptor { - return file_extensions_v1alpha1_wasm_proto_enumTypes[1].Descriptor() + return file_extensions_v1alpha1_wasm_proto_enumTypes[2].Descriptor() } func (PullPolicy) Type() protoreflect.EnumType { - return &file_extensions_v1alpha1_wasm_proto_enumTypes[1] + return &file_extensions_v1alpha1_wasm_proto_enumTypes[2] } func (x PullPolicy) Number() protoreflect.EnumNumber { @@ -342,7 +403,7 @@ func (x PullPolicy) Number() protoreflect.EnumNumber { // Deprecated: Use PullPolicy.Descriptor instead. func (PullPolicy) EnumDescriptor() ([]byte, []int) { - return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{1} + return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{2} } type EnvValueSource int32 @@ -377,11 +438,11 @@ func (x EnvValueSource) String() string { } func (EnvValueSource) Descriptor() protoreflect.EnumDescriptor { - return file_extensions_v1alpha1_wasm_proto_enumTypes[2].Descriptor() + return file_extensions_v1alpha1_wasm_proto_enumTypes[3].Descriptor() } func (EnvValueSource) Type() protoreflect.EnumType { - return &file_extensions_v1alpha1_wasm_proto_enumTypes[2] + return &file_extensions_v1alpha1_wasm_proto_enumTypes[3] } func (x EnvValueSource) Number() protoreflect.EnumNumber { @@ -390,7 +451,7 @@ func (x EnvValueSource) Number() protoreflect.EnumNumber { // Deprecated: Use EnvValueSource.Descriptor instead. func (EnvValueSource) EnumDescriptor() ([]byte, []int) { - return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{2} + return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{3} } type FailStrategy int32 @@ -429,11 +490,11 @@ func (x FailStrategy) String() string { } func (FailStrategy) Descriptor() protoreflect.EnumDescriptor { - return file_extensions_v1alpha1_wasm_proto_enumTypes[3].Descriptor() + return file_extensions_v1alpha1_wasm_proto_enumTypes[4].Descriptor() } func (FailStrategy) Type() protoreflect.EnumType { - return &file_extensions_v1alpha1_wasm_proto_enumTypes[3] + return &file_extensions_v1alpha1_wasm_proto_enumTypes[4] } func (x FailStrategy) Number() protoreflect.EnumNumber { @@ -442,7 +503,7 @@ func (x FailStrategy) Number() protoreflect.EnumNumber { // Deprecated: Use FailStrategy.Descriptor instead. func (FailStrategy) EnumDescriptor() ([]byte, []int) { - return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{3} + return file_extensions_v1alpha1_wasm_proto_rawDescGZIP(), []int{4} } // WasmPlugins provides a mechanism to extend the functionality provided by @@ -551,6 +612,8 @@ type WasmPlugin struct { // If a traffic satisfies any of TrafficSelectors, // the traffic passes the WasmPlugin. Match []*WasmPlugin_TrafficSelector `protobuf:"bytes,12,rep,name=match,proto3" json:"match,omitempty"` + // Specifies the type of Wasm Extension to be used. + Type PluginType `protobuf:"varint,14,opt,name=type,proto3,enum=istio.extensions.v1alpha1.PluginType" json:"type,omitempty"` } func (x *WasmPlugin) Reset() { @@ -676,6 +739,13 @@ func (x *WasmPlugin) GetMatch() []*WasmPlugin_TrafficSelector { return nil } +func (x *WasmPlugin) GetType() PluginType { + if x != nil { + return x.Type + } + return PluginType_UNSPECIFIED_PLUGIN_TYPE +} + // Configuration for a Wasm VM. // more details can be found [here](https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/wasm/v3/wasm.proto#extensions-wasm-v3-vmconfig). type VmConfig struct { @@ -880,7 +950,7 @@ var file_extensions_v1alpha1_wasm_proto_rawDesc = []byte{ 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, 0x1b, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6, 0x06, 0x0a, 0x0a, 0x57, 0x61, 0x73, 0x6d, 0x50, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x91, 0x07, 0x0a, 0x0a, 0x57, 0x61, 0x73, 0x6d, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x40, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x69, 0x73, 0x74, 0x69, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x57, 0x6f, 0x72, @@ -925,44 +995,52 @@ var file_extensions_v1alpha1_wasm_proto_rawDesc = []byte{ 0x32, 0x35, 0x2e, 0x69, 0x73, 0x74, 0x69, 0x6f, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x57, 0x61, 0x73, 0x6d, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x53, - 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x1a, 0x7f, - 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x12, 0x34, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x20, 0x2e, 0x69, 0x73, 0x74, 0x69, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x64, - 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x69, 0x73, 0x74, 0x69, 0x6f, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x72, 0x74, - 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x22, - 0x3f, 0x0a, 0x08, 0x56, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x33, 0x0a, 0x03, 0x65, - 0x6e, 0x76, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x69, 0x73, 0x74, 0x69, 0x6f, - 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x52, 0x03, 0x65, 0x6e, 0x76, - 0x22, 0x7c, 0x0a, 0x06, 0x45, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x48, - 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x69, 0x73, 0x74, 0x69, 0x6f, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, - 0x6e, 0x76, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0x45, - 0x0a, 0x0b, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x50, 0x68, 0x61, 0x73, 0x65, 0x12, 0x15, 0x0a, - 0x11, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x50, 0x48, 0x41, - 0x53, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x55, 0x54, 0x48, 0x4e, 0x10, 0x01, 0x12, - 0x09, 0x0a, 0x05, 0x41, 0x55, 0x54, 0x48, 0x5a, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x54, - 0x41, 0x54, 0x53, 0x10, 0x03, 0x2a, 0x42, 0x0a, 0x0a, 0x50, 0x75, 0x6c, 0x6c, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x12, 0x16, 0x0a, 0x12, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x49, - 0x66, 0x4e, 0x6f, 0x74, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x10, 0x01, 0x12, 0x0a, 0x0a, - 0x06, 0x41, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x10, 0x02, 0x2a, 0x26, 0x0a, 0x0e, 0x45, 0x6e, 0x76, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x49, - 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4f, 0x53, 0x54, 0x10, - 0x01, 0x2a, 0x2d, 0x0a, 0x0c, 0x46, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, - 0x79, 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x41, 0x49, 0x4c, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x10, - 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x41, 0x49, 0x4c, 0x5f, 0x4f, 0x50, 0x45, 0x4e, 0x10, 0x01, - 0x42, 0x22, 0x5a, 0x20, 0x69, 0x73, 0x74, 0x69, 0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x39, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x69, + 0x73, 0x74, 0x69, 0x6f, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x1a, 0x7f, 0x0a, 0x0f, 0x54, 0x72, 0x61, + 0x66, 0x66, 0x69, 0x63, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x34, 0x0a, 0x04, + 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x69, 0x73, 0x74, + 0x69, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, + 0x64, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x69, 0x73, 0x74, 0x69, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x52, 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x22, 0x3f, 0x0a, 0x08, 0x56, 0x6d, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x33, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x69, 0x73, 0x74, 0x69, 0x6f, 0x2e, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x45, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x22, 0x7c, 0x0a, 0x06, 0x45, + 0x6e, 0x76, 0x56, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x0a, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, + 0x69, 0x73, 0x74, 0x69, 0x6f, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6e, 0x76, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x46, + 0x72, 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0x40, 0x0a, 0x0a, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x10, 0x01, 0x12, 0x0b, + 0x0a, 0x07, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x10, 0x02, 0x2a, 0x45, 0x0a, 0x0b, 0x50, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x50, 0x68, 0x61, 0x73, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x50, 0x48, 0x41, 0x53, 0x45, 0x10, + 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x55, 0x54, 0x48, 0x4e, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, + 0x41, 0x55, 0x54, 0x48, 0x5a, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x54, 0x41, 0x54, 0x53, + 0x10, 0x03, 0x2a, 0x42, 0x0a, 0x0a, 0x50, 0x75, 0x6c, 0x6c, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x12, 0x16, 0x0a, 0x12, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, + 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x49, 0x66, 0x4e, 0x6f, + 0x74, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x6c, + 0x77, 0x61, 0x79, 0x73, 0x10, 0x02, 0x2a, 0x26, 0x0a, 0x0e, 0x45, 0x6e, 0x76, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x49, 0x4e, 0x4c, 0x49, + 0x4e, 0x45, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4f, 0x53, 0x54, 0x10, 0x01, 0x2a, 0x2d, + 0x0a, 0x0c, 0x46, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x0e, + 0x0a, 0x0a, 0x46, 0x41, 0x49, 0x4c, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x10, 0x00, 0x12, 0x0d, + 0x0a, 0x09, 0x46, 0x41, 0x49, 0x4c, 0x5f, 0x4f, 0x50, 0x45, 0x4e, 0x10, 0x01, 0x42, 0x22, 0x5a, + 0x20, 0x69, 0x73, 0x74, 0x69, 0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -977,41 +1055,43 @@ func file_extensions_v1alpha1_wasm_proto_rawDescGZIP() []byte { return file_extensions_v1alpha1_wasm_proto_rawDescData } -var file_extensions_v1alpha1_wasm_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_extensions_v1alpha1_wasm_proto_enumTypes = make([]protoimpl.EnumInfo, 5) var file_extensions_v1alpha1_wasm_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_extensions_v1alpha1_wasm_proto_goTypes = []interface{}{ - (PluginPhase)(0), // 0: istio.extensions.v1alpha1.PluginPhase - (PullPolicy)(0), // 1: istio.extensions.v1alpha1.PullPolicy - (EnvValueSource)(0), // 2: istio.extensions.v1alpha1.EnvValueSource - (FailStrategy)(0), // 3: istio.extensions.v1alpha1.FailStrategy - (*WasmPlugin)(nil), // 4: istio.extensions.v1alpha1.WasmPlugin - (*VmConfig)(nil), // 5: istio.extensions.v1alpha1.VmConfig - (*EnvVar)(nil), // 6: istio.extensions.v1alpha1.EnvVar - (*WasmPlugin_TrafficSelector)(nil), // 7: istio.extensions.v1alpha1.WasmPlugin.TrafficSelector - (*v1beta1.WorkloadSelector)(nil), // 8: istio.type.v1beta1.WorkloadSelector - (*_struct.Struct)(nil), // 9: google.protobuf.Struct - (*wrappers.Int32Value)(nil), // 10: google.protobuf.Int32Value - (v1beta1.WorkloadMode)(0), // 11: istio.type.v1beta1.WorkloadMode - (*v1beta1.PortSelector)(nil), // 12: istio.type.v1beta1.PortSelector + (PluginType)(0), // 0: istio.extensions.v1alpha1.PluginType + (PluginPhase)(0), // 1: istio.extensions.v1alpha1.PluginPhase + (PullPolicy)(0), // 2: istio.extensions.v1alpha1.PullPolicy + (EnvValueSource)(0), // 3: istio.extensions.v1alpha1.EnvValueSource + (FailStrategy)(0), // 4: istio.extensions.v1alpha1.FailStrategy + (*WasmPlugin)(nil), // 5: istio.extensions.v1alpha1.WasmPlugin + (*VmConfig)(nil), // 6: istio.extensions.v1alpha1.VmConfig + (*EnvVar)(nil), // 7: istio.extensions.v1alpha1.EnvVar + (*WasmPlugin_TrafficSelector)(nil), // 8: istio.extensions.v1alpha1.WasmPlugin.TrafficSelector + (*v1beta1.WorkloadSelector)(nil), // 9: istio.type.v1beta1.WorkloadSelector + (*_struct.Struct)(nil), // 10: google.protobuf.Struct + (*wrappers.Int32Value)(nil), // 11: google.protobuf.Int32Value + (v1beta1.WorkloadMode)(0), // 12: istio.type.v1beta1.WorkloadMode + (*v1beta1.PortSelector)(nil), // 13: istio.type.v1beta1.PortSelector } var file_extensions_v1alpha1_wasm_proto_depIdxs = []int32{ - 8, // 0: istio.extensions.v1alpha1.WasmPlugin.selector:type_name -> istio.type.v1beta1.WorkloadSelector - 1, // 1: istio.extensions.v1alpha1.WasmPlugin.image_pull_policy:type_name -> istio.extensions.v1alpha1.PullPolicy - 9, // 2: istio.extensions.v1alpha1.WasmPlugin.plugin_config:type_name -> google.protobuf.Struct - 0, // 3: istio.extensions.v1alpha1.WasmPlugin.phase:type_name -> istio.extensions.v1alpha1.PluginPhase - 10, // 4: istio.extensions.v1alpha1.WasmPlugin.priority:type_name -> google.protobuf.Int32Value - 3, // 5: istio.extensions.v1alpha1.WasmPlugin.fail_strategy:type_name -> istio.extensions.v1alpha1.FailStrategy - 5, // 6: istio.extensions.v1alpha1.WasmPlugin.vm_config:type_name -> istio.extensions.v1alpha1.VmConfig - 7, // 7: istio.extensions.v1alpha1.WasmPlugin.match:type_name -> istio.extensions.v1alpha1.WasmPlugin.TrafficSelector - 6, // 8: istio.extensions.v1alpha1.VmConfig.env:type_name -> istio.extensions.v1alpha1.EnvVar - 2, // 9: istio.extensions.v1alpha1.EnvVar.value_from:type_name -> istio.extensions.v1alpha1.EnvValueSource - 11, // 10: istio.extensions.v1alpha1.WasmPlugin.TrafficSelector.mode:type_name -> istio.type.v1beta1.WorkloadMode - 12, // 11: istio.extensions.v1alpha1.WasmPlugin.TrafficSelector.ports:type_name -> istio.type.v1beta1.PortSelector - 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 + 9, // 0: istio.extensions.v1alpha1.WasmPlugin.selector:type_name -> istio.type.v1beta1.WorkloadSelector + 2, // 1: istio.extensions.v1alpha1.WasmPlugin.image_pull_policy:type_name -> istio.extensions.v1alpha1.PullPolicy + 10, // 2: istio.extensions.v1alpha1.WasmPlugin.plugin_config:type_name -> google.protobuf.Struct + 1, // 3: istio.extensions.v1alpha1.WasmPlugin.phase:type_name -> istio.extensions.v1alpha1.PluginPhase + 11, // 4: istio.extensions.v1alpha1.WasmPlugin.priority:type_name -> google.protobuf.Int32Value + 4, // 5: istio.extensions.v1alpha1.WasmPlugin.fail_strategy:type_name -> istio.extensions.v1alpha1.FailStrategy + 6, // 6: istio.extensions.v1alpha1.WasmPlugin.vm_config:type_name -> istio.extensions.v1alpha1.VmConfig + 8, // 7: istio.extensions.v1alpha1.WasmPlugin.match:type_name -> istio.extensions.v1alpha1.WasmPlugin.TrafficSelector + 0, // 8: istio.extensions.v1alpha1.WasmPlugin.type:type_name -> istio.extensions.v1alpha1.PluginType + 7, // 9: istio.extensions.v1alpha1.VmConfig.env:type_name -> istio.extensions.v1alpha1.EnvVar + 3, // 10: istio.extensions.v1alpha1.EnvVar.value_from:type_name -> istio.extensions.v1alpha1.EnvValueSource + 12, // 11: istio.extensions.v1alpha1.WasmPlugin.TrafficSelector.mode:type_name -> istio.type.v1beta1.WorkloadMode + 13, // 12: istio.extensions.v1alpha1.WasmPlugin.TrafficSelector.ports:type_name -> istio.type.v1beta1.PortSelector + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_extensions_v1alpha1_wasm_proto_init() } @@ -1074,7 +1154,7 @@ func file_extensions_v1alpha1_wasm_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_extensions_v1alpha1_wasm_proto_rawDesc, - NumEnums: 4, + NumEnums: 5, NumMessages: 4, NumExtensions: 0, NumServices: 0, diff --git a/extensions/v1alpha1/wasm.pb.html b/extensions/v1alpha1/wasm.pb.html index 6995204fb38..f92b2bd9694 100644 --- a/extensions/v1alpha1/wasm.pb.html +++ b/extensions/v1alpha1/wasm.pb.html @@ -6,7 +6,7 @@ generator: protoc-gen-docs schema: istio.extensions.v1alpha1.WasmPlugin aliases: [/docs/reference/config/extensions/v1alpha1/wasm-plugin] -number_of_entries: 8 +number_of_entries: 9 ---

WasmPlugins provides a mechanism to extend the functionality provided by the Istio proxy through WebAssembly filters.

@@ -340,6 +340,17 @@

WasmPlugin

If a traffic satisfies any of TrafficSelectors, the traffic passes the WasmPlugin.

+ + +No + + + +type +PluginType + +

Specifies the type of Wasm Extension to be used.

+ No @@ -476,6 +487,50 @@

WasmPlugin.TrafficSelector

No + + + + + +

PluginType

+
+

PluginType indicates the type of Wasm Extension to be used. +There are two types of Extensions: HTTP and NETWORK. +HTTP Extension work at “Layer 7”(for example as an HTTP filters in Envoy). +The detailed HTTP interface for can be found at [C++] (https://github.com/proxy-wasm/proxy-wasm-cpp-host/blob/b7e690703c7f26707438a2f1ebd7c197bc8f0296/include/proxy-wasm/context_interface.h#L199) +and [Rust] (https://github.com/proxy-wasm/proxy-wasm-rust-sdk/blob/6b47aec926bc29971c727471d6f4c972ec407c7f/src/traits.rs#L309). +NETWORK Extension work at “Layer 4”(for example, as a network filter in Envoy). +The detailed NETWORK interface for can be found at [C++] (https://github.com/proxy-wasm/proxy-wasm-cpp-host/blob/b7e690703c7f26707438a2f1ebd7c197bc8f0296/include/proxy-wasm/context_interface.h#L257) +and [Rust] (https://github.com/proxy-wasm/proxy-wasm-rust-sdk/blob/6b47aec926bc29971c727471d6f4c972ec407c7f/src/traits.rs#L257). +The NETWORK Extension can be applied to HTTP traffic as well.

+ + + + + + + + + + + + + + + + + + + + diff --git a/extensions/v1alpha1/wasm.proto b/extensions/v1alpha1/wasm.proto index 5b488d19a58..8b54b67e58a 100644 --- a/extensions/v1alpha1/wasm.proto +++ b/extensions/v1alpha1/wasm.proto @@ -344,6 +344,30 @@ message WasmPlugin { // If a traffic satisfies any of TrafficSelectors, // the traffic passes the WasmPlugin. repeated TrafficSelector match = 12; + + // Specifies the type of Wasm Extension to be used. + PluginType type = 14; +} + + +// PluginType indicates the type of Wasm Extension to be used. +// There are two types of Extensions: `HTTP` and `NETWORK`. +// HTTP Extension work at "Layer 7"(for example as an HTTP filters in Envoy). +// The detailed HTTP interface for can be found at [C++] (https://github.com/proxy-wasm/proxy-wasm-cpp-host/blob/b7e690703c7f26707438a2f1ebd7c197bc8f0296/include/proxy-wasm/context_interface.h#L199) +// and [Rust] (https://github.com/proxy-wasm/proxy-wasm-rust-sdk/blob/6b47aec926bc29971c727471d6f4c972ec407c7f/src/traits.rs#L309). +// NETWORK Extension work at "Layer 4"(for example, as a network filter in Envoy). +// The detailed NETWORK interface for can be found at [C++] (https://github.com/proxy-wasm/proxy-wasm-cpp-host/blob/b7e690703c7f26707438a2f1ebd7c197bc8f0296/include/proxy-wasm/context_interface.h#L257) +// and [Rust] (https://github.com/proxy-wasm/proxy-wasm-rust-sdk/blob/6b47aec926bc29971c727471d6f4c972ec407c7f/src/traits.rs#L257). +// The NETWORK Extension can be applied to HTTP traffic as well. +enum PluginType { + // Defaults to HTTP. + UNSPECIFIED_PLUGIN_TYPE = 0; + + // Use HTTP Wasm Extension. + HTTP = 1; + + // Use Network Wasm Extension. + NETWORK = 2; } // The phase in the filter chain where the plugin will be injected. diff --git a/kubernetes/customresourcedefinitions.gen.yaml b/kubernetes/customresourcedefinitions.gen.yaml index 83ce5c725e2..5444b539043 100644 --- a/kubernetes/customresourcedefinitions.gen.yaml +++ b/kubernetes/customresourcedefinitions.gen.yaml @@ -109,6 +109,13 @@ spec: description: SHA256 checksum that will be used to verify Wasm module or OCI container. type: string + type: + description: Specifies the type of Wasm Extension to be used. + enum: + - UNSPECIFIED_PLUGIN_TYPE + - HTTP + - NETWORK + type: string url: description: URL of a Wasm module or OCI container. type: string diff --git a/proto.lock b/proto.lock index 6741f3a57db..edb146d7da2 100644 --- a/proto.lock +++ b/proto.lock @@ -36453,6 +36453,22 @@ "protopath": "extensions:/:v1alpha1:/:wasm.proto", "def": { "enums": [ + { + "name": "PluginType", + "enum_fields": [ + { + "name": "UNSPECIFIED_PLUGIN_TYPE" + }, + { + "name": "HTTP", + "integer": 1 + }, + { + "name": "NETWORK", + "integer": 2 + } + ] + }, { "name": "PluginPhase", "enum_fields": [ @@ -36583,6 +36599,11 @@ "name": "match", "type": "TrafficSelector", "is_repeated": true + }, + { + "id": 14, + "name": "type", + "type": "PluginType" } ], "messages": [
NameDescription
UNSPECIFIED_PLUGIN_TYPE +

Defaults to HTTP.

+ +
HTTP +

Use HTTP Wasm Extension.

+ +
NETWORK +

Use Network Wasm Extension.

+