googleapis / googleapis/google-cloud-java

[sdk-platform-java] DirectPath should only use the TLS endpoint

Open
#12,390 1 comment 0 reactions 0 assignees View on GitHub
priority: p3 type: bug
Dominant language
Java
Stars
2.1k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
157

Description

DirectPath channel [creation logic](https://github.com/googleapis/sdk-platform-java/blob/4aaea1ec89737ea150acb918584a234fcf426810/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java#L630-L638) should in invoked using the TLS endpoint.

Right now, DirectPath uses the endpoint that is returned back from EndpointContext and this may be resolved to be either the TLS or mTLS endpoint based on [user configuration](https://github.com/googleapis/sdk-platform-java/blob/4aaea1ec89737ea150acb918584a234fcf426810/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java#L351-L373).

(Stretch)
EndpointContext should be able to determine if DirectPath is enabled before resolving the endpoint. This would help both S2A and DirectPath to use the correct endpoint:

Logic should be
- If DirectPath enabled and S2A enabled: DirectPath with TLS
- If DirectPath enabled and S2A disabled: DirectPath with TLS
- If DirectPath disabled and S2A enabled: S2A with mTLS
- If DirectPath disabled and S2A disabled: Default flow with TLS

Contributor guide

Open the contributing guide

Research direction

Start with the DirectPath channel creation logic in gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java at the linked lines, then read endpoint resolution in gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java at the linked lines. Trace how DirectPath, S2A, TLS, and mTLS choices interact, and confirm completion against the four endpoint-selection cases listed in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
networking, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.