Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal_redirect: remove well_known_names #16746

Merged
merged 1 commit into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions source/extensions/internal_redirect/BUILD
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_library",
"envoy_extension_package",
)

licenses(["notice"]) # Apache 2

envoy_extension_package()

envoy_cc_library(
name = "well_known_names",
hdrs = ["well_known_names.h"],
# well known names files are public as long as they exist.
visibility = ["//visibility:public"],
deps = [
"//source/common/singleton:const_singleton",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ envoy_cc_library(
deps = [
"//include/envoy/router:internal_redirect_interface",
"//include/envoy/stream_info:filter_state_interface",
"//source/extensions/internal_redirect:well_known_names",
"@envoy_api//envoy/extensions/internal_redirect/allow_listed_routes/v3:pkg_cc_proto",
],
)
Expand All @@ -32,7 +31,6 @@ envoy_cc_extension(
":allow_listed_routes_lib",
"//include/envoy/registry",
"//include/envoy/router:internal_redirect_interface",
"//source/extensions/internal_redirect:well_known_names",
"@envoy_api//envoy/extensions/internal_redirect/allow_listed_routes/v3:pkg_cc_proto",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#include "envoy/router/internal_redirect.h"
#include "envoy/stream_info/filter_state.h"

#include "extensions/internal_redirect/well_known_names.h"

#include "absl/container/flat_hash_set.h"
#include "absl/strings/string_view.h"

Expand All @@ -26,7 +24,7 @@ class AllowListedRoutesPredicate : public Router::InternalRedirectPredicate {
}

absl::string_view name() const override {
return InternalRedirectPredicateValues::get().AllowListedRoutesPredicate;
return "envoy.internal_redirect_predicates.allow_listed_routes";
}

const absl::flat_hash_set<std::string> allowed_routes_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "common/protobuf/utility.h"

#include "extensions/internal_redirect/allow_listed_routes/allow_listed_routes.h"
#include "extensions/internal_redirect/well_known_names.h"

namespace Envoy {
namespace Extensions {
Expand All @@ -26,7 +25,7 @@ class AllowListedRoutesPredicateFactory : public Router::InternalRedirectPredica
}

std::string name() const override {
return InternalRedirectPredicateValues::get().AllowListedRoutesPredicate;
return "envoy.internal_redirect_predicates.allow_listed_routes";
}

ProtobufTypes::MessagePtr createEmptyConfigProto() override {
Expand Down
2 changes: 0 additions & 2 deletions source/extensions/internal_redirect/previous_routes/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ envoy_cc_library(
deps = [
"//include/envoy/router:internal_redirect_interface",
"//include/envoy/stream_info:filter_state_interface",
"//source/extensions/internal_redirect:well_known_names",
],
)

Expand All @@ -32,7 +31,6 @@ envoy_cc_extension(
":previous_routes_lib",
"//include/envoy/registry",
"//include/envoy/router:internal_redirect_interface",
"//source/extensions/internal_redirect:well_known_names",
"@envoy_api//envoy/extensions/internal_redirect/previous_routes/v3:pkg_cc_proto",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "envoy/router/internal_redirect.h"

#include "extensions/internal_redirect/previous_routes/previous_routes.h"
#include "extensions/internal_redirect/well_known_names.h"

namespace Envoy {
namespace Extensions {
Expand All @@ -19,9 +18,7 @@ class PreviousRoutesPredicateFactory : public Router::InternalRedirectPredicateF
return std::make_shared<PreviousRoutesPredicate>(current_route_name);
}

std::string name() const override {
return InternalRedirectPredicateValues::get().PreviousRoutesPredicate;
}
std::string name() const override { return "envoy.internal_redirect_predicates.previous_routes"; }

ProtobufTypes::MessagePtr createEmptyConfigProto() override {
return std::make_unique<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#include "envoy/router/internal_redirect.h"
#include "envoy/stream_info/filter_state.h"

#include "extensions/internal_redirect/well_known_names.h"

#include "absl/strings/string_view.h"

namespace Envoy {
Expand All @@ -20,7 +18,7 @@ class PreviousRoutesPredicate : public Router::InternalRedirectPredicate {
bool) override;

absl::string_view name() const override {
return InternalRedirectPredicateValues::get().PreviousRoutesPredicate;
return "envoy.internal_redirect_predicates.previous_routes";
}

private:
Expand Down
2 changes: 0 additions & 2 deletions source/extensions/internal_redirect/safe_cross_scheme/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ envoy_cc_library(
deps = [
"//include/envoy/router:internal_redirect_interface",
"//include/envoy/stream_info:filter_state_interface",
"//source/extensions/internal_redirect:well_known_names",
],
)

Expand All @@ -31,7 +30,6 @@ envoy_cc_extension(
":safe_cross_scheme_lib",
"//include/envoy/registry",
"//include/envoy/router:internal_redirect_interface",
"//source/extensions/internal_redirect:well_known_names",
"@envoy_api//envoy/extensions/internal_redirect/safe_cross_scheme/v3:pkg_cc_proto",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "envoy/router/internal_redirect.h"

#include "extensions/internal_redirect/safe_cross_scheme/safe_cross_scheme.h"
#include "extensions/internal_redirect/well_known_names.h"

namespace Envoy {
namespace Extensions {
Expand All @@ -18,7 +17,7 @@ class SafeCrossSchemePredicateFactory : public Router::InternalRedirectPredicate
}

std::string name() const override {
return InternalRedirectPredicateValues::get().SafeCrossSchemePredicate;
return "envoy.internal_redirect_predicates.safe_cross_scheme";
}

ProtobufTypes::MessagePtr createEmptyConfigProto() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#include "envoy/router/internal_redirect.h"
#include "envoy/stream_info/filter_state.h"

#include "extensions/internal_redirect/well_known_names.h"

#include "absl/strings/string_view.h"

namespace Envoy {
Expand All @@ -19,7 +17,7 @@ class SafeCrossSchemePredicate : public Router::InternalRedirectPredicate {
}

absl::string_view name() const override {
return InternalRedirectPredicateValues::get().SafeCrossSchemePredicate;
return "envoy.internal_redirect_predicates.safe_cross_scheme";
}
};

Expand Down
27 changes: 0 additions & 27 deletions source/extensions/internal_redirect/well_known_names.h

This file was deleted.

1 change: 0 additions & 1 deletion test/extensions/internal_redirect/previous_routes/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ envoy_extension_cc_test(
extension_name = "envoy.internal_redirect_predicates.previous_routes",
deps = [
"//source/common/stream_info:filter_state_lib",
"//source/extensions/internal_redirect:well_known_names",
"//source/extensions/internal_redirect/previous_routes:config",
"@envoy_api//envoy/extensions/internal_redirect/previous_routes/v3:pkg_cc_proto",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "common/stream_info/filter_state_impl.h"

#include "extensions/internal_redirect/previous_routes/config.h"
#include "extensions/internal_redirect/well_known_names.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"
Expand All @@ -21,7 +20,7 @@ class PreviousRoutesTest : public testing::Test {
protected:
PreviousRoutesTest() : filter_state_(StreamInfo::FilterState::LifeSpan::FilterChain) {
factory_ = Registry::FactoryRegistry<Router::InternalRedirectPredicateFactory>::getFactory(
InternalRedirectPredicateValues::get().PreviousRoutesPredicate);
"envoy.internal_redirect_predicates.previous_routes");
config_ = factory_->createEmptyConfigProto();
}

Expand Down