Git Product home page Git Product logo

openid_active_record_store's Introduction

OpenidActiveRecordStore

Introduction

ActiveRecord Store driver for ruby-openid (rails plugin)

In the beginning I thought using as little libraries as possible and was going to write a driver for mysql. Instead I opted for active-record. this trade gave this plugin the capability of accessing various databases and abstract details away from what this plugin really is suppose to do.

This CLONE brings ruby 1.9.2 compatibility and Heroku (postgres) friendliness.

Who should use this?

By using this plugin you can now sync your cluster and make sure all openid transactions are being redirected to the right place.

If your server is an independent machine you'll probably don't need this unless you really, really want the openid transactions to live in your database

Reliability === Tests

How well tested is this library?

All tests found in this plugin are an exact-copy of the ones found in the original ruby-openid library. By doing that this plugin certifies that at least that-minimum-coverage is being supported

Note: only tests concerning the store-drivers where copied

Which testing-framework is being used? well.. if your thinking BDD the only thing I have to say is that an experienced programmer should be able to do BDD with almost any testing-framework, BDD is not in the framework but in how you code. and trully a lot of smart BDDing is achieved by refactoring

This plugin is compatible with the rails default-testing-engine. If what you want to do is to test if the plugin works. Then it should pass the tests right out of the box.

If your using another testing-framework then create a brand-new rails-app and run the plugin tests (see the known bugs section)

Known bugs

The ActiveRecord Sqlite driver does not escape properly and it fails to insert data sometimes depending on the complexity of the cryptography that is generated by the ruby-openid gem

So until that problem is fixed or someone decides to patch up this plugin and sanitize stuff before they are handled to active record I wouldn't recomend it for production use.

Installation

  1. Install the plugin Note: (this will add two migrations and three models to your application)

    
    $ ./script/plugin install git://github.com/artemave/openid_active_record_store.git
    

  2. Migrate

    
    $ rake db:migrate
    

  3. Setup pass the store object to the openid consumer

    
    store = OpenID::Store::ActiveRecord.new
    OpenID::Consumer.new(session, store)
    

  4. Enjoy!

Installation Notes

If you are using an authentication plugin for openid you might have to patch that code yourself and tell it to use this storage-driver.

Specifics could be very different depending on how you have it set it up. basically the (number 3) is all you need to know and twick to get it to work.

I personally recomend that you implement your own openid athentication system.

Twicks

There is an abstract parent model for the openid models in this distribution so if you want to store all of your openid transactions in another database you only need to add a line like this.



class OpenidAbstract < ActiveRecord::Base

  # Append this line, and edit the corresponding configuration in your
  # (config/database.yml) file
  # Note: do this by creating a new model with the same name in your
  # app and simply overload, so if you need plugin updates you dont
  # need to repatch anything.
  establish_connection(:openid_active_record_store)

  def self.abstract_class?
    true
  end

end


Dependencies

  • Rails 2.3.2
  • ruby-openid-2.1.4
  • ftools
  • time
  • md5

Works on / tested under

  • ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
  • Rails 2.3.2

LICENSE

Copyright (c) 2009 [Kazuyoshi Tlacaelel], released under the MIT license

The End

openid_active_record_store's People

Contributors

ktlacaelel avatar artemave avatar maxim avatar

Stargazers

 avatar  avatar Scott Diedrick avatar

Watchers

James Cloos 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.