Skip to content

Commit

Permalink
Release v2.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
binarylogic committed Apr 25, 2009
1 parent d23f64e commit 8c8e079
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rdoc
@@ -1,11 +1,12 @@
== 2.0.11
== 2.0.11 release 2009-4-25

* Fix bug when password is turned off and the SingleAccessToken module calls the after_password_set callback.
* HTTP basic auth can now be toggled on or off. It also checks for the existence of a standard username and password before enabling itself.
* Added option check_passwords_against_database for Authlogic::ActsAsAuthentic::Password to toggle between checking the password against the database value or the object value. Also added the same functionality to the instance method: valid_password?("password", true), where the second argument tells Authlogic to check the password against the database value. The default for this new feature is true.
* Add a maintain_sessions configuration option to Authlogic::ActsAsAuthentic::SessionMaintenance as a "clearer" option to disable automatic session maintenance.
* single_access_allowed_request_types can also be equal to :all instead of just [:all].
* Refactor params_enabled? so that the single_access_allowed? method in controllers takes precedence.
* Added testing comments in the README and expanded on the documentation in Authlogic::TestCase

== 2.0.10 release 2009-4-21

Expand Down
8 changes: 4 additions & 4 deletions README.rdoc
Expand Up @@ -4,7 +4,7 @@ Authlogic is a clean, simple, and unobtrusive ruby authentication solution.

A code example can replace a thousand words...

Authlogic introduces a new type of model. You can have as many as you want, and name them whatever you want. In this case we are authenticating with a User model, which is inferred by the name:
Authlogic introduces a new type of model. You can have as many as you want, and name them whatever you want, just like your other models. In this example we want to authenticate with the User model, which is inferred by the name:

class UserSession < Authlogic::Session::Base
end
Expand All @@ -16,7 +16,7 @@ Log in with any of the following. Use it just like your other models:
session = UserSession.new(:login => "bjohnson", :password => "my password"); session.save
UserSession.create(:openid_identifier => "identifier") # requires the authlogic-oid "add on" gem

After a session has been created, you can persist it across requests:
After a session has been created, you can persist it across requests. Thus keeping the user logged in:

session = UserSession.find

Expand Down Expand Up @@ -189,15 +189,15 @@ I think one of the best aspects of Authlogic is testing. For one, it cuts out <b

For example, think about ActiveRecord. You don't test the internals of ActiveRecord, because the creators of ActiveRecord have already tested the internals for you. It wouldn't make sense for ActiveRecord to copy it's hundreds of tests into your applications. The same concept applies to Authlogic. You only need to test code you write that is specific to your application, just like everything else in your application.

That being said, testing your code that uses Authlogic is easy. Since everyone uses a different testing suite, I created a helpful module called Authlogic::TestCase, which is basically a set of tools for testing authlogic. I explain testing Authlogic thoroughly in the {Authlogic::TestCase section of the documentation}[http://authlogic.rubyforge.org/classes/Authlogic/TestCase.html]. It should answer any questions you have in regards to testing Authlogic.
That being said, testing your code that uses Authlogic is easy. Since everyone uses different testing suites, I created a helpful module called Authlogic::TestCase, which is basically a set of tools for testing code using Authlogic. I explain testing Authlogic thoroughly in the {Authlogic::TestCase section of the documentation}[http://authlogic.rubyforge.org/classes/Authlogic/TestCase.html]. It should answer any questions you have in regards to testing Authlogic.

== Tell me quickly how Authlogic works

Interested in how all of this all works? Think about an ActiveRecord model. A database connection must be established before you can use it. In the case of Authlogic, a controller connection must be established before you can use it. It uses that controller connection to modify cookies, the current session, login with HTTP basic, etc. It connects to the controller through a before filter that is automatically set in your controller which lets Authlogic know about the current controller object. Then Authlogic leverages that to do everything, it's a pretty simple design.

== What sets Authlogic apart and why I created it

What inspired me to create Authlogic was the messiness of the current authentication solutions. Put simply, they just didn't feel right, because the logic was not organized properly. As you may know, a common misconception with the MVC design pattern is that the model "M" is only for data access logic, which is wrong. A model is a place for domain logic. This is why the RESTful design pattern and the current authentication solutions don't play nice. Authlogic solves this by placing the session maintenance logic into its own domain (aka "model").Moving session maintenance into its own domain has its benefits:
What inspired me to create Authlogic was the messiness of the current authentication solutions. Put simply, they just didn't feel right, because the logic was not organized properly. As you may know, a common misconception with the MVC design pattern is that the model "M" is only for data access logic, which is wrong. A model is a place for domain logic. This is why the RESTful design pattern and the current authentication solutions don't play nice. Authlogic solves this by placing the session maintenance logic into its own domain (aka "model"). Moving session maintenance into its own domain has its benefits:

1. <b>It's cleaner.</b> There are no generators in Authlogic. Authlogic provides a class that you can use, it's plain and simple ruby. More importantly, the code in your app is code you write, written the way you want, nice and clean. It's code that should be in your app and is specific to your app, not a redundant authentication pattern.
2. <b>Easier to stay up-to-date.</b> To make my point, take a look at the commits to any other authentication solution, then look at the {commits for authlogic}[http://github.com/binarylogic/authlogic/commits/master]. How many commits could you easily start using if you already had an app using that solution? With an alternate solution, very few, if any. All of those cool new features and bug fixes are going to have be manually added or wait for your next application. Which is the main reason a generator is not suitable as an authentication solution. With Authlogic you can start using the latest code with a simple update of a gem. No generators, no mess.
Expand Down
15 changes: 10 additions & 5 deletions lib/authlogic/test_case.rb
Expand Up @@ -5,20 +5,25 @@
require File.dirname(__FILE__) + "/test_case/mock_request"

module Authlogic
# I get a lot of questions about how to properly test with Authlogic. As a result, I did my due diligence writing this
# documentation. I apologize if it is a little wordy, but my intention is to cover every aspect of testing.
#
# To get started, this module is a collection of methods and classes that help you easily test Authlogic. In fact,
# This module is a collection of methods and classes that help you easily test Authlogic. In fact,
# I use these same tools to test the internals of Authlogic.
#
# === The quick and dirty
#
# require "authlogic/test_case" # include at the top of test_helper.rb
# setup :activate_authlogic # run before tests are executed
# UserSession.create(users(:whomever)) # logs a user in
#
# For a more detailed explanation, see below.
#
# === Setting up
#
# Authlogic comes with some simple testing tools. To get these, you need to first require Authlogic's TestCase. If
# you are doing this in a rails app, you would require this file at the top of your test_helper.rb file:
#
# require "authlogic/test_case"
#
# If you are using Test::Unit::TestCase, the standard testing library that comes with ruby, then you can skip this part.
# If you are using Test::Unit::TestCase, the standard testing library that comes with ruby, then you can skip this next part.
# If you are not, you need to include the Authlogic::TestCase into your testing suite as follows:
#
# include Authlogic::TestCase
Expand Down
2 changes: 1 addition & 1 deletion lib/authlogic/version.rb
Expand Up @@ -41,7 +41,7 @@ def to_a

MAJOR = 2
MINOR = 0
TINY = 10
TINY = 11

# The current version as a Version instance
CURRENT = new(MAJOR, MINOR, TINY)
Expand Down

0 comments on commit 8c8e079

Please sign in to comment.