gapic-generator-java
gapic-generator-java copied to clipboard
DirectPath should only use the TLS endpoint
DirectPath channel creation logic 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.
(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