Package io.tarantool.driver.auth
Interface TarantoolAuthenticator<T extends TarantoolCredentials>
-
- Type Parameters:
T
- user credentials type
- All Known Implementing Classes:
ChapSha1TarantoolAuthenticator
public interface TarantoolAuthenticator<T extends TarantoolCredentials>
Prepares authentication data for passing to Tarantool
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canAuthenticateWith(T credentials)
Check if the passed instance ofTarantoolCredentials
can be used for authenticationboolean
canSkipAuth(T credentials)
Сheck if we can connect to the Tarantool without authenticationTarantoolAuthMechanism
getMechanism()
Return the authentication mechanism signaturebyte[]
prepareUserAuthData(byte[] serverAuthData, T credentials)
Takes the server auth data returned in response for the connect request and user auth data, performs the necessary transformations and writes the serialized authentication data to a byte array
-
-
-
Method Detail
-
getMechanism
TarantoolAuthMechanism getMechanism()
Return the authentication mechanism signature- Returns:
- authentication mechanism instance
- See Also:
TarantoolAuthMechanism
-
canAuthenticateWith
boolean canAuthenticateWith(T credentials)
Check if the passed instance ofTarantoolCredentials
can be used for authentication- Parameters:
credentials
- Tarantool user credentials- Returns:
true
if the credentials data are sufficient for performing authentication
-
canSkipAuth
boolean canSkipAuth(T credentials)
Сheck if we can connect to the Tarantool without authentication- Parameters:
credentials
- Tarantool user credentials- Returns:
true
if the credentials are suitable so as not to use them for authentication
-
prepareUserAuthData
byte[] prepareUserAuthData(byte[] serverAuthData, T credentials) throws TarantoolAuthenticationException
Takes the server auth data returned in response for the connect request and user auth data, performs the necessary transformations and writes the serialized authentication data to a byte array- Parameters:
serverAuthData
- bytes with auth data from the Tarantool server greetingcredentials
- Tarantool user credentials- Returns:
- the auth data in the form of byte array, ready to be transferred in an authentication request to Tarantool server
- Throws:
TarantoolAuthenticationException
- id authentication failed- See Also:
- https://www.tarantool.io/en/doc/latest/dev_guide/internals/box_protocol/#binary-protocol-authentication
-
-