Complete CallCredentials support in gRPC webclient#2
Draft
MariusVolkhart wants to merge 1 commit into
Draft
Conversation
The CallCredentials API on GrpcServiceDescriptor and GrpcClientMethodDescriptor was introduced in helidon-io#8423 with builder support and Javadoc describing override semantics, but was never wired through to outgoing RPCs. GrpcServiceClientImpl.ensureMethod() always passed CallOptions.DEFAULT, and GrpcBaseClientCall.start() never read callOptions.getCredentials(). Credentials configured via either the native Helidon API or stub.withCallCredentials() were silently discarded. GrpcServiceClientImpl.ensureMethod() now resolves credentials from the descriptor chain (method-level overrides service-level) and injects them into CallOptions. GrpcBaseClientCall.start() applies callOptions.getCredentials() before writeHeaders, using a CompletableFuture to bridge the async MetadataApplier callback to the blocking call path. Timeout is derived from the call deadline when set, falling back to pollWaitTime. A startFailed flag guards subclass stream I/O methods against use after start() exits early. Fixes helidon-io#11741 Relates to helidon-io#10527
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
CallCredentialsAPI onGrpcServiceDescriptorandGrpcClientMethodDescriptorwas introducedin helidon-io#8423 with builder support and Javadoc describing override semantics, but was never wired through
to outgoing RPCs.
GrpcServiceClientImpl.ensureMethod()always passedCallOptions.DEFAULT, andGrpcBaseClientCall.start()never readcallOptions.getCredentials(). Credentials configured viaeither the native Helidon API or
stub.withCallCredentials()were silently discarded.GrpcServiceClientImpl.ensureMethod()now resolves credentials from the descriptor chain(method-level overrides service-level) and injects them into
CallOptions.GrpcBaseClientCall.start()appliescallOptions.getCredentials()beforewriteHeaders, using aCompletableFutureto bridge the asyncMetadataAppliercallback to the blocking call path.Timeout is derived from the call deadline when set, falling back to
pollWaitTime.startFailedflag guards subclass stream I/O methods against use afterstart()exits early.Fixes helidon-io#11741
Relates to helidon-io#10527
Note: This PR is based on helidon-io#11699 (
mv/deadlines), which adds deadline propagation support.CallCredentialstimeout resolution depends oncallOptions.getDeadline()introduced there.Documentation
New API surface: none.
GrpcServiceDescriptor.callCredentials()andGrpcClientMethodDescriptor.callCredentials()already exist. This change makes them functional.Users who authenticate gRPC calls via
ClientInterceptorare unaffected. Users who configureCallCredentialson service/method descriptors or viastub.withCallCredentials()will now seethose credentials applied to outgoing RPCs, consistent with grpc-java behavior.