All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.tarantool.driver.auth.TarantoolAuthenticator Maven / Gradle / Ivy

Go to download

Tarantool Cartridge driver for Tarantool versions 1.10+ based on Netty framework

There is a newer version: 0.14.0
Show newest version
package io.tarantool.driver.auth;

/**
 * Prepares authentication data for passing to Tarantool
 *
 * @param  user credentials type
 * @author Alexey Kuzin
 */
public interface TarantoolAuthenticator {

    /**
     * Return the authentication mechanism signature
     * @return authentication mechanism instance
     * @see TarantoolAuthMechanism
     */
    TarantoolAuthMechanism getMechanism();

    /**
     * Check if the passed instance of {@link TarantoolCredentials} can be used for authentication
     * @param credentials Tarantool user credentials
     * @return {@code true} if the credentials data are sufficient for performing authentication
     */
    boolean canAuthenticateWith(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
     * @param serverAuthData bytes with auth data from the Tarantool server greeting
     * @param credentials Tarantool user credentials
     * @return 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 
     *     https://www.tarantool.io/en/doc/latest/dev_guide/internals/box_protocol/#binary-protocol-authentication
     */
    byte[] prepareUserAuthData(byte[] serverAuthData, T credentials) throws TarantoolAuthenticationException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy