diff --git a/BUILD b/BUILD index 17520935..9edcd4e6 100644 --- a/BUILD +++ b/BUILD @@ -31,6 +31,7 @@ proto_library( "//envoy/config/filter/http/aws_request_signing/v2alpha:pkg", "//envoy/config/filter/http/buffer/v2:pkg", "//envoy/config/filter/http/cache/v2alpha:pkg", + "//envoy/config/filter/http/compressor/v2:pkg", "//envoy/config/filter/http/cors/v2:pkg", "//envoy/config/filter/http/csrf/v2:pkg", "//envoy/config/filter/http/dynamic_forward_proxy/v2alpha:pkg", @@ -161,6 +162,7 @@ proto_library( "//envoy/extensions/filters/http/aws_request_signing/v3:pkg", "//envoy/extensions/filters/http/buffer/v3:pkg", "//envoy/extensions/filters/http/cache/v3alpha:pkg", + "//envoy/extensions/filters/http/compressor/v3:pkg", "//envoy/extensions/filters/http/cors/v3:pkg", "//envoy/extensions/filters/http/csrf/v3:pkg", "//envoy/extensions/filters/http/dynamic_forward_proxy/v3:pkg", diff --git a/docs/BUILD b/docs/BUILD index da6e0524..b929f06b 100644 --- a/docs/BUILD +++ b/docs/BUILD @@ -37,6 +37,7 @@ proto_library( "//envoy/config/filter/http/aws_request_signing/v2alpha:pkg", "//envoy/config/filter/http/buffer/v2:pkg", "//envoy/config/filter/http/cache/v2alpha:pkg", + "//envoy/config/filter/http/compressor/v2:pkg", "//envoy/config/filter/http/cors/v2:pkg", "//envoy/config/filter/http/csrf/v2:pkg", "//envoy/config/filter/http/dynamic_forward_proxy/v2alpha:pkg", diff --git a/envoy/config/filter/http/compressor/v2/BUILD b/envoy/config/filter/http/compressor/v2/BUILD new file mode 100644 index 00000000..69168ad0 --- /dev/null +++ b/envoy/config/filter/http/compressor/v2/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/api/v2/core:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/envoy/config/filter/http/compressor/v2/compressor.proto b/envoy/config/filter/http/compressor/v2/compressor.proto new file mode 100644 index 00000000..54814f98 --- /dev/null +++ b/envoy/config/filter/http/compressor/v2/compressor.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +package envoy.config.filter.http.compressor.v2; + +import "envoy/api/v2/core/base.proto"; + +import "google/protobuf/wrappers.proto"; + +import "udpa/annotations/migrate.proto"; + +option java_package = "io.envoyproxy.envoy.config.filter.http.compressor.v2"; +option java_outer_classname = "CompressorProto"; +option java_multiple_files = true; +option (udpa.annotations.file_migrate).move_to_package = + "envoy.extensions.filters.http.compressor.v3"; + +// [#protodoc-title: Compressor] + +// [#next-free-field: 6] +message Compressor { + // Minimum response length, in bytes, which will trigger compression. The default value is 30. + google.protobuf.UInt32Value content_length = 1; + + // Set of strings that allows specifying which mime-types yield compression; e.g., + // application/json, text/html, etc. When this field is not defined, compression will be applied + // to the following mime-types: "application/javascript", "application/json", + // "application/xhtml+xml", "image/svg+xml", "text/css", "text/html", "text/plain", "text/xml" + // and their synonyms. + repeated string content_type = 2; + + // If true, disables compression when the response contains an etag header. When it is false, the + // filter will preserve weak etags and remove the ones that require strong validation. + bool disable_on_etag_header = 3; + + // If true, removes accept-encoding from the request headers before dispatching it to the upstream + // so that responses do not get compressed before reaching the filter. + // .. attention: + // + // To avoid interfering with other compression filters in the same chain use this option in + // the filter closest to the upstream. + bool remove_accept_encoding_header = 4; + + // Runtime flag that controls whether the filter is enabled or not. If set to false, the + // filter will operate as a pass-through filter. If not specified, defaults to enabled. + api.v2.core.RuntimeFeatureFlag runtime_enabled = 5; +} diff --git a/envoy/extensions/filters/http/compressor/v3/BUILD b/envoy/extensions/filters/http/compressor/v3/BUILD new file mode 100644 index 00000000..8dc07faa --- /dev/null +++ b/envoy/extensions/filters/http/compressor/v3/BUILD @@ -0,0 +1,13 @@ +# DO NOT EDIT. This file is generated by tools/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/config/core/v3:pkg", + "//envoy/config/filter/http/compressor/v2:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/envoy/extensions/filters/http/compressor/v3/compressor.proto b/envoy/extensions/filters/http/compressor/v3/compressor.proto new file mode 100644 index 00000000..7d506a21 --- /dev/null +++ b/envoy/extensions/filters/http/compressor/v3/compressor.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; + +package envoy.extensions.filters.http.compressor.v3; + +import "envoy/config/core/v3/base.proto"; + +import "google/protobuf/wrappers.proto"; + +import "udpa/annotations/versioning.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.filters.http.compressor.v3"; +option java_outer_classname = "CompressorProto"; +option java_multiple_files = true; + +// [#protodoc-title: Compressor] + +// [#next-free-field: 6] +message Compressor { + option (udpa.annotations.versioning).previous_message_type = + "envoy.config.filter.http.compressor.v2.Compressor"; + + // Minimum response length, in bytes, which will trigger compression. The default value is 30. + google.protobuf.UInt32Value content_length = 1; + + // Set of strings that allows specifying which mime-types yield compression; e.g., + // application/json, text/html, etc. When this field is not defined, compression will be applied + // to the following mime-types: "application/javascript", "application/json", + // "application/xhtml+xml", "image/svg+xml", "text/css", "text/html", "text/plain", "text/xml" + // and their synonyms. + repeated string content_type = 2; + + // If true, disables compression when the response contains an etag header. When it is false, the + // filter will preserve weak etags and remove the ones that require strong validation. + bool disable_on_etag_header = 3; + + // If true, removes accept-encoding from the request headers before dispatching it to the upstream + // so that responses do not get compressed before reaching the filter. + // .. attention: + // + // To avoid interfering with other compression filters in the same chain use this option in + // the filter closest to the upstream. + bool remove_accept_encoding_header = 4; + + // Runtime flag that controls whether the filter is enabled or not. If set to false, the + // filter will operate as a pass-through filter. If not specified, defaults to enabled. + config.core.v3.RuntimeFeatureFlag runtime_enabled = 5; +}