Skip to content

Allow injecting bootstrap info into xDS Filter API for config parsing#12724

Open
sauravzg wants to merge 3 commits intogrpc:masterfrom
sauravzg:feat/bootstrap-filter-context
Open

Allow injecting bootstrap info into xDS Filter API for config parsing#12724
sauravzg wants to merge 3 commits intogrpc:masterfrom
sauravzg:feat/bootstrap-filter-context

Conversation

@sauravzg
Copy link
Copy Markdown
Collaborator

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.

  • 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.

@sauravzg
Copy link
Copy Markdown
Collaborator Author

@kannanjgithub @AgraVator PTAL and add yourself as reviewers on the PR. Thanks.

@sauravzg sauravzg force-pushed the feat/bootstrap-filter-context branch 2 times, most recently from 99c63c5 to 1dcec9a Compare March 25, 2026 14:28
@sauravzg sauravzg force-pushed the feat/bootstrap-filter-context branch 4 times, most recently from fd61ef1 to 9a2c8e6 Compare March 31, 2026 13:07
@sauravzg
Copy link
Copy Markdown
Collaborator Author

sauravzg commented Apr 1, 2026

/gemini review

@sauravzg sauravzg requested a review from kannanjgithub April 1, 2026 04:49
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

sauravzg added a commit to sauravzg/grpc-java that referenced this pull request Apr 1, 2026
@sauravzg sauravzg force-pushed the feat/bootstrap-filter-context branch from 9a2c8e6 to 68f7ebf Compare April 1, 2026 13:31
sauravzg added 3 commits April 2, 2026 11:57
…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.
@sauravzg sauravzg force-pushed the feat/bootstrap-filter-context branch from 68f7ebf to 51bb4ab Compare April 2, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants