forked from rails/open_id_authentication
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated OpenIdAuthentication to use Ruby OpenID 2.x.x gem (closes #10…
…604) [Josh Peek] git-svn-id: http://svn.rubyonrails.org/rails/plugins/open_id_authentication@9103 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
- Loading branch information
josh
committed
Mar 27, 2008
1 parent
27db6c7
commit a3758ca
Showing
18 changed files
with
189 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ def manifest | |
m.migration_template 'migration.rb', 'db/migrate' | ||
end | ||
end | ||
end | ||
end |
20 changes: 20 additions & 0 deletions
20
generators/open_id_authentication_tables/templates/migration.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class <%= class_name %> < ActiveRecord::Migration | ||
def self.up | ||
create_table :open_id_authentication_associations, :force => true do |t| | ||
t.integer :issued, :lifetime | ||
t.string :handle, :assoc_type | ||
t.binary :server_url, :secret | ||
end | ||
|
||
create_table :open_id_authentication_nonces, :force => true do |t| | ||
t.integer :timestamp, :null => false | ||
t.string :server_url, :null => true | ||
t.string :salt, :null => false | ||
end | ||
end | ||
|
||
def self.down | ||
drop_table :open_id_authentication_associations | ||
drop_table :open_id_authentication_nonces | ||
end | ||
end |
26 changes: 26 additions & 0 deletions
26
generators/upgrade_open_id_authentication_tables/templates/migration.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class <%= class_name %> < ActiveRecord::Migration | ||
def self.up | ||
drop_table :open_id_authentication_settings | ||
drop_table :open_id_authentication_nonces | ||
create_table :open_id_authentication_nonces, :force => true do |t| | ||
t.integer :timestamp, :null => false | ||
t.string :server_url, :null => true | ||
t.string :salt, :null => false | ||
end | ||
end | ||
|
||
def self.down | ||
drop_table :open_id_authentication_nonces | ||
|
||
create_table :open_id_authentication_nonces, :force => true do |t| | ||
t.integer :created | ||
t.string :nonce | ||
end | ||
|
||
create_table :open_id_authentication_settings, :force => true do |t| | ||
t.string :setting | ||
t.binary :value | ||
end | ||
end | ||
end |
11 changes: 11 additions & 0 deletions
11
.../upgrade_open_id_authentication_tables/upgrade_open_id_authentication_tables_generator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class UpgradeOpenIdAuthenticationTablesGenerator < Rails::Generator::NamedBase | ||
def initialize(runtime_args, runtime_options = {}) | ||
super | ||
end | ||
|
||
def manifest | ||
record do |m| | ||
m.migration_template 'migration.rb', 'db/migrate' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
begin | ||
gem 'ruby-openid', '=1.1.4' | ||
require 'openid' | ||
require 'openid' | ||
rescue LoadError | ||
puts "Install the ruby-openid gem to enable OpenID support" | ||
begin | ||
gem 'ruby-openid', '>=2.0.4' | ||
rescue Gem::LoadError | ||
puts "Install the ruby-openid gem to enable OpenID support" | ||
end | ||
end | ||
|
||
ActionController::Base.send :include, OpenIdAuthentication | ||
ActionController::Base.send :include, OpenIdAuthentication |
28 changes: 0 additions & 28 deletions
28
lib/generators/open_id_authentication_tables/templates/migration.rb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ def from_record | |
OpenID::Association.new(handle, secret, issued, lifetime, assoc_type) | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.