Permalink
Browse files

Released v1.0.0 (see changelog)

  • Loading branch information...
binarylogic committed Nov 6, 2008
1 parent 06c8289 commit 791f700e5b68117ede77b02fadef31a778c94252
Showing with 270 additions and 9,250 deletions.
  1. +7 −1 CHANGELOG.rdoc
  2. +13 −9 README.rdoc
  3. +1 −1 Rakefile
  4. +5 −0 lib/authlogic.rb
  5. +84 −59 lib/authlogic/active_record/acts_as_authentic.rb
  6. +37 −0 lib/authlogic/active_record/authenticates_many.rb
  7. +5 −7 lib/authlogic/controller_adapters/abstract_adapter.rb
  8. +21 −15 lib/authlogic/controller_adapters/rails_adapter.rb
  9. +63 −115 lib/authlogic/session/base.rb
  10. +29 −13 lib/authlogic/session/callbacks.rb
  11. +5 −1 lib/authlogic/session/config.rb
  12. +0 −10 test_app/.gitignore
  13. +0 −256 test_app/README
  14. +0 −10 test_app/Rakefile
  15. +0 −72 test_app/app/controllers/application.rb
  16. +0 −2 test_app/app/controllers/companies_controller.rb
  17. +0 −25 test_app/app/controllers/user_sessions_controller.rb
  18. +0 −61 test_app/app/controllers/users_controller.rb
  19. +0 −3 test_app/app/helpers/application_helper.rb
  20. +0 −2 test_app/app/helpers/companies_helper.rb
  21. +0 −2 test_app/app/helpers/user_sessions_helper.rb
  22. +0 −2 test_app/app/helpers/users_helper.rb
  23. +0 −4 test_app/app/models/company.rb
  24. +0 −3 test_app/app/models/project.rb
  25. +0 −5 test_app/app/models/user.rb
  26. +0 −3 test_app/app/models/user_session.rb
  27. +0 −27 test_app/app/views/layouts/application.html.erb
  28. +0 −15 test_app/app/views/user_sessions/new.html.erb
  29. +0 −15 test_app/app/views/users/_form.erb
  30. +0 −8 test_app/app/views/users/edit.html.erb
  31. +0 −8 test_app/app/views/users/new.html.erb
  32. +0 −29 test_app/app/views/users/show.html.erb
  33. +0 −109 test_app/config/boot.rb
  34. +0 −69 test_app/config/environment.rb
  35. +0 −17 test_app/config/environments/development.rb
  36. +0 −22 test_app/config/environments/production.rb
  37. +0 −22 test_app/config/environments/test.rb
  38. +0 −10 test_app/config/initializers/inflections.rb
  39. +0 −5 test_app/config/initializers/mime_types.rb
  40. +0 −17 test_app/config/initializers/new_rails_defaults.rb
  41. +0 −11 test_app/config/routes.rb
  42. +0 −20 test_app/db/migrate/20081023040052_create_users.rb
  43. +0 −14 test_app/db/migrate/20081103003828_create_companies.rb
  44. +0 −18 test_app/db/migrate/20081103003834_create_projects.rb
  45. +0 −2 test_app/doc/README_FOR_APP
  46. +0 −30 test_app/public/404.html
  47. +0 −30 test_app/public/422.html
  48. +0 −30 test_app/public/500.html
  49. +0 −10 test_app/public/dispatch.cgi
  50. +0 −24 test_app/public/dispatch.fcgi
  51. +0 −10 test_app/public/dispatch.rb
  52. 0 test_app/public/favicon.ico
  53. BIN test_app/public/images/rails.png
  54. +0 −2 test_app/public/javascripts/application.js
  55. +0 −963 test_app/public/javascripts/controls.js
  56. +0 −972 test_app/public/javascripts/dragdrop.js
  57. +0 −1,120 test_app/public/javascripts/effects.js
  58. +0 −4,225 test_app/public/javascripts/prototype.js
  59. +0 −5 test_app/public/robots.txt
  60. +0 −62 test_app/public/stylesheets/scaffold.css
  61. +0 −4 test_app/script/about
  62. +0 −3 test_app/script/console
  63. +0 −3 test_app/script/dbconsole
  64. +0 −3 test_app/script/destroy
  65. +0 −3 test_app/script/generate
  66. +0 −3 test_app/script/performance/benchmarker
  67. +0 −3 test_app/script/performance/profiler
  68. +0 −3 test_app/script/performance/request
  69. +0 −3 test_app/script/plugin
  70. +0 −3 test_app/script/process/inspector
  71. +0 −3 test_app/script/process/reaper
  72. +0 −3 test_app/script/process/spawner
  73. +0 −3 test_app/script/runner
  74. +0 −3 test_app/script/server
  75. +0 −7 test_app/test/fixtures/companies.yml
  76. +0 −4 test_app/test/fixtures/projects.yml
  77. +0 −21 test_app/test/fixtures/users.yml
  78. +0 −8 test_app/test/functional/companies_controller_test.rb
  79. +0 −36 test_app/test/functional/user_sessions_controller_test.rb
  80. +0 −8 test_app/test/functional/users_controller_test.rb
  81. +0 −46 test_app/test/integration/company_user_session_stories_test.rb
  82. +0 −105 test_app/test/integration/user_sesion_stories_test.rb
  83. +0 −24 test_app/test/integration/user_session_config_test.rb
  84. +0 −161 test_app/test/integration/user_session_test.rb
  85. +0 −81 test_app/test/test_helper.rb
  86. +0 −8 test_app/test/unit/account_test.rb
  87. +0 −8 test_app/test/unit/company_test.rb
  88. +0 −8 test_app/test/unit/project_test.rb
  89. +0 −80 test_app/test/unit/user_test.rb
View
@@ -1,7 +1,13 @@
-== 0.10.5 released 2008-10-31
+== 1.0.0 released 2008-11-05
* Checked for blank login counts, if a default wasnt set in the migrations.
* Added check for database table in acts_as_authentic to avoid errors in initial setup.
+* Completely rewrote tests to be more conventional and thorough tests, removed test_app.
+* Modified how validations work so that a validate method was added as well as callbacks for that method.
+* Extracted scope support into its own module to help organize code better.
+* Added in salt for encryption, just like hashes and removed :crypto_provider_type option for acts_as_authentic.
+* Added merb adapters.
+* Improved documentation throughout.
== 0.10.4 released 2008-10-31
View
@@ -1,12 +1,12 @@
= Authlogic
-Authlogic is "rails authentication done right". Put simply, its the Chuck Norris of authentication solutions.
+Authlogic is a framework agnostic object based authentication solution that handles all of the non sense for you. It's as easy as ActiveRecord is with a database. Put simply, its the Chuck Norris of authentication solutions for rails, merb, etc.
-The last thing we need is another authentication solution for rails, right? That's what I thought until I tried out some of the current solutions. None of them felt right. They were either too complicated, bloated, littered my application with tons of code, or were just confusing. This is not the simple / elegant rails we all fell in love with. We need a "rails like" authentication solution. Authlogic is my attempt to satisfy that need...
+The last thing we need is another authentication solution, right? That's what I thought until I tried out some of the current solutions in both rails and merb. None of them felt right. They were either too complicated, bloated, littered my application with tons of code, or were just confusing. This is not the simple / elegant ruby we all fell in love with. We need a "ruby like" authentication solution. Authlogic is my attempt to satisfy that need...
-Wouldn't it be nice to keep your app up to date with the latest and greatest security techniques with a simple update of a plugin?
+Let's take a rails application, wouldn't it be nice to keep your app up to date with the latest and greatest security techniques with a simple update of a plugin?
-What if you could have authentication up and running in minutes without having to run a generator? All because it's simple, like everything else in rails.
+What if you could have authentication up and running in minutes without having to run a generator? All because it's simple, like everything else.
What if creating a user session could be as simple as...
@@ -35,8 +35,8 @@ What if your user sessions controller could look just like your other controller
Look familiar? If you didn't know any better, you would think UserSession was an ActiveRecord model. I think that's pretty cool, because it fits nicely into the RESTful development pattern, a style we all know and love. What about the view...
- <%= error_messages_for "user_session" %>
<% form_for @user_session do |f| %>
+ <%= f.error_messages %>
<%= f.label :login %><br />
<%= f.text_field :login %><br />
<br />
@@ -282,13 +282,17 @@ Obviously there is a little more to it than this, but hopefully this clarifies a
When things come together like this I think its a sign that you are doing something right. Put that in your pipe and smoke it!
-== What about [insert framework here]?
+== Framework agnostic (Rails, Merb, etc.)
-As of now, authlogic supports rails right out of the box. But I designed authlogic to be framework agnostic. The only thing stopping Authlogic from being implemented in merb, or any other framework, is a simple adapter. I have not had the opportunity to use Authlogic in anything other than rails. If you want to use this in merb or any other framework take a look at authlogic/controller/rails_adapter.rb.
+I designed Authlogic to be framework agnostic, meaning it doesn't care what framework you use it in. Right out of the box it supports rails and merb. I have not had the opportunity to use other frameworks, but the only thing stopping Authlogic from being used in other frameworks is a simple adapter. Check out controller_adapters/rails_adapter, or controller_adapters/merb_adapter.
+
+Since pretty much all of the frameworks in ruby follow the Rack conventions, the code should be very similar across adapters. You're saying "but Ben, why not just hook into Rack and avoid the need for controller adapters all together?". It's not that simple, because rails doesn't inherit from the Rack::Request class, plus there are small differences between how rack is implemented in each framework. Authlogic has to hook into your controller with a before_filter anyways, so it can "activate" itself. Why not just use the controller object?
+
+The point in all of this rambling is that implementing Authlogic is as simple as creating an adapter. I created both the rails and merb adapters in under 10 minutes. If you have an adapter you created and would like to add please let me know and I will add it into the source.
== How it works
-Interested in how all of this all works? Basically a before_filter is automatically set in your controller which lets Authlogic know about the current controller object. This "activates" Authlogic and allows Authlogic to set sessions, cookies, login via basic http auth, etc. If you are using rails in a multiple thread environment, don't worry. I kept that in mind and made this thread safe.
+Interested in how all of this all works? Basically a before_filter is automatically set in your controller which lets Authlogic know about the current controller object. This "activates" Authlogic and allows Authlogic to set sessions, cookies, login via basic http auth, etc. If you are using your framework in a multiple thread environment, don't worry. I kept that in mind and made this thread safe.
From there it is pretty simple. When you try to create a new session the record is authenticated and then all of the session / cookie magic is done for you. The sky is the limit.
@@ -300,7 +304,7 @@ I don't necessarily think the current solutions are "wrong", nor am I saying Aut
=== Generators are messy
-Generators have their place, and it is not to add authentication to a rails app. It doesn't make sense. Generators are meant to be a starting point for repetitive tasks that have no sustainable pattern. Take controllers, the set up is the same thing over and over, but they eventually evolve to a point where there is no clear cut pattern. Trying to extract a pattern out into a library would be extremely hard, messy, and overly complicated. As a result, generators make sense here.
+Generators have their place, and it is not to add authentication to an app. It doesn't make sense. Generators are meant to be a starting point for repetitive tasks that have no sustainable pattern. Take controllers, the set up is the same thing over and over, but they eventually evolve to a point where there is no clear cut pattern. Trying to extract a pattern out into a library would be extremely hard, messy, and overly complicated. As a result, generators make sense here.
Authentication is a one time set up process for your app. It's the same thing over and over and the pattern never really changes. The only time it changes is to conform with newer / stricter security techniques. This is exactly why generators should not be an authentication solution. Generators add code to your application, once code crosses that line, you are responsible for maintaining it. You get to make sure it stays up with the latest and greatest security techniques. And when the plugin you used releases some major update, you can't just re-run the generator, you get to sift through the code to see what changed. You don't really have a choice either, because you can't ignore security updates.
View
@@ -8,7 +8,7 @@ Echoe.new 'authlogic' do |p|
p.author = "Ben Johnson of Binary Logic"
p.email = 'bjohnson@binarylogic.com'
p.project = 'authlogic'
- p.summary = "Rails authentication done right"
+ p.summary = "Framework agnostic object based authentication solution that handles all of the non sense for you. It's as easy as ActiveRecord is with a database."
p.url = "http://github.com/binarylogic/authlogic"
p.dependencies = %w(activesupport activerecord)
p.include_rakefile = true
View
@@ -1,7 +1,10 @@
+require "active_support"
+
require File.dirname(__FILE__) + "/authlogic/version"
require File.dirname(__FILE__) + "/authlogic/controller_adapters/abstract_adapter"
require File.dirname(__FILE__) + "/authlogic/controller_adapters/rails_adapter" if defined?(Rails)
+require File.dirname(__FILE__) + "/authlogic/controller_adapters/merb_adapter" if defined?(Merb)
require File.dirname(__FILE__) + "/authlogic/sha512_crypto_provider"
@@ -13,13 +16,15 @@
require File.dirname(__FILE__) + "/authlogic/session/callbacks"
require File.dirname(__FILE__) + "/authlogic/session/config"
require File.dirname(__FILE__) + "/authlogic/session/errors"
+require File.dirname(__FILE__) + "/authlogic/session/scopes"
require File.dirname(__FILE__) + "/authlogic/session/base"
module Authlogic
module Session
class Base
include ActiveRecordTrickery
include Callbacks
+ include Scopes
end
end
end
Oops, something went wrong.

0 comments on commit 791f700

Please sign in to comment.