http: add server factory only factory support to ratelimit#46228
Open
wbpcode wants to merge 1 commit into
Open
http: add server factory only factory support to ratelimit#46228wbpcode wants to merge 1 commit into
wbpcode wants to merge 1 commit into
Conversation
wbpcode
commented
Jul 18, 2026
Comment on lines
-157
to
+164
| ClientPtr rateLimitClient(Server::Configuration::FactoryContext& context, | ||
| ClientPtr rateLimitClient(Server::Configuration::ServerFactoryContext& context, | ||
| const Grpc::GrpcServiceConfigWithHashKey& config_with_hash_key, | ||
| const std::optional<std::chrono::milliseconds>& timeout) { | ||
| // TODO(ramaraochavali): register client to singleton when GrpcClientImpl supports concurrent | ||
| // requests. | ||
| auto client_or_error = | ||
| context.serverFactoryContext() | ||
| .clusterManager() | ||
| .grpcAsyncClientManager() | ||
| .getOrCreateRawAsyncClientWithHashKey(config_with_hash_key, context.scope(), true); | ||
| context.clusterManager().grpcAsyncClientManager().getOrCreateRawAsyncClientWithHashKey( | ||
| config_with_hash_key, context.scope(), true); |
Member
Author
There was a problem hiding this comment.
Although this changed the scope that be used to create the client from listener level to server level. But note, grpc client will always create a new scope based on existing scope and listener level scope also have no prefix.
So, finally, no any behavior be changed in the implementation.
… factory context Signed-off-by: wbpcode <wbphub@gmail.com>
wbpcode
force-pushed
the
route-factory-ratelimit
branch
from
July 18, 2026 02:15
87d013b to
add052d
Compare
wbpcode
marked this pull request as ready for review
July 18, 2026 02:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message: http: add server factory only factory support to ratelimit
Additional Description:
This adds the server-factory-context-only filter factory creation method
(
createHttpFilterFactoryFromProtoTypedtaking only aServerFactoryContext,introduced in #45989) to the ratelimit HTTP filter(s).
This allows these filters to be created in contexts where only a
ServerFactoryContextis available (e.g. route/virtual-host level filterconfiguration) rather than requiring the full downstream
FactoryContext.The existing downstream
FactoryContextpath is preserved and now delegatesto a shared helper, so behavior for existing use cases is unchanged.
Generative AI (Claude) was used to assist with this change. The author fully
understands the code.
Risk Level: Low
Testing: Existing/added unit config tests; CI.
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A