Skip to content

Commit

Permalink
fix busted ext_authz test
Browse files Browse the repository at this point in the history
Signed-off-by: Alice Wasko <[email protected]>
  • Loading branch information
Alice Wasko committed Sep 19, 2024
1 parent f23614b commit 07c86f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions test/common/access_log/access_log_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<const envoy::config::accesslog::v3::HeaderFilter&>(
*factory_config);
return std::make_unique<HeaderFilter>(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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 07c86f3

Please sign in to comment.