From 28094b9413e1112e34a43c47fb8d2e716eeeecfd Mon Sep 17 00:00:00 2001 From: Yanjun Xiang Date: Tue, 30 Jul 2024 03:12:19 +0000 Subject: [PATCH 1/6] Adding HTTP service support for Envoy external processing Signed-off-by: Yanjun Xiang --- .../filters/http/ext_proc/v3/ext_proc.proto | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto b/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto index aeaed7aa2ab7..cfbb2322b088 100644 --- a/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto +++ b/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto @@ -5,6 +5,7 @@ package envoy.extensions.filters.http.ext_proc.v3; import "envoy/config/common/mutation_rules/v3/mutation_rules.proto"; import "envoy/config/core/v3/base.proto"; import "envoy/config/core/v3/grpc_service.proto"; +import "envoy/config/core/v3/http_uri.proto"; import "envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto"; import "envoy/type/matcher/v3/string.proto"; @@ -98,7 +99,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // ` object in a namespace matching the filter // name. // -// [#next-free-field: 20] +// [#next-free-field: 21] message ExternalProcessor { // Describes the route cache action to be taken when an external processor response // is received in response to request headers. @@ -125,7 +126,20 @@ message ExternalProcessor { // Configuration for the gRPC service that the filter will communicate with. // The filter supports both the "Envoy" and "Google" gRPC clients. - config.core.v3.GrpcService grpc_service = 1 [(validate.rules).message = {required: true}]; + // Only one of ``grpc_service`` or + // :ref:`http_service `. + // can be set. It is required that one of them must be set. + config.core.v3.GrpcService grpc_service = 1 [ + (udpa.annotations.field_migrate).oneof_promotion = "ext_proc_service_type" + ]; + + // Configuration for the HTTP service that the filter will communicate with. + // Only one of ``http_service`` or + // :ref:`grpc_service `. + // can be set. It is required that one of them must be set. + HttpService http_service = 20 [ + (udpa.annotations.field_migrate).oneof_promotion = "ext_proc_service_type" + ]; // By default, if the gRPC stream cannot be established, or if it is closed // prematurely with an error, the filter will fail. Specifically, if the @@ -265,6 +279,12 @@ message ExternalProcessor { google.protobuf.Duration deferred_close_timeout = 19; } +// HttpService is used for raw HTTP communication between the filter and the external processing service. +message HttpService { + // Sets the HTTP server URI which the external processing requests must be sent to. + config.core.v3.HttpUri server_uri = 1; +} + // The MetadataOptions structure defines options for the sending and receiving of // dynamic metadata. Specifically, which namespaces to send to the server, whether // metadata returned by the server may be written, and how that metadata may be written. From b0c22716cb177aaf8f17cade7d5f8ee0f533e7ea Mon Sep 17 00:00:00 2001 From: Yanjun Xiang Date: Tue, 30 Jul 2024 03:22:11 +0000 Subject: [PATCH 2/6] adding not-implemented-hide Signed-off-by: Yanjun Xiang --- api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto b/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto index cfbb2322b088..e9932a6b7e3c 100644 --- a/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto +++ b/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto @@ -133,6 +133,7 @@ message ExternalProcessor { (udpa.annotations.field_migrate).oneof_promotion = "ext_proc_service_type" ]; + // [#not-implemented-hide:] // Configuration for the HTTP service that the filter will communicate with. // Only one of ``http_service`` or // :ref:`grpc_service `. From 592c1e182e0499281657efeeae3b3d6215af92f3 Mon Sep 17 00:00:00 2001 From: Yanjun Xiang Date: Tue, 30 Jul 2024 16:59:39 +0000 Subject: [PATCH 3/6] addressing comments Signed-off-by: Yanjun Xiang --- .../filters/http/ext_proc/v3/ext_proc.proto | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto b/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto index e9932a6b7e3c..322d3415b6ce 100644 --- a/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto +++ b/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto @@ -5,7 +5,7 @@ package envoy.extensions.filters.http.ext_proc.v3; import "envoy/config/common/mutation_rules/v3/mutation_rules.proto"; import "envoy/config/core/v3/base.proto"; import "envoy/config/core/v3/grpc_service.proto"; -import "envoy/config/core/v3/http_uri.proto"; +import "envoy/config/core/v3/http_service.proto"; import "envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto"; import "envoy/type/matcher/v3/string.proto"; @@ -126,9 +126,8 @@ message ExternalProcessor { // Configuration for the gRPC service that the filter will communicate with. // The filter supports both the "Envoy" and "Google" gRPC clients. - // Only one of ``grpc_service`` or - // :ref:`http_service `. - // can be set. It is required that one of them must be set. + // Only one of ``grpc_service`` or ``http_service`` can be set. + // It is required that one of them must be set. config.core.v3.GrpcService grpc_service = 1 [ (udpa.annotations.field_migrate).oneof_promotion = "ext_proc_service_type" ]; @@ -138,7 +137,7 @@ message ExternalProcessor { // Only one of ``http_service`` or // :ref:`grpc_service `. // can be set. It is required that one of them must be set. - HttpService http_service = 20 [ + ExtProcHttpService http_service = 20 [ (udpa.annotations.field_migrate).oneof_promotion = "ext_proc_service_type" ]; @@ -280,10 +279,10 @@ message ExternalProcessor { google.protobuf.Duration deferred_close_timeout = 19; } -// HttpService is used for raw HTTP communication between the filter and the external processing service. -message HttpService { +// ExtProcHttpService is used for raw HTTP communication between the filter and the external processing service. +message ExtProcHttpService { // Sets the HTTP server URI which the external processing requests must be sent to. - config.core.v3.HttpUri server_uri = 1; + config.core.v3.HttpService server_uri = 1; } // The MetadataOptions structure defines options for the sending and receiving of From e22aa8c57ce5c818fa47a88653efb361501cff12 Mon Sep 17 00:00:00 2001 From: Yanjun Xiang Date: Tue, 30 Jul 2024 17:06:31 +0000 Subject: [PATCH 4/6] change the proto field name Signed-off-by: Yanjun Xiang --- api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto b/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto index 322d3415b6ce..152710b954e3 100644 --- a/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto +++ b/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto @@ -281,8 +281,8 @@ message ExternalProcessor { // ExtProcHttpService is used for raw HTTP communication between the filter and the external processing service. message ExtProcHttpService { - // Sets the HTTP server URI which the external processing requests must be sent to. - config.core.v3.HttpService server_uri = 1; + // Sets the HTTP service which the external processing requests must be sent to. + config.core.v3.HttpService http_service = 1; } // The MetadataOptions structure defines options for the sending and receiving of From a01725990c8a4ef54842848cea3ffbd7f1ebfed8 Mon Sep 17 00:00:00 2001 From: Yanjun Xiang Date: Tue, 30 Jul 2024 17:24:20 +0000 Subject: [PATCH 5/6] fix format error Signed-off-by: Yanjun Xiang --- .../extensions/filters/http/ext_proc/v3/ext_proc.proto | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto b/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto index 152710b954e3..05feebca216b 100644 --- a/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto +++ b/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto @@ -128,18 +128,16 @@ message ExternalProcessor { // The filter supports both the "Envoy" and "Google" gRPC clients. // Only one of ``grpc_service`` or ``http_service`` can be set. // It is required that one of them must be set. - config.core.v3.GrpcService grpc_service = 1 [ - (udpa.annotations.field_migrate).oneof_promotion = "ext_proc_service_type" - ]; + config.core.v3.GrpcService grpc_service = 1 + [(udpa.annotations.field_migrate).oneof_promotion = "ext_proc_service_type"]; // [#not-implemented-hide:] // Configuration for the HTTP service that the filter will communicate with. // Only one of ``http_service`` or // :ref:`grpc_service `. // can be set. It is required that one of them must be set. - ExtProcHttpService http_service = 20 [ - (udpa.annotations.field_migrate).oneof_promotion = "ext_proc_service_type" - ]; + ExtProcHttpService http_service = 20 + [(udpa.annotations.field_migrate).oneof_promotion = "ext_proc_service_type"]; // By default, if the gRPC stream cannot be established, or if it is closed // prematurely with an error, the filter will fail. Specifically, if the From 7e0a57804243114574539d2d9b057589999be3f2 Mon Sep 17 00:00:00 2001 From: Yanjun Xiang Date: Wed, 31 Jul 2024 16:00:39 +0000 Subject: [PATCH 6/6] addressing comments Signed-off-by: Yanjun Xiang --- api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto b/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto index 05feebca216b..1d79d39d99b8 100644 --- a/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto +++ b/api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto @@ -277,7 +277,7 @@ message ExternalProcessor { google.protobuf.Duration deferred_close_timeout = 19; } -// ExtProcHttpService is used for raw HTTP communication between the filter and the external processing service. +// ExtProcHttpService is used for HTTP communication between the filter and the external processing service. message ExtProcHttpService { // Sets the HTTP service which the external processing requests must be sent to. config.core.v3.HttpService http_service = 1;