public class ChannelAuthenticator extends Object
GrpcChannelBuilder
.Modifier and Type | Field and Description |
---|---|
protected AuthType |
mAuthType
Authentication type to use with the target host.
|
protected GrpcChannelKey |
mChannelKey
Key for to-be-authenticated channel.
|
protected long |
mGrpcAuthTimeoutMs
gRPC Authentication timeout in milliseconds.
|
protected String |
mImpersonationUser |
protected Subject |
mParentSubject
Subject for authentication.
|
protected String |
mPassword |
protected String |
mUserName |
protected boolean |
mUseSubject
Whether to use mParentSubject as authentication user.
|
Constructor and Description |
---|
ChannelAuthenticator(GrpcChannelKey channelKey,
String userName,
String password,
String impersonationUser,
AuthType authType,
long grpcAuthTimeoutMs)
Creates
ChannelAuthenticator instance. |
ChannelAuthenticator(GrpcChannelKey channelKey,
Subject subject,
AlluxioConfiguration conf)
Creates
ChannelAuthenticator instance. |
Modifier and Type | Method and Description |
---|---|
AuthenticatedChannel |
authenticate(io.grpc.ManagedChannel managedChannel)
Authenticates given
NettyChannelBuilder instance. |
protected boolean mUseSubject
protected Subject mParentSubject
protected String mUserName
protected String mPassword
protected String mImpersonationUser
protected AuthType mAuthType
protected final long mGrpcAuthTimeoutMs
protected final GrpcChannelKey mChannelKey
public ChannelAuthenticator(GrpcChannelKey channelKey, Subject subject, AlluxioConfiguration conf)
ChannelAuthenticator
instance.channelKey
- channel keysubject
- javax subject to use for authenticationconf
- Alluxio configurationpublic ChannelAuthenticator(GrpcChannelKey channelKey, String userName, String password, String impersonationUser, AuthType authType, long grpcAuthTimeoutMs)
ChannelAuthenticator
instance.channelKey
- channel keyuserName
- user namepassword
- user passwordimpersonationUser
- impersonation userauthType
- authentication typegrpcAuthTimeoutMs
- authentication timeout in millisecondspublic AuthenticatedChannel authenticate(io.grpc.ManagedChannel managedChannel) throws AlluxioStatusException
NettyChannelBuilder
instance. It attaches required interceptors to
the channel based on authentication type.managedChannel
- the managed channel for which authentication is taking placeUnauthenticatedException
AlluxioStatusException
Copyright © 2023. All Rights Reserved.