public class ChannelAuthenticator extends Object
GrpcChannelBuilder
.Modifier and Type | Field and Description |
---|---|
protected AuthType |
mAuthType
Authentication type to use with the target host.
|
protected UUID |
mChannelId
Internal ID used to identify the channel that is being authenticated.
|
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(String userName,
String password,
String impersonationUser,
AuthType authType,
long grpcAuthTimeoutMs)
Creates
ChannelAuthenticator instance. |
ChannelAuthenticator(Subject subject,
AlluxioConfiguration conf)
Creates
ChannelAuthenticator instance. |
Modifier and Type | Method and Description |
---|---|
AuthenticatedChannel |
authenticate(GrpcServerAddress serverAddress,
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 UUID mChannelId
public ChannelAuthenticator(Subject subject, AlluxioConfiguration conf)
ChannelAuthenticator
instance.subject
- javax subject to use for authenticationconf
- Alluxio configurationpublic ChannelAuthenticator(String userName, String password, String impersonationUser, AuthType authType, long grpcAuthTimeoutMs)
ChannelAuthenticator
instance.userName
- user namepassword
- user passwordimpersonationUser
- impersonation userauthType
- authentication typegrpcAuthTimeoutMs
- authentication timeout in millisecondspublic AuthenticatedChannel authenticate(GrpcServerAddress serverAddress, io.grpc.ManagedChannel managedChannel) throws AlluxioStatusException
NettyChannelBuilder
instance. It attaches required interceptors to
the channel based on authentication type.serverAddress
- the remote address to which the given channel has been openedmanagedChannel
- the managed channel for whch authentication is taking placeUnauthenticatedException
AlluxioStatusException
Copyright © 2023. All Rights Reserved.