Skip to content

xds: implement cluster metadata parsing for GCP Authentication filter (gRFC A83)#9044

Merged
Pranjali-2501 merged 5 commits into
grpc:masterfrom
Pranjali-2501:metadata
Apr 16, 2026
Merged

xds: implement cluster metadata parsing for GCP Authentication filter (gRFC A83)#9044
Pranjali-2501 merged 5 commits into
grpc:masterfrom
Pranjali-2501:metadata

Conversation

@Pranjali-2501
Copy link
Copy Markdown
Contributor

@Pranjali-2501 Pranjali-2501 commented Apr 4, 2026

This PR implements the xDS Cluster Metadata parsing logic as specified in gRFC A83. This allows the xDS client to extract and validate cluster metadata to configure the audience used by GCP Authentication filter.

Changes

  • GCP Authn Support: Added audienceConverter to parse envoy.extensions.filters.http.gcp_authn.v3.Audience protos.
  • CDS Integration: Updated validateClusterAndConstructClusterUpdate to invoke metadata validation.
  • Validation: Added strict validation for the url field; an empty URL in the audience metadata will now result in a NACK of the Cluster resource.
  • Environment Variable: Metadata parsing for GCP Authn is guarded by the GCPAuthenticationFilterEnabled environment variable.

RELEASE NOTES: N/A

@Pranjali-2501 Pranjali-2501 added Type: Feature New features or improvements in behavior Area: xDS Includes everything xDS related, including LB policies used with xDS. labels Apr 4, 2026
@Pranjali-2501 Pranjali-2501 added this to the 1.81 Release milestone Apr 4, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 4, 2026

Codecov Report

❌ Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.54%. Comparing base (aa4d281) to head (116d346).
⚠️ Report is 17 commits behind head on master.

Files with missing lines Patch % Lines
internal/xds/xdsclient/xdsresource/metadata.go 55.55% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9044      +/-   ##
==========================================
- Coverage   83.02%   81.54%   -1.49%     
==========================================
  Files         413      413              
  Lines       33229    33448     +219     
==========================================
- Hits        27589    27275     -314     
- Misses       4221     4270      +49     
- Partials     1419     1903     +484     
Files with missing lines Coverage Δ
internal/xds/xdsclient/xdsresource/type_cds.go 12.24% <ø> (-38.78%) ⬇️
...nternal/xds/xdsclient/xdsresource/unmarshal_cds.go 72.65% <100.00%> (-16.68%) ⬇️
...nternal/xds/xdsclient/xdsresource/unmarshal_eds.go 91.77% <ø> (-4.44%) ⬇️
internal/xds/xdsclient/xdsresource/metadata.go 52.94% <55.55%> (-28.88%) ⬇️

... and 33 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Pranjali-2501
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@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 implements support for the GCP Authentication filter (gRFC A83) by adding a new environment variable and an audience metadata converter. It refactors metadata parsing into a shared, exported function and adds a metadata field to cluster updates. Feedback highlights a documentation copy-paste error and suggests expanding the metadata parsing guard in the CDS unmarshaller to ensure compatibility with the HTTP Connect feature.

Comment thread internal/xds/xdsclient/xdsresource/unmarshal_cds.go Outdated
Comment thread internal/envconfig/xds.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/unmarshal_eds.go Outdated
Comment thread internal/envconfig/xds.go Outdated
Comment thread internal/envconfig/xds.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/metadata.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/metadata.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/metadata_test.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/metadata_test.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/unmarshal_cds_test.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/unmarshal_cds_test.go
Comment thread internal/xds/xdsclient/xdsresource/unmarshal_cds_test.go Outdated
@easwars easwars assigned Pranjali-2501 and unassigned easwars Apr 7, 2026
@easwars easwars assigned Pranjali-2501 and unassigned easwars Apr 16, 2026
@Pranjali-2501 Pranjali-2501 merged commit 39a15f6 into grpc:master Apr 16, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: xDS Includes everything xDS related, including LB policies used with xDS. Type: Feature New features or improvements in behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants