From 07c86f395d7787eb6bdbc787bf775e1f7ddbb2e8 Mon Sep 17 00:00:00 2001 From: Alice Wasko Date: Thu, 16 May 2024 08:20:03 -0700 Subject: [PATCH] fix busted ext_authz test Signed-off-by: Alice Wasko --- test/common/access_log/access_log_impl_test.cc | 11 +++++++++++ .../http/ext_authz/ext_authz_integration_test.cc | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/test/common/access_log/access_log_impl_test.cc b/test/common/access_log/access_log_impl_test.cc index d6762b047311..e69915fb8e0c 100644 --- a/test/common/access_log/access_log_impl_test.cc +++ b/test/common/access_log/access_log_impl_test.cc @@ -1601,6 +1601,17 @@ class TestHeaderFilterFactory : public ExtensionFilterFactory { public: ~TestHeaderFilterFactory() override = default; + FilterPtr createFilter(const envoy::config::accesslog::v3::ExtensionFilter& config, + Server::Configuration::FactoryContext& context) override { + auto factory_config = Config::Utility::translateToFactoryConfig( + config, context.messageValidationVisitor(), *this); + const auto& header_config = + TestUtility::downcastAndValidate( + *factory_config); + return std::make_unique(header_config, context.serverFactoryContext()); + } + + // Overload that supports generic factory context FilterPtr createFilter(const envoy::config::accesslog::v3::ExtensionFilter& config, Server::Configuration::GenericFactoryContext& context) override { auto factory_config = Config::Utility::translateToFactoryConfig( diff --git a/test/extensions/filters/http/ext_authz/ext_authz_integration_test.cc b/test/extensions/filters/http/ext_authz/ext_authz_integration_test.cc index 6f56af4eb72c..070aaace132e 100644 --- a/test/extensions/filters/http/ext_authz/ext_authz_integration_test.cc +++ b/test/extensions/filters/http/ext_authz/ext_authz_integration_test.cc @@ -366,7 +366,7 @@ class ExtAuthzGrpcIntegrationTest EXPECT_EQ(2, values.size()); } - if (!new_headers_from_upstream.empty()) { + if (!opts.new_headers_from_upstream.empty()) { // new_headers_from_upstream has the `append=true` flag set, which tells Envoy to append to // the existing header if it exists, and to discard the insertion otherwise. There's a // "TODO(dio)" in ext_authz.cc to add a flag to make it be "append-if-set or set-if-unset",