-
public final class BinderTransportSecurityManages security for an Android Service hosted gRPC server.
Attaches authorization state to a newly-created transport, and contains a ServerInterceptor which ensures calls are authorized before allowing them to proceed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBinderTransportSecurity.ServerPolicyCheckerDecides whether a given Android UID is authorized to access some resource.
This class provides the asynchronous version of io.grpc.binder.SecurityPolicy,allowing implementations of authorization logic that involves slow or asynchronous callswithout necessarily blocking the calling thread.
public interfaceBinderTransportSecurity.ShutdownListenerA listener invoked when the io.grpc.binder.internal.BinderServer shuts down, allowingresources to be potentially cleaned up.
-
Method Summary
Modifier and Type Method Description static voidinstallAuthInterceptor(ServerBuilder<out Object> serverBuilder, Executor executor)Install a security policy on an about-to-be created server. static voidattachAuthAttrs(Attributes.Builder builder, int remoteUid, BinderTransportSecurity.ServerPolicyChecker serverPolicyChecker)Attach the given security policy to the transport attributes being built. -
-
Method Detail
-
installAuthInterceptor
@Internal() static void installAuthInterceptor(ServerBuilder<out Object> serverBuilder, Executor executor)
Install a security policy on an about-to-be created server.
- Parameters:
serverBuilder- The ServerBuilder being used to create the server.executor- The executor in which the authorization result will be handled.
-
attachAuthAttrs
@Internal() static void attachAuthAttrs(Attributes.Builder builder, int remoteUid, BinderTransportSecurity.ServerPolicyChecker serverPolicyChecker)
Attach the given security policy to the transport attributes being built. Will be used by theauth interceptor to confirm accept or reject calls.
- Parameters:
builder- The Attributes.Builder for the transport being created.remoteUid- The remote UID of the transport.serverPolicyChecker- The policy checker for this transport.
-
-
-
-