Skip to content

Commit

Permalink
http: removing deprecated filter names (#19522)
Browse files Browse the repository at this point in the history
Risk Level: low
Testing: n/a
Docs Changes: n/a
Release Notes: inline
part of #9953

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
  • Loading branch information
alyssawilk authored Jan 13, 2022
1 parent 027ded1 commit b3285f0
Show file tree
Hide file tree
Showing 69 changed files with 6 additions and 1,366 deletions.
11 changes: 0 additions & 11 deletions contrib/squash/filters/http/test/config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,6 @@ TEST(SquashFilterConfigFactoryTest, SquashFilterCorrectYaml) {
cb(filter_callback);
}

// Test that the deprecated extension name is disabled by default.
// TODO(zuercher): remove when envoy.deprecated_features.allow_deprecated_extension_names is removed
TEST(SquashFilterConfigTest, DEPRECATED_FEATURE_TEST(DeprecatedExtensionFilterName)) {
const std::string deprecated_name = "envoy.squash";

ASSERT_EQ(
nullptr,
Registry::FactoryRegistry<Server::Configuration::NamedHttpFilterConfigFactory>::getFactory(
deprecated_name));
}

} // namespace
} // namespace Squash
} // namespace HttpFilters
Expand Down
2 changes: 2 additions & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ New Features

Deprecated
----------

* http: removing support for long-deprecated old style filter names, e.g. envoy.router, envoy.lua.
1 change: 0 additions & 1 deletion envoy/registry/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ envoy_cc_library(
"//source/common/common:assert_lib",
"//source/common/common:minimal_logger_lib",
"//source/common/protobuf:utility_lib",
"//source/extensions/common:utility_lib",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
],
)
15 changes: 0 additions & 15 deletions envoy/registry/registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "source/common/common/logger.h"
#include "source/common/common/utility.h"
#include "source/common/protobuf/utility.h"
#include "source/extensions/common/utility.h"

#include "absl/base/attributes.h"
#include "absl/container/flat_hash_map.h"
Expand Down Expand Up @@ -281,9 +280,6 @@ template <class Base> class FactoryRegistry : public Logger::Loggable<Logger::Id
return nullptr;
}

if (!checkDeprecated(name)) {
return nullptr;
}
return it->second;
}

Expand All @@ -304,17 +300,6 @@ template <class Base> class FactoryRegistry : public Logger::Loggable<Logger::Id
return (it == deprecatedFactoryNames().end()) ? name : it->second;
}

static bool checkDeprecated(absl::string_view name) {
auto it = deprecatedFactoryNames().find(name);
const bool deprecated = it != deprecatedFactoryNames().end();
if (deprecated) {
return Extensions::Common::Utility::ExtensionNameUtil::allowDeprecatedExtensionName(
"", it->first, it->second);
}

return true;
}

/**
* @return true if the named factory was disabled.
*/
Expand Down
1 change: 0 additions & 1 deletion source/common/router/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ envoy_cc_library(
"//source/common/tracing:custom_tag_lib",
"//source/common/tracing:http_tracer_lib",
"//source/common/upstream:retry_factory_lib",
"//source/extensions/filters/http/common:utility_lib",
"@envoy_api//envoy/config/common/matcher/v3:pkg_cc_proto",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
"@envoy_api//envoy/config/route/v3:pkg_cc_proto",
Expand Down
17 changes: 2 additions & 15 deletions source/common/router/config_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,13 @@
#include "source/common/tracing/custom_tag_impl.h"
#include "source/common/tracing/http_tracer_impl.h"
#include "source/common/upstream/retry_factory.h"
#include "source/extensions/filters/http/common/utility.h"

#include "absl/strings/match.h"

namespace Envoy {
namespace Router {
namespace {

const std::string DEPRECATED_ROUTER_NAME = "envoy.router";

constexpr uint32_t DEFAULT_MAX_DIRECT_RESPONSE_BODY_SIZE_BYTES = 4096;

void mergeTransforms(Http::HeaderTransforms& dest, const Http::HeaderTransforms& src) {
Expand Down Expand Up @@ -941,14 +938,7 @@ RouteEntryImplBase::parseOpaqueConfig(const envoy::config::route::v3::Route& rou
if (route.has_metadata()) {
auto filter_metadata = route.metadata().filter_metadata().find("envoy.filters.http.router");
if (filter_metadata == route.metadata().filter_metadata().end()) {
// TODO(zuercher): simply return `ret` when deprecated filter names are removed.
filter_metadata = route.metadata().filter_metadata().find(DEPRECATED_ROUTER_NAME);
if (filter_metadata == route.metadata().filter_metadata().end()) {
return ret;
}

Extensions::Common::Utility::ExtensionNameUtil::checkDeprecatedExtensionName(
"http filter", DEPRECATED_ROUTER_NAME, "envoy.filters.http.router");
return ret;
}
for (const auto& it : filter_metadata->second.fields()) {
if (it.second.kind_case() == ProtobufWkt::Value::kStringValue) {
Expand Down Expand Up @@ -1737,10 +1727,7 @@ PerFilterConfigs::PerFilterConfigs(
Server::Configuration::ServerFactoryContext& factory_context,
ProtobufMessage::ValidationVisitor& validator) {
for (const auto& it : typed_configs) {
// TODO(zuercher): canonicalization may be removed when deprecated filter names are removed
const auto& name =
Extensions::HttpFilters::Common::FilterNameUtil::canonicalFilterName(it.first);

const auto& name = it.first;
auto object = createRouteSpecificFilterConfig(name, it.second, optional_http_filters,
factory_context, validator);
if (object != nullptr) {
Expand Down
1 change: 0 additions & 1 deletion source/common/upstream/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ envoy_cc_library(
"//source/common/protobuf",
"//source/common/protobuf:utility_lib",
"//source/common/runtime:runtime_lib",
"//source/extensions/filters/network/common:utility_lib",
"//source/server:transport_socket_config_lib",
],
)
Expand Down
7 changes: 1 addition & 6 deletions source/common/upstream/upstream_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
#include "source/common/upstream/health_checker_impl.h"
#include "source/common/upstream/logical_dns_cluster.h"
#include "source/common/upstream/original_dst_cluster.h"
#include "source/extensions/filters/network/common/utility.h"
#include "source/server/transport_socket_config_impl.h"

#include "absl/container/node_hash_set.h"
Expand Down Expand Up @@ -161,11 +160,7 @@ absl::flat_hash_map<std::string, ProtocolOptionsConfigConstSharedPtr> parseExten
absl::flat_hash_map<std::string, ProtocolOptionsConfigConstSharedPtr> options;

for (const auto& it : config.typed_extension_protocol_options()) {
// TODO(zuercher): canonicalization may be removed when deprecated filter names are removed
// We only handle deprecated network filter names here because no existing HTTP filter has
// protocol options.
auto& name = Extensions::NetworkFilters::Common::FilterNameUtil::canonicalFilterName(it.first);

auto& name = it.first;
auto object = createProtocolOptionsConfig(name, it.second, factory_context);
if (object != nullptr) {
options[name] = std::move(object);
Expand Down
1 change: 0 additions & 1 deletion source/extensions/clusters/dynamic_forward_proxy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ envoy_cc_extension(
"//source/common/upstream:logical_host_lib",
"//source/extensions/common/dynamic_forward_proxy:dns_cache_interface",
"//source/extensions/common/dynamic_forward_proxy:dns_cache_manager_impl",
"//source/extensions/filters/network/common:utility_lib",
"//source/extensions/transport_sockets/tls/cert_validator:cert_validator_lib",
"@envoy_api//envoy/config/cluster/v3:pkg_cc_proto",
"@envoy_api//envoy/config/endpoint/v3:pkg_cc_proto",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "source/common/http/utility.h"
#include "source/common/network/transport_socket_options_impl.h"
#include "source/extensions/common/dynamic_forward_proxy/dns_cache_manager_impl.h"
#include "source/extensions/filters/network/common/utility.h"
#include "source/extensions/transport_sockets/tls/cert_validator/default_validator.h"
#include "source/extensions/transport_sockets/tls/utility.h"

Expand Down
22 changes: 0 additions & 22 deletions source/extensions/common/BUILD

This file was deleted.

124 changes: 0 additions & 124 deletions source/extensions/common/utility.h

This file was deleted.

15 changes: 0 additions & 15 deletions source/extensions/filters/http/common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,6 @@ envoy_cc_library(
],
)

envoy_cc_library(
name = "utility_lib",
hdrs = ["utility.h"],
# Used by the router filter. TODO(#9953) clean up.
visibility = [
"//source:__subpackages__",
"//test:__subpackages__",
],
deps = [
"//envoy/runtime:runtime_interface",
"//source/common/common:macros",
"//source/extensions/common:utility_lib",
],
)

envoy_cc_library(
name = "stream_rate_limiter_lib",
srcs = ["stream_rate_limiter.cc"],
Expand Down
Loading

0 comments on commit b3285f0

Please sign in to comment.