perlcassa icon indicating copy to clipboard operation
perlcassa copied to clipboard

Added simple authentication support to perlcassa

Open gsiglet opened this issue 9 years ago • 1 comments

Tried to add authentication support for perlcassa. Please feel free to re-factor. It works for me on a single-node Cassandra 2.1 cluster with PasswordAuthenticator.

 my $client = new perlcassa(
      keyspace => 'mykeyspace,
      hosts => ['localhost'],
      do_not_discover_peers => 1,
      'credentials' => { 'username' => 'cassandra', 'password' => 'cassandra' },
 );
 my $result = $client->exec("SELECT id from my_table limit 1");

gsiglet avatar Mar 23 '15 17:03 gsiglet

Not sure whether perlcassa::Client::check_host should also authenticate. Could add authentication there as well

gsiglet avatar Mar 23 '15 21:03 gsiglet