0
-This is mrflip's fork of "technoweenie's restful-authentication":/technoweenie/restful-authentication/
0
-* Modularize to match security design patterns:
0
-** Authentication (currently: password, browser cookie token, HTTP basic)
0
-** Trust metric (email validation)
0
-** Authorization (stateful roles)
0
-* Add full RSpec and Story test suite
0
+h1. Restful Authentication Generator
0
+This widely-used plugin provides a foundation for securely managing user
0
+* Secure password handling
0
+* Account activation by validating email
0
+* Account approval / disabling by admin
0
+* Rudimentary hooks for authorization and access control.
0
+Several features were updated in May, 2008. The newest version of this plugin
0
+ http://github.com/technoweenie/restful-authentication/tree/master
0
+While a "classic" (backward-compatible) version may be found in
0
+ http://github.com/technoweenie/restful-authentication/tree/classic
0
+ !! important: if you upgrade your site, existing user account !!
0
+ !! passwords will stop working unless you use --old-passwords !!
0
+* "Installation":#INSTALL
0
+* "Compatibility Warning":#COMPATIBILITY
0
+* "New Features":#AWESOME
0
+* "After installing":#POST-INSTALL
0
+See the "wiki":http://github.com/technoweenie/restful-authentication/wikis/home
0
+(or the notes/ directory) if you want to learn more about:
0
+* "Security Design Patterns":Security-Patterns with "snazzy diagram":http://github.com/technoweenie/restful-authentication/tree/master/notes/SecurityFramework.png
0
+* [[Authentication]] -- Lets a visitor identify herself (and lay claim to her corresponding Roles and measure of Trust)
0
+* "Trust Metrics":Trustification -- Confidence we can rely on the outcomes of this visitor's actions.
0
+* [[Authorization]] and Policy -- Based on trust and identity, what actions may this visitor perform?
0
+* [[Access Control]] -- How the Authorization policy is actually enforced in your code (A: hopefully without turning it into a spaghetti of if thens)
0
+* [[Rails Plugins]] for Authentication, Trust, Authorization and Access Control
0
+* [[Tradeoffs]] -- for the paranoid or the curious, a rundown of tradeoffs made in the code
0
+* [[CHANGELOG]] -- Summary of changes to internals
0
+* [[TODO]] -- Ideas for how you can help
0
+These best version of the release notes are in the notes/ directory in the
0
+"source code":http://github.com/technoweenie/restful-authentication/tree/master
0
+-- look there for the latest version. The wiki versions are taken (manually)
0
+***************************************************************************
0
+h2. Exciting new features
0
+There are now RSpec stories that allow expressive, enjoyable tests for the
0
+authentication code. The flexible code for resource testing in stories was
0
+extended from "Ben Mabey's.":http://www.benmabey.com/2008/02/04/rspec-plain-text-stories-webrat-chunky-bacon/
0
+h3. Modularize to match security design patterns:
0
+* Authentication (currently: password, browser cookie token, HTTP basic)
0
+* Trust metric (email validation)
0
+* Authorization (stateful roles)
0
* Leave a flexible framework that will play nicely with other access control / policy definition / trust metric plugins
0
-See the "wiki":http://github.com/mrflip/restful-authentication/wikis/home for notes on
0
-* "Security Design Patterns":Security-Patterns
0
-* [[Authentication]] -- Lets a visitor identify herself (and lay claim to her corresponding Roles and measure of Trust)
0
-* "Trust Metrics":Trustification -- Confidence we can rely on the outcomes of this visitor's actions.
0
-* "Authorization and Policy":Authorization -- Based on trust and identity, what actions may this visitor perform?
0
-* "Access Control":Access-Control -- How the Authorization policy is actually enforced in your code (hopefully without turning it into a spaghetti of if thens)
0
-* "Rails Security Plugins":RailsPlugins -- for Authentication, Trust, Authorization and Access Control
0
+* Added a few helper methods for linking to user pages
0
+* Uniform handling of logout, remember_token
0
+* Stricter email, login field validation
0
+* Minor security fixes -- see CHANGELOG
0
-These best versions are in the notes/ directory in the "source code":http://github.com/mrflip/restful-authentication/tree/master -- look there for the latest version.
0
-The wiki versions are taken (manually) from there.
0
+***************************************************************************
0
+<a id="COMPATIBILITY"/> </a>
0
+h2. Non-backwards compatible Changes
0
-===========================================================================
0
+Here are a few changes in the May 2008 release that increase "Defense in Depth"
0
+but may require changes to existing accounts
0
-Restful Authentication Generator
0
+* If you have an existing site, none of these changes are compelling enough to
0
+ warrant migrating your userbase.
0
+* If you are generating for a new site, all of these changes are low-impact.
0
+ You should apply them.
0
+The new password encryption (using a site key salt and stretching) will break
0
+existing user accounts' passwords. We recommend you use the --old-passwords
0
+option or write a migration tool and submit it as a patch. See the
0
+[[Tradeoffs]] note for more information.
0
+***************************************************************************
0
This is a basic restful authentication generator for rails, taken from
0
acts as authenticated. Currently it requires Rails 1.2.6 or above.
0
@@ -34,76 +100,73 @@ To use:
0
-The first parameter specifies the model that gets created in signup
0
-(typically a user or account model). A model with migration is
0
-created, as well as a basic controller with the create method.
0
+* The first parameter specifies the model that gets created in signup (typically
0
+ a user or account model). A model with migration is created, as well as a
0
+ basic controller with the create method. You probably want to say "User" here.
0
-The second parameter specifies the sessions controller name. This is
0
-the controller that handles the actual login/logout function on the
0
+* The second parameter specifies the session controller name. This is the
0
+ controller that handles the actual login/logout function on the site.
0
+ (probably: "Session").
0
-The third parameter (--include-activation) generates the code for a
0
-ActionMailer and its respective Activation Code through email.
0
+* --include-activation: Generates the code for a ActionMailer and its respective
0
+ Activation Code through email.
0
-The fourth (--stateful) builds in support for acts_as_state_machine and
0
-generates activation code. (--stateful implies --include-activation).
0
+* --stateful: Builds in support for acts_as_state_machine and generates
0
+ activation code. (@--stateful@ implies @--include-activation@). Based on the
0
+ idea at [[http://www.vaporbase.com/postings/stateful_authentication]]. Passing
0
+ @--skip-migration@ will skip the user migration, and @--skip-routes@ will skip
0
+ resource generation -- both useful if you've already run this generator.
0
-http://www.vaporbase.com/postings/stateful_authentication
0
+* --rspec: Generate RSpec tests and Stories in place of standard rails tests.
0
+ "RSpec and Rspec-on-rails plugins":http://rspec.info/
0
+ (make sure you "./script/generate rspec" after installing RSpec.) The rspec
0
+ and story suite are much more thorough than the rails tests, and changes are
0
+ unlikely to be backported.
0
+* --old-passwords: Use the older password scheme (see [[#COMPATIBILITY]], above)
0
-Passing --skip-migration will skip the user migration, and --skip-routes will
0
-skip resource generation -- both useful if you've already run this generator.
0
+* --skip-migration: Don't generate a migration file for this model
0
-Pass --rspec to generate a (more thorough) set of RSpec tests. This
0
-requires the RSpec and Rspec-on-rails plugins: http://rspec.info/
0
+* --skip-routes: Don't generate a resource line in @config/routes.rb@
0
-***************************************************************************
0
-The below assumes a Model named 'User' and a Controller named
0
-'Session'; please alter to suit.
0
-Try these for some familiar login URLs if you like:
0
- map.signup '/signup', :controller => 'users', :action => 'new'
0
- map.signin '/login', :controller => 'session', :action => 'new'
0
- map.signout '/logout', :controller => 'session', :action => 'destroy'
0
-With --include-activation:
0
-* Add a route to config/routes.rb:
0
- map.activate '/activate/:activation_code', :controller => 'users', :action => 'activate', :activation_code => nil)
0
-* Add an observer to config/environment.rb:
0
+***************************************************************************
0
+<a id="POST-INSTALL"/> </a>
0
+The below assumes a Model named 'User' and a Controller named 'Session'; please
0
+alter to suit. There are additional security minutae in @notes/README-Tradeoffs@
0
+-- only the paranoid or the curious need bother, though.
0
+* Add these familiar login URLs to your @config/routes.rb@ if you like:
0
+ map.signup '/signup', :controller => 'users', :action => 'new' @
0
+ map.signin '/login', :controller => 'session', :action => 'new' @
0
+ map.signout '/logout', :controller => 'session', :action => 'destroy' @
0
+* With @--include-activation@, also add to your @config/routes.rb@:
0
+ map.activate '/activate/:activation_code', :controller => 'users', :action => 'activate', :activation_code => nil)
0
+ and add an observer to @config/environment.rb@:
0
config.active_record.observers = :users_observer
0
-* Add an observer to config/environment.rb
0
- config.active_record.observers = :user_observer # or whatever you
0
-* If you're using acts_as_state_machine, define your users resource like this:
0
+* With @--stateful@, add an observer to config/environment.rb:
0
+ config.active_record.observers = :user_observer
0
+ and modify the users resource line to read
0
map.resources :users, :member => { :suspend => :put,
0
-I introduced a change to the model controller that's been tripping
0
-folks up on Rails 2.0. The change was added as a suggestion to help
0
-combat session fixation attacks. However, this resets the Form
0
-Authentication token used by Request Forgery Protection. I've left
0
-it out now, since Rails 1.2.6 and Rails 2.0 will both stop session
0
-fixation attacks anyway.
0
-***************************************************************************
0
-There are now RSpec stories that allow expressive enjoyable tests for the
0
-The flexible code for resource testing came out of code from Ben Mabey
0
-http://www.benmabey.com/2008/02/04/rspec-plain-text-stories-webrat-chunky-bacon/
0
+* If you use a public repository for your code (such as github, rubyforge,
0
+ gitorious, etc.) make sure to NOT post your site_keys.rb (add a line like
0
+ '/config/initializers/site_keys.rb' to your .gitignore or do the svn ignore
0
+ dance), but make sure you DO keep it backed up somewhere safe.
Comments
No one has commented yet.