So in my foray into the rails templates world I’ve stumbled onto a couple of authentication options that I wasn’t previously aware of.
“Authlogic”:http://github.com/binarylogic/authlogic/tree/master which is nice in that it moves all the actual authentication logic into a gem to make updates dead simple. The one thing I didn’t like was that you have to generate all of your own MVC code. Though honestly this isn’t such an issue now that I have it all rolled in to a “Rails 2.3 template”:https://github.com/pixels-and-bits/strappy/tree
“Clearance”:https://github.com/thoughtbot/clearance/tree is also nice in that it generates the MVC code yet still keeps all the authentication logic in a gem for easy updates. The only thing I didn’t really care for, though I do understand why they did it, is the inability to choose the hash algorithm.
Along comes “ClearanceCrypto”:https://github.com/pixels-and-bits/clearance_crypto/tree this provides a very similar way to choose the hashing algorithm like you can in Authlogic. The code was picked and tweaked from the Authlogic code to match the way Clearance checks the authentication.
It’s very new and may have issues. Feel free to let me know if you find anything.
And yet another big change to “Strappy”:http://github.com/pixels-and-bits/strappy/tree/master there is a new branch that allows you to choose the authentication method you want to use (“Authlogic”:http://github.com/binarylogic/authlogic/tree/master, “Clearance”:https://github.com/thoughtbot/clearance/tree or “restful_authentication”:https://github.com/UnderpantsGnome/restful_authentication/tree) it’s currently located in a “branch called choosy”:http://github.com/pixels-and-bits/strappy/tree/choosy but will probably be moving to master soon.
So of course as soon as I finished adding in the coverage to restful_authentication I found “Authlogic”:http://github.com/binarylogic/authlogic/tree/master…
So I went and revamped “Strappy”:http://github.com/pixels-and-bits/strappy/tree/master to use Authlogic and bootstrap a ready to roll app with user logins and password resets. The original version using restful_authentication is still there in a “branch”:http://github.com/pixels-and-bits/strappy/tree/restful_authentication.
So I went and “forked the restful_authentication”:https://github.com/UnderpantsGnome/restful_authentication/tree plugin/generator and added in the tiny bit of specs it needed to give you a clean slate when using it. No more excuses for slacking coverage.
I read an “article by Stpehen Celis”:http://stephencelis.com/archive/2008/9/rails-controllers-views-and-variables way back when and liked the idea behind it, but not having to add the methods to all my controllers. So I rolled it up into a gem and can now get the same functionality by doing
class FooController < ApplicationController
and get the foo and foos methods plus the helper_methods.
You can find it on "github":http://github.com/UnderpantsGnome/expose_model/tree/master