Package io.tarantool.driver.auth
Class ChapSha1TarantoolAuthenticator
- java.lang.Object
-
- io.tarantool.driver.auth.ChapSha1TarantoolAuthenticator
-
- All Implemented Interfaces:
TarantoolAuthenticator<SimpleTarantoolCredentials>
public class ChapSha1TarantoolAuthenticator extends Object implements TarantoolAuthenticator<SimpleTarantoolCredentials>
This authenticator performs authentication to the Tarantool server using default mechanism (chap-sha1) and the provided plain user credentials.
-
-
Constructor Summary
Constructors Constructor Description ChapSha1TarantoolAuthenticator()
Basic constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canAuthenticateWith(SimpleTarantoolCredentials credentials)
Check if the passed instance ofSimpleTarantoolCredentials
can be used for authenticationboolean
canSkipAuth(SimpleTarantoolCredentials credentials)
Check if the passed instance ofSimpleTarantoolCredentials
can be used for authenticationTarantoolAuthMechanism
getMechanism()
Returns the supportedTarantoolAuthMechanism
byte[]
prepareUserAuthData(byte[] serverAuthData, SimpleTarantoolCredentials credentials)
Take the salt from the server connect response, write the authentication data based on the providedSimpleTarantoolCredentials
.
-
-
-
Method Detail
-
getMechanism
public TarantoolAuthMechanism getMechanism()
Returns the supportedTarantoolAuthMechanism
- Specified by:
getMechanism
in interfaceTarantoolAuthenticator<SimpleTarantoolCredentials>
- Returns:
TarantoolAuthMechanism.CHAPSHA1
- See Also:
TarantoolAuthMechanism
-
canAuthenticateWith
public boolean canAuthenticateWith(SimpleTarantoolCredentials credentials)
Check if the passed instance ofSimpleTarantoolCredentials
can be used for authentication- Specified by:
canAuthenticateWith
in interfaceTarantoolAuthenticator<SimpleTarantoolCredentials>
- Parameters:
credentials
- Tarantool user credentials- Returns:
- true, if the username and password are not empty
-
canSkipAuth
public boolean canSkipAuth(SimpleTarantoolCredentials credentials)
Check if the passed instance ofSimpleTarantoolCredentials
can be used for authentication- Specified by:
canSkipAuth
in interfaceTarantoolAuthenticator<SimpleTarantoolCredentials>
- Parameters:
credentials
- Tarantool user credentials- Returns:
- true, if the guest is implicit
-
prepareUserAuthData
public byte[] prepareUserAuthData(byte[] serverAuthData, SimpleTarantoolCredentials credentials) throws TarantoolAuthenticationException
Take the salt from the server connect response, write the authentication data based on the providedSimpleTarantoolCredentials
. See https://www.tarantool.io/en/doc/latest/dev_guide/internals/box_protocol/#binary-protocol-authentication- Specified by:
prepareUserAuthData
in interfaceTarantoolAuthenticator<SimpleTarantoolCredentials>
- Parameters:
serverAuthData
- the auth data responded by server to the connect requestcredentials
- Tarantool user credentials- Returns:
- binary data for authentication request according to the chap-sha1 algorithm
- Throws:
TarantoolAuthenticationException
- id authentication failed- See Also:
- https://www.tarantool.io/en/doc/latest/dev_guide/internals/box_protocol/#binary-protocol-authentication
-
-