Class: Cql::Auth::PlainTextAuthProvider

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

Overview

Auth provider used for Cassandra's built in authentication.

There is no need to create instances of this class to pass as :auth_provider to Client.connect, instead use the :credentials option and one will be created automatically for you.

Instance Method Summary collapse

Constructor Details

#initialize(username, password) ⇒ PlainTextAuthProvider

Returns a new instance of PlainTextAuthProvider.



11
12
13
14
# File 'lib/cql/auth/plain_text_auth.rb', line 11

def initialize(username, password)
  @username = username
  @password = password
end

Instance Method Details

#create_authenticator(authentication_class) ⇒ Object



16
17
18
19
20
# File 'lib/cql/auth/plain_text_auth.rb', line 16

def create_authenticator(authentication_class)
  if authentication_class == PASSWORD_AUTHENTICATOR_FQCN
    PlainTextAuthenticator.new(@username, @password)
  end
end