Latest commit 0100d18
Mar 27, 2013
|Failed to load latest commit information.|
Authentication and authorization provider for Cassandra This project implements an IAuthenticator and IAuthority2 interface usable for Cassandra authentication. It stores the credentials in Cassandra itself, using the following column family definitions. They are described as CQL3 definitions. This implementation of authentication and authorization has led to the inclusion of a very similar implementation in cassandra version 1.2. Users of cassandra 1.2 can now use the built-in functionality instead of this library, which includes built-in commands for adding and listing users and authorizations. CREATE KEYSPACE access WITH strategy_class = 'org.apache.cassandra.locator.AllNodeStrategy'; CREATE TABLE users ( username varchar PRIMARY KEY, password varchar ); CREATE TABLE permissions ( username varchar, resource varchar, permissions bigint, PRIMARY KEY (username, resource)) WITH COMPACT STORAGE; INSERT INTO users (username, password) VALUES ('admin', '65536:256:b987965bf13ae010:7bc9e5e6f76e8a1424d9a44c9f5648e7b58da35a315b46049bbca360b3609d78'); INSERT INTO permissions (username, resource, permissions) VALUES ('admin', '/cassandra/keyspaces', 8791798056959); The passwords can be generated by building the jar file. This can be done by executing mvn package. After this you can run the password generator: java -jar target/cassandra-auth-1.0.jar When entering the password it will output the entry for that password that needs to be stored. The permissions is a long which is composed of two 32 bit masks, one for the grant rights and one for the access rights. The bitmask shown here grants all the access to this user (Permission.ALL).