Giter Club home page Giter Club logo

bolt's Introduction

= Bolt

Bolt is yet another authentication/authorization plugin for Ruby on
Rails, implemented as a Rails Engine.  It is a full service plugin,
providing models, controllers, and views.

Authentication and Authorization are both provided by the plugin.
There is also support for working with any loaded class for
authentication, making it easy to authenticate with an external source
such as LDAP.


== Status

As of December 29, 2008:

Bolt is currently being used in production.  It has a health set of
unit and functional tests that are all passing for Rails 1.2.6.  I'm
currently working on some small changes to get all tests for Rails
2.2.2 passing.


== Creating Users

Bolt uses a table called identities that might look very similar to
your users table.  The duplication is necessary to support different
authentication sources.  It also means that when you create a new user
record, you must also create a new Bolt identity record.

This is done using the +create_bolt_identity+ method on your user
object.  Documentation for method can be found in Bolt::UserModelExt.

Also see the script/createuser script for an example of how to
create a user and identity.

In a future version of Bolt, identity creation will be automatic and
you won't need to call +create_bolt_identity+.


== Authentication

The Bolt plugin provides a SessionsController that performs the work
of authenticating and logging a user in.  You can request that a user
be authenticated by using the +require_authentication+ class method in
your controller.

See Bolt::Authentication::ClassMethods for more details about
requesting that authentication happen.

There are a few authentication state helper methods added to all your
controllers and views.  You can read about these helpers in
Bolt::State.  These helpers include +current_user+.


== Authorization

Authorization is achieved through roles. Users are associated with
roles, and roles have specific permissions.  Each user can optionally
be associated with one or more roles, and a role can have any number
of permissions.

There are a number of authorization helper methods that are added to
your user model class.  You can find out more information about these
methods, such as <tt>can?</tt> in the Bolt::UserModelExt
module.

You can have your controller perform authorization by using the
+require_authorization+ class method.  

For more specific information about authorization, please see
Bolt::Authorization.


== Authenticating With an External Source

1. Write a class that looks like the Identity class
2. Set Bolt::Config.backend


== History

Bolt is a derivative of Peter Jones' Rauth plugin for Rails, which
itself was taken from the Devalot Rails application.


== Rauth Comparison

Since Bolt is derived from Rauth, it might be useful to compare the
two.  The biggest difference is that Bolt is a Rails Engine, whereas
Rauth is a traditional Rails plugin.

Bolt is also greatly simplified.  The bridge and account creator code
has been removed, and all configuration options have been moved to a
single class (Bolt::Config).

Rauth limited you to one role per person.  Bolt allows a single user
to belong to many roles.  This is more in-line with the Unix group
philosophy.


== Converting from Rauth

A conversion script is in the works.  Stay tuned.


== Credits

The primary author and maintainer of Bolt is Peter Jones.  Bolt is an
open source project, and has thus has received help from many
developers:

* Eric Harris-Braun

bolt's People

Contributors

pjones avatar zippy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.