Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fix for xdstp replacement for encoded authorities #10571

Merged
merged 2 commits into from
Sep 22, 2023

Conversation

anicr7
Copy link
Contributor

@anicr7 anicr7 commented Sep 21, 2023

Recently the logic in xDS Name resolver was changed to support encoded authorities: #10207.

This seems to cause an issue for xdstp replacements which would percent encode the authority for the replacement causing double encoding.

For example:

URI = xds:///path/to/service
Authority = path%2Fto%2Fservice
xdstp resource = xdstp:///envoy.config.listener.v3.Listener/path%252Fto%252Fservice

Here the authority is encoded due to slashes and during replacement we percent encode it again causing %2F to change to %252F.

To avoid this issue, use the encoded authority only for the getServiceAuthority() API and for all other use cases retain the unencoded authority.

@ejona86

@anicr7 anicr7 marked this pull request as ready for review September 22, 2023 00:01
@ejona86 ejona86 merged commit fec7c2e into grpc:master Sep 22, 2023
14 checks passed
@ejona86
Copy link
Member

ejona86 commented Sep 22, 2023

The PR description had a lot of good information in it. Please include that information in the commit in the future. It is easiest to write that into the commit and then create the PR, so that github copies the description from the commit.

@anicr7 anicr7 deleted the authority_replacement_fix branch September 22, 2023 16:25
DNVindhya pushed a commit to DNVindhya/grpc-java that referenced this pull request Oct 5, 2023
In ac35ab6 the logic in xDS Name resolver was changed to support encoded
authorities. This seems to cause an issue for xdstp replacements which
would percent encode the authority for the replacement causing double
encoding.

For example:

URI = xds:///path/to/service
Authority = path%2Fto%2Fservice
xdstp resource = xdstp:///envoy.config.listener.v3.Listener/path%252Fto%252Fservice

Here the authority is encoded due to slashes and during replacement we
percent encode it again causing %2F to change to %252F. To avoid this
issue, use the encoded authority only for the getServiceAuthority() API
and for all other use cases retain the unencoded authority.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants