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 booleancanAuthenticateWith(SimpleTarantoolCredentials credentials)Check if the passed instance ofSimpleTarantoolCredentialscan be used for authenticationbooleancanSkipAuth(SimpleTarantoolCredentials credentials)Check if the passed instance ofSimpleTarantoolCredentialscan be used for authenticationTarantoolAuthMechanismgetMechanism()Returns the supportedTarantoolAuthMechanismbyte[]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:
getMechanismin interfaceTarantoolAuthenticator<SimpleTarantoolCredentials>- Returns:
TarantoolAuthMechanism.CHAPSHA1- See Also:
TarantoolAuthMechanism
-
canAuthenticateWith
public boolean canAuthenticateWith(SimpleTarantoolCredentials credentials)
Check if the passed instance ofSimpleTarantoolCredentialscan be used for authentication- Specified by:
canAuthenticateWithin 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 ofSimpleTarantoolCredentialscan be used for authentication- Specified by:
canSkipAuthin interfaceTarantoolAuthenticator<SimpleTarantoolCredentials>- Parameters:
credentials- Tarantool user credentials- Returns:
- true, if the guest is implicit
-
prepareUserAuthData
public byte[] prepareUserAuthData(byte[] serverAuthData, SimpleTarantoolCredentials credentials) throws TarantoolAuthenticationExceptionTake 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:
prepareUserAuthDatain 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
-
-