Skip to content

Commit bde880f

Browse files
committed
Leave TARGET_SERVICE_INFO for a follow up
1 parent 0c49469 commit bde880f

2 files changed

Lines changed: 3 additions & 14 deletions

File tree

binder/src/main/java/io/grpc/binder/ApiConstants.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,4 @@ private ApiConstants() {}
4545
*/
4646
public static final NameResolver.Args.Key<UserHandle> TARGET_ANDROID_USER =
4747
NameResolver.Args.Key.create("target-android-user");
48-
49-
/**
50-
* The authentic ServiceInfo for an {@link io.grpc.EquivalentAddressGroup} of {@link
51-
* AndroidComponentAddress}es, in case a {@link NameResolver} has already looked it up.
52-
*/
53-
public static final Attributes.Key<ServiceInfo> TARGET_SERVICE_INFO =
54-
Attributes.Key.create("target-service-info");
5548
}

binder/src/main/java/io/grpc/binder/internal/BinderTransport.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -670,19 +670,15 @@ public synchronized Runnable start(ManagedClientTransport.Listener clientTranspo
670670

671671
@GuardedBy("this")
672672
private void preAuthorizeServer() {
673-
Attributes eagAttrs = checkNotNull(attributes.get(GrpcAttributes.ATTR_CLIENT_EAG_ATTRS));
674-
ServiceInfo serviceInfo = eagAttrs.get(ApiConstants.TARGET_SERVICE_INFO);
675-
if (serviceInfo == null) {
676-
serviceInfo = serviceBinding.resolve();
677-
}
673+
ServiceInfo serviceInfo = serviceBinding.resolve();
678674

679675
// It's unlikely, but in theory the server identity/existence represented by this ServiceInfo
680676
// could change by the time we actually bind/connect. It doesn't matter though, because:
681677
// - If pre-auth fails (but would succeed for the new identity), grpc-core will retry
682678
// against the replacement server using a new instance of BinderClientTransport.
683679
// - If pre-auth succeeds (but would fail for the new identity), we might incorrectly bind
684-
// to an unauthorized server, but we'll check the SecurityPolicy again in SETUP_TRANSPORT
685-
// against the actual/new server's identity.
680+
// to an unauthorized server, but we'll notice when we the SecurityPolicy again as part of the
681+
// usual handshake.
686682
if (serviceInfo == null) {
687683
preAuthResultFuture =
688684
Futures.immediateFuture(

0 commit comments

Comments
 (0)