Auth provider used for Cassandra’s built in authentication.

Note
No need to instantiate this class manually, use :username and :password options when calling Cassandra.cluster and one will be created automatically for you.

Inherits

Methods

self.

new

(username, password)

Returns a new instance of Password

Parameters:
Name Type Details
username String username to use for authentication to Cassandra
password String password to use for authentication to Cassandra

create_authenticator

(authentication_class)

Returns a Password Authenticator only if org.apache.cassandra.auth.PasswordAuthenticator is given.

Parameters:
Name Type Details
authentication_class String must equal to org.apache.cassandra.auth.PasswordAuthenticator
Returns:
Type Details
Auth::Authenticator when authentication_class == "org.apache.cassandra.auth.PasswordAuthenticator"
nil for all other values of authentication_class
Specifications:
Password#create_authenticator creates a PasswordAuthenticator
authenticator = auth_provider.create_authenticator(standard_authentication_class)
authenticator.initial_response.should == "\x00foo\x00bar"
Password#create_authenticator returns nil when the authentication class is not org.apache.cassandra.auth.PasswordAuthenticator
authenticator = auth_provider.create_authenticator('org.acme.Foo')
authenticator.should be_nil