Class GoogleAuthLibraryCallCredentials
java.lang.Object
io.grpc.CallCredentials
io.grpc.auth.GoogleAuthLibraryCallCredentials
- All Implemented Interfaces:
io.grpc.InternalMayRequireSpecificExecutor
final class GoogleAuthLibraryCallCredentials
extends io.grpc.CallCredentials
implements io.grpc.InternalMayRequireSpecificExecutor
Wraps
Credentials as a CallCredentials.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classprivate static classNested classes/interfaces inherited from class io.grpc.CallCredentials
io.grpc.CallCredentials.MetadataApplier, io.grpc.CallCredentials.RequestInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Class<?> (package private) final com.google.auth.Credentialsprivate static final Class<? extends com.google.auth.Credentials> private static final GoogleAuthLibraryCallCredentials.JwtHelperprivate io.grpc.Metadataprivate static final Loggerprivate final booleanprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionGoogleAuthLibraryCallCredentials(com.google.auth.Credentials creds) GoogleAuthLibraryCallCredentials(com.google.auth.Credentials creds, GoogleAuthLibraryCallCredentials.JwtHelper jwtHelper) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyRequestMetadata(io.grpc.CallCredentials.RequestInfo info, Executor appExecutor, io.grpc.CallCredentials.MetadataApplier applier) (package private) static GoogleAuthLibraryCallCredentials.JwtHelpercreateJwtHelperOrNull(ClassLoader loader) booleanThis method is to support the hack for AppEngineCredentials which need to run on a specific thread.private static Class<?> private static Class<? extends com.google.auth.Credentials> private static URIremovePort(URI uri) private static URIserviceUri(String authority, io.grpc.MethodDescriptor<?, ?> method) Generate a JWT-specific service URI.private static io.grpc.MetadataMethods inherited from class io.grpc.CallCredentials
thisUsesUnstableApi
-
Field Details
-
log
-
jwtHelper
-
GOOGLE_CREDENTIALS_CLASS
-
APP_ENGINE_CREDENTIALS_CLASS
-
requirePrivacy
private final boolean requirePrivacy -
creds
final com.google.auth.Credentials creds -
lastHeaders
private io.grpc.Metadata lastHeaders -
lastMetadata
-
requiresSpecificExecutor
private final boolean requiresSpecificExecutor
-
-
Constructor Details
-
GoogleAuthLibraryCallCredentials
public GoogleAuthLibraryCallCredentials(com.google.auth.Credentials creds) -
GoogleAuthLibraryCallCredentials
GoogleAuthLibraryCallCredentials(com.google.auth.Credentials creds, GoogleAuthLibraryCallCredentials.JwtHelper jwtHelper)
-
-
Method Details
-
applyRequestMetadata
public void applyRequestMetadata(io.grpc.CallCredentials.RequestInfo info, Executor appExecutor, io.grpc.CallCredentials.MetadataApplier applier) - Specified by:
applyRequestMetadatain classio.grpc.CallCredentials
-
serviceUri
private static URI serviceUri(String authority, io.grpc.MethodDescriptor<?, ?> method) throws io.grpc.StatusExceptionGenerate a JWT-specific service URI. The URI is simply an identifier with enough information for a service to know that the JWT was intended for it. The URI will commonly be verified with a simple string equality check.- Throws:
io.grpc.StatusException
-
removePort
-
toHeaders
-
createJwtHelperOrNull
@Nullable static GoogleAuthLibraryCallCredentials.JwtHelper createJwtHelperOrNull(ClassLoader loader) -
loadGoogleCredentialsClass
-
loadAppEngineCredentials
-
isSpecificExecutorRequired
public boolean isSpecificExecutorRequired()This method is to support the hack for AppEngineCredentials which need to run on a specific thread.- Specified by:
isSpecificExecutorRequiredin interfaceio.grpc.InternalMayRequireSpecificExecutor- Returns:
- Whether a specific executor is needed or if any executor can be used
-