From 1405fa4089112ad4aef161a127d8783dc820f098 Mon Sep 17 00:00:00 2001 From: Shriram Rajagopalan Date: Thu, 1 Aug 2024 21:54:48 +0000 Subject: [PATCH] add createFilterFactoryFromProtoWithServerContextTyped factory function Signed-off-by: Shriram Rajagopalan --- source/extensions/filters/http/ext_authz/config.cc | 6 ++---- source/extensions/filters/http/ext_authz/config.h | 9 ++++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/source/extensions/filters/http/ext_authz/config.cc b/source/extensions/filters/http/ext_authz/config.cc index 87a20cbd12e9..4ef558051bd7 100644 --- a/source/extensions/filters/http/ext_authz/config.cc +++ b/source/extensions/filters/http/ext_authz/config.cc @@ -20,11 +20,9 @@ namespace Extensions { namespace HttpFilters { namespace ExtAuthz { -Http::FilterFactoryCb ExtAuthzFilterConfig::createFilterFactoryFromProtoTyped( +Http::FilterFactoryCb ExtAuthzFilterConfig::createFilterFactoryFromProtoWithServerContextTyped( const envoy::extensions::filters::http::ext_authz::v3::ExtAuthz& proto_config, - const std::string& stats_prefix, Server::Configuration::FactoryContext& context) { - auto& server_context = context.serverFactoryContext(); - + const std::string& stats_prefix, Server::Configuration::ServerFactoryContext& server_context) { const auto filter_config = std::make_shared(proto_config, context.scope(), stats_prefix, server_context); // The callback is created in main thread and executed in worker thread, variables except factory diff --git a/source/extensions/filters/http/ext_authz/config.h b/source/extensions/filters/http/ext_authz/config.h index a5cddfb6a12c..024c97be4e7c 100644 --- a/source/extensions/filters/http/ext_authz/config.h +++ b/source/extensions/filters/http/ext_authz/config.h @@ -25,7 +25,14 @@ class ExtAuthzFilterConfig static constexpr uint64_t DefaultTimeout = 200; Http::FilterFactoryCb createFilterFactoryFromProtoTyped( const envoy::extensions::filters::http::ext_authz::v3::ExtAuthz& proto_config, - const std::string& stats_prefix, Server::Configuration::FactoryContext& context) override; + const std::string& stats_prefix, Server::Configuration::FactoryContext& context) override { + return createFilterFactoryFromProtoWithServerContextTyped(proto_config, stats_prefix, + context.serverFactoryContext()); + } + + Http::FilterFactoryCb createFilterFactoryFromProtoWithServerContextTyped( + const envoy::extensions::filters::http::ext_authz::v3::ExtAuthz& proto_config, + const std::string& stats_prefix, Server::Configuration::ServerFactoryContext& server_context) override; Router::RouteSpecificFilterConfigConstSharedPtr createRouteSpecificFilterConfigTyped( const envoy::extensions::filters::http::ext_authz::v3::ExtAuthzPerRoute& proto_config,