Skip to content

Commit

Permalink
core: add getCallOptions() to CallCredentials.RequestInfo (#9538)
Browse files Browse the repository at this point in the history
This is needed internally (b/134067789#comment20).
  • Loading branch information
zhangkun83 committed Sep 13, 2022
1 parent 9853a0c commit 38b3382
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/src/main/java/io/grpc/CallCredentials.java
Expand Up @@ -91,6 +91,13 @@ public abstract static class RequestInfo {
*/
public abstract MethodDescriptor<?, ?> getMethodDescriptor();

/**
* The call options used to call this RPC.
*/
public CallOptions getCallOptions() {
throw new UnsupportedOperationException("Not implemented");
}

/**
* The security level on the transport.
*/
Expand Down
Expand Up @@ -127,6 +127,11 @@ public ClientStream newStream(
return method;
}

@Override
public CallOptions getCallOptions() {
return callOptions;
}

@Override
public SecurityLevel getSecurityLevel() {
return firstNonNull(
Expand Down
Expand Up @@ -148,6 +148,7 @@ public void parameterPropagation_base() {
RequestInfo info = infoCaptor.getValue();
assertSame(transportAttrs, info.getTransportAttrs());
assertSame(method, info.getMethodDescriptor());
assertSame(callOptions, info.getCallOptions());
assertSame(AUTHORITY, info.getAuthority());
assertSame(SecurityLevel.NONE, info.getSecurityLevel());
}
Expand Down

0 comments on commit 38b3382

Please sign in to comment.