Giter Club home page Giter Club logo

cassandra-auth's Introduction

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).

cassandra-auth's People

Contributors

dbussink avatar pieterbos avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.