Skip to content

Commit

Permalink
add createFilterFactoryFromProtoWithServerContextTyped factory function
Browse files Browse the repository at this point in the history
Signed-off-by: Shriram Rajagopalan <shriramr@google.com>
  • Loading branch information
Shriram Rajagopalan committed Aug 1, 2024
1 parent 97bc67a commit 1405fa4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 2 additions & 4 deletions source/extensions/filters/http/ext_authz/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<FilterConfig>(proto_config, context.scope(), stats_prefix, server_context);
// The callback is created in main thread and executed in worker thread, variables except factory
Expand Down
9 changes: 8 additions & 1 deletion source/extensions/filters/http/ext_authz/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1405fa4

Please sign in to comment.