Class: Cql::Auth::AuthProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/cql/auth.rb

Overview

Note:

Creating an authenticator must absolutely not block, or the whole connection process will block.

Note:

Auth providers given to Client.connect as the :auth_provider option don't need to be subclasses of this class, but need to implement the same methods. This class exists only for documentation purposes.

An auth provider is a factory for Client::Authenticator instances (or objects matching that interface). Its #create_authenticator will be called once for each connection that requires authentication.

If the authentication requires keeping state, keep that in the authenticator instances, not in the auth provider.

Instance Method Summary collapse

Instance Method Details

#create_authenticator(authentication_class, protocol_version) ⇒ Cql::Client::Authenticator?

Note:

This method must absolutely not block.

Create a new authenticator object. This method will be called once per connection that requires authentication. The auth provider can create different authenticators for different authentication classes, or return nil if it does not support the authentication class.

Parameters:

  • authentication_class (String)

    the authentication class used by the server.

Returns:

  • (Cql::Client::Authenticator, nil)

    an object with an interface matching Client::Authenticator or nil if the authentication class is not supported.


# File 'lib/cql/auth.rb', line 34