googleapis / sdk-platform-java

Tooling and shared libraries for Cloud SDK for Java
https://cloud.google.com/java/docs/bom
Apache License 2.0
68 stars 53 forks source link

fix: plumb mtlsEndpoint to gRPC Channel provider instead of setting it in EndpointContext. #3386

Open rmehta19 opened 1 week ago

rmehta19 commented 1 week ago

Fix a problem where if DirectPath is to be used (canUseDirectPath is going to return true), but endpoint resolution determines conditions are met to use S2A, the endpoint incorrectly gets set to mtls endpoint.

We only try S2A logic (e.g we only look at useS2A), if we have ruled out DirectPath as an option (canUseDirectPathI() returns false), but endpoint resolution logic doesn't know this, and will set endpoint to mtls endpoint if it determines S2A can be used, even if DirectPath can be used.

conventional-commit-lint-gcf[bot] commented 1 week ago

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot https://conventionalcommits.org/

rmehta19 commented 1 week ago

@lqiu96 @zhumin8 @blakeli0