Allow injecting bootstrap info into xDS Filter API for config parsing#12724
Allow injecting bootstrap info into xDS Filter API for config parsing#12724sauravzg wants to merge 3 commits intogrpc:masterfrom
Conversation
|
@kannanjgithub @AgraVator PTAL and add yourself as reviewers on the PR. Thanks. |
99c63c5 to
1dcec9a
Compare
xds/src/main/java/io/grpc/xds/internal/grpcservice/GrpcServiceXdsContextProvider.java
Show resolved
Hide resolved
xds/src/main/java/io/grpc/xds/internal/grpcservice/GrpcServiceXdsContextProvider.java
Outdated
Show resolved
Hide resolved
fd61ef1 to
9a2c8e6
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new parser for the external authorization (ExtAuthz) filter and a comprehensive GrpcService configuration parser within the xDS implementation. It refactors the Filter interface to include a FilterContext during configuration parsing, enabling filters to access bootstrap and server-specific metadata. The changes also enhance the bootstrap process to support allowed_grpc_services and add various internal configuration classes for header mutation and validation. Feedback was provided to replace unchecked UnsupportedOperationException calls with checked GrpcServiceParseException instances in the GrpcServiceConfigParser to ensure that unsupported credential types result in a validation error (NACK) rather than crashing the xDS client thread.
9a2c8e6 to
68f7ebf
Compare
…fig parsing Extend the xDS Filter API to support injecting bootstrap information into filters during configuration parsing. This allows filters to access context information (e.g., allowed gRPC services) from the resource loading layer during configuration validation and parsing. - Update `Filter.Provider.parseFilterConfig` and `parseFilterConfigOverride` to accept a `FilterContext` parameter. - Introduce `BootstrapInfoGrpcServiceContextProvider` to encapsulate bootstrap info for context resolution. - Update `XdsListenerResource` and `XdsRouteConfigureResource` to construct and pass `FilterContext` during configuration parsing. - Update sub-filters (`FaultFilter`, `RbacFilter`, `GcpAuthenticationFilter`, `RouterFilter`) to match the updated `FilterContext` signature. Known Gaps & Limitations: 1. **MetricHolder**: Propagation of `MetricHolder` is not supported with this approach currently and is planned for support in a later phase. 2. **NameResolverRegistry**: Propagation is deferred for consistency. While it could be passed from `XdsNameResolver` on the client side, there is no equivalent mechanism on the server side. To ensure consistent behavior, `DefaultRegistry` is used when validating schemes and creating channels.
68f7ebf to
51bb4ab
Compare
This sits on top of #12492 , so please view the commits after it.
Extend the xDS Filter API to support injecting bootstrap information into
filters during configuration parsing. This allows filters to access context
information (e.g., allowed gRPC services) from the resource loading layer
during configuration validation and parsing.
Filter.Provider.parseFilterConfigandparseFilterConfigOverrideto accept a
FilterContextparameter.BootstrapInfoGrpcServiceContextProviderto encapsulatebootstrap info for context resolution.
XdsListenerResourceandXdsRouteConfigureResourcetoconstruct and pass
FilterContextduring configuration parsing.FaultFilter,RbacFilter,GcpAuthenticationFilter,RouterFilter) to match the updatedFilterContextsignature.Known Gaps & Limitations:
MetricHolderis not supported withthis approach currently and is planned for support in a later phase.
it could be passed from
XdsNameResolveron the client side, there isno equivalent mechanism on the server side. To ensure consistent behavior,
DefaultRegistryis used when validating schemes and creating channels.