Skip to content

xds-client: add canonical xdstp resource-name parsing - #2814

Draft
W4lspirit wants to merge 1 commit into
grpc:masterfrom
W4lspirit:xds-federation/resource-names
Draft

xds-client: add canonical xdstp resource-name parsing#2814
W4lspirit wants to merge 1 commit into
grpc:masterfrom
W4lspirit:xds-federation/resource-names

Conversation

@W4lspirit

@W4lspirit W4lspirit commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Motivation

gRFC A47 identifies federated xDS resources with xdstp:// URIs. These names need stable equality and hashing across percent-encoding and context-parameter order, while their opaque paths must not be changed.

I'm not using the url crate as it will normalizing the path:

This parsing foundation is kept separate from authority routing so it can be reviewed and merged without changing the behavior of existing non-federation clients.

What changed

  • Add ResourceName and AuthorityKey for legacy and xdstp resource names.
  • Structurally split xDS URIs without normalizing .
  • Decode URI components exactly once and retain a canonical wire representation.
  • Canonically order context parameters and normalize percent encoding.
  • Distinguish legacy, empty-authority, and named-authority resource keys.
  • Reject malformed names using the reserved xdstp: scheme.
  • Add focused parsing, identity, encoding, and round-trip tests.

Compatibility

This PR does not connect the parser to watch routing, bootstrap authorities, or server selection. Legacy resource names round-trip byte-for-byte, and the existing single-server path is unchanged.

Validation

  • cargo test -p xds-client
  • cargo clippy -p xds-client --all-targets -- -D warnings
  • Behavior compared with the corresponding gRPC-Go, gRPC-Java, and gRPC C++ resource-name implementations.

Part of #2795.

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.

1 participant