czak-authlogic-oid 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +25 -0
- data/MIT-LICENSE +20 -0
- data/Manifest.txt +38 -0
- data/README.rdoc +93 -0
- data/Rakefile +21 -0
- data/init.rb +1 -0
- data/lib/authlogic_openid/acts_as_authentic.rb +169 -0
- data/lib/authlogic_openid/session.rb +96 -0
- data/lib/authlogic_openid/version.rb +51 -0
- data/lib/authlogic_openid.rb +6 -0
- data/test/acts_as_authentic_test.rb +105 -0
- data/test/fixtures/users.yml +9 -0
- data/test/libs/open_id_authentication/CHANGELOG +35 -0
- data/test/libs/open_id_authentication/README +231 -0
- data/test/libs/open_id_authentication/Rakefile +22 -0
- data/test/libs/open_id_authentication/generators/open_id_authentication_tables/open_id_authentication_tables_generator.rb +11 -0
- data/test/libs/open_id_authentication/generators/open_id_authentication_tables/templates/migration.rb +20 -0
- data/test/libs/open_id_authentication/generators/upgrade_open_id_authentication_tables/templates/migration.rb +26 -0
- data/test/libs/open_id_authentication/generators/upgrade_open_id_authentication_tables/upgrade_open_id_authentication_tables_generator.rb +11 -0
- data/test/libs/open_id_authentication/init.rb +18 -0
- data/test/libs/open_id_authentication/lib/open_id_authentication/association.rb +9 -0
- data/test/libs/open_id_authentication/lib/open_id_authentication/db_store.rb +55 -0
- data/test/libs/open_id_authentication/lib/open_id_authentication/mem_cache_store.rb +73 -0
- data/test/libs/open_id_authentication/lib/open_id_authentication/nonce.rb +5 -0
- data/test/libs/open_id_authentication/lib/open_id_authentication/request.rb +23 -0
- data/test/libs/open_id_authentication/lib/open_id_authentication/timeout_fixes.rb +20 -0
- data/test/libs/open_id_authentication/lib/open_id_authentication.rb +244 -0
- data/test/libs/open_id_authentication/tasks/open_id_authentication_tasks.rake +30 -0
- data/test/libs/open_id_authentication/test/mem_cache_store_test.rb +151 -0
- data/test/libs/open_id_authentication/test/normalize_test.rb +32 -0
- data/test/libs/open_id_authentication/test/open_id_authentication_test.rb +46 -0
- data/test/libs/open_id_authentication/test/status_test.rb +14 -0
- data/test/libs/open_id_authentication/test/test_helper.rb +17 -0
- data/test/libs/rails_trickery.rb +41 -0
- data/test/libs/user.rb +3 -0
- data/test/libs/user_session.rb +2 -0
- data/test/session_test.rb +32 -0
- data/test/test_helper.rb +78 -0
- metadata +115 -0
data/test/test_helper.rb
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
require "test/unit"
|
2
|
+
require "rubygems"
|
3
|
+
require "ruby-debug"
|
4
|
+
require "active_record"
|
5
|
+
|
6
|
+
ActiveRecord::Schema.verbose = false
|
7
|
+
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :dbfile => ":memory:")
|
8
|
+
ActiveRecord::Base.configurations = true
|
9
|
+
ActiveRecord::Schema.define(:version => 1) do
|
10
|
+
create_table :open_id_authentication_associations, :force => true do |t|
|
11
|
+
t.integer :issued, :lifetime
|
12
|
+
t.string :handle, :assoc_type
|
13
|
+
t.binary :server_url, :secret
|
14
|
+
end
|
15
|
+
|
16
|
+
create_table :open_id_authentication_nonces, :force => true do |t|
|
17
|
+
t.integer :timestamp, :null => false
|
18
|
+
t.string :server_url, :null => true
|
19
|
+
t.string :salt, :null => false
|
20
|
+
end
|
21
|
+
|
22
|
+
create_table :users do |t|
|
23
|
+
t.datetime :created_at
|
24
|
+
t.datetime :updated_at
|
25
|
+
t.integer :lock_version, :default => 0
|
26
|
+
t.string :login
|
27
|
+
t.string :crypted_password
|
28
|
+
t.string :password_salt
|
29
|
+
t.string :persistence_token
|
30
|
+
t.string :single_access_token
|
31
|
+
t.string :perishable_token
|
32
|
+
t.string :openid_identifier
|
33
|
+
t.string :email
|
34
|
+
t.string :first_name
|
35
|
+
t.string :last_name
|
36
|
+
t.integer :login_count, :default => 0, :null => false
|
37
|
+
t.integer :failed_login_count, :default => 0, :null => false
|
38
|
+
t.datetime :last_request_at
|
39
|
+
t.datetime :current_login_at
|
40
|
+
t.datetime :last_login_at
|
41
|
+
t.string :current_login_ip
|
42
|
+
t.string :last_login_ip
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
require "active_record/fixtures"
|
47
|
+
require "openid"
|
48
|
+
Rails = true # to trick authlogic into loading the rails adapter
|
49
|
+
require File.dirname(__FILE__) + "/../../authlogic/lib/authlogic"
|
50
|
+
require File.dirname(__FILE__) + "/../../authlogic/lib/authlogic/test_case"
|
51
|
+
#require File.dirname(__FILE__) + "/libs/rails_trickery"
|
52
|
+
require File.dirname(__FILE__) + '/libs/open_id_authentication/lib/open_id_authentication'
|
53
|
+
require File.dirname(__FILE__) + '/../lib/authlogic_openid' unless defined?(AuthlogicOpenid)
|
54
|
+
require File.dirname(__FILE__) + '/libs/user'
|
55
|
+
require File.dirname(__FILE__) + '/libs/user_session'
|
56
|
+
|
57
|
+
class ActiveSupport::TestCase
|
58
|
+
include ActiveRecord::TestFixtures
|
59
|
+
self.fixture_path = File.dirname(__FILE__) + "/fixtures"
|
60
|
+
self.use_transactional_fixtures = false
|
61
|
+
self.use_instantiated_fixtures = false
|
62
|
+
self.pre_loaded_fixtures = false
|
63
|
+
fixtures :all
|
64
|
+
setup :activate_authlogic
|
65
|
+
|
66
|
+
private
|
67
|
+
def activate_authlogic
|
68
|
+
Authlogic::Session::Base.controller = controller
|
69
|
+
end
|
70
|
+
|
71
|
+
def controller
|
72
|
+
@controller ||= Authlogic::ControllerAdapters::RailsAdapter.new(ActionController.new)
|
73
|
+
end
|
74
|
+
|
75
|
+
def redirecting_to_yahoo?
|
76
|
+
controller.redirecting_to.to_s =~ /^https:\/\/open.login.yahooapis.com\/openid\/op\/auth/
|
77
|
+
end
|
78
|
+
end
|
metadata
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: czak-authlogic-oid
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ben Johnson of Binary Logic
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-12-08 00:00:00 +01:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: authlogic
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: hoe
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.3.3
|
34
|
+
version:
|
35
|
+
description: Extension of the Authlogic library to add OpenID support.
|
36
|
+
email: bjohnson@binarylogic.com
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files:
|
42
|
+
- Manifest.txt
|
43
|
+
- CHANGELOG.rdoc
|
44
|
+
- README.rdoc
|
45
|
+
files:
|
46
|
+
- CHANGELOG.rdoc
|
47
|
+
- MIT-LICENSE
|
48
|
+
- Manifest.txt
|
49
|
+
- README.rdoc
|
50
|
+
- Rakefile
|
51
|
+
- init.rb
|
52
|
+
- lib/authlogic_openid.rb
|
53
|
+
- lib/authlogic_openid/acts_as_authentic.rb
|
54
|
+
- lib/authlogic_openid/session.rb
|
55
|
+
- lib/authlogic_openid/version.rb
|
56
|
+
- test/acts_as_authentic_test.rb
|
57
|
+
- test/fixtures/users.yml
|
58
|
+
- test/libs/open_id_authentication/CHANGELOG
|
59
|
+
- test/libs/open_id_authentication/README
|
60
|
+
- test/libs/open_id_authentication/Rakefile
|
61
|
+
- test/libs/open_id_authentication/generators/open_id_authentication_tables/open_id_authentication_tables_generator.rb
|
62
|
+
- test/libs/open_id_authentication/generators/open_id_authentication_tables/templates/migration.rb
|
63
|
+
- test/libs/open_id_authentication/generators/upgrade_open_id_authentication_tables/templates/migration.rb
|
64
|
+
- test/libs/open_id_authentication/generators/upgrade_open_id_authentication_tables/upgrade_open_id_authentication_tables_generator.rb
|
65
|
+
- test/libs/open_id_authentication/init.rb
|
66
|
+
- test/libs/open_id_authentication/lib/open_id_authentication.rb
|
67
|
+
- test/libs/open_id_authentication/lib/open_id_authentication/association.rb
|
68
|
+
- test/libs/open_id_authentication/lib/open_id_authentication/db_store.rb
|
69
|
+
- test/libs/open_id_authentication/lib/open_id_authentication/mem_cache_store.rb
|
70
|
+
- test/libs/open_id_authentication/lib/open_id_authentication/nonce.rb
|
71
|
+
- test/libs/open_id_authentication/lib/open_id_authentication/request.rb
|
72
|
+
- test/libs/open_id_authentication/lib/open_id_authentication/timeout_fixes.rb
|
73
|
+
- test/libs/open_id_authentication/tasks/open_id_authentication_tasks.rake
|
74
|
+
- test/libs/open_id_authentication/test/mem_cache_store_test.rb
|
75
|
+
- test/libs/open_id_authentication/test/normalize_test.rb
|
76
|
+
- test/libs/open_id_authentication/test/open_id_authentication_test.rb
|
77
|
+
- test/libs/open_id_authentication/test/status_test.rb
|
78
|
+
- test/libs/open_id_authentication/test/test_helper.rb
|
79
|
+
- test/libs/rails_trickery.rb
|
80
|
+
- test/libs/user.rb
|
81
|
+
- test/libs/user_session.rb
|
82
|
+
- test/session_test.rb
|
83
|
+
- test/test_helper.rb
|
84
|
+
has_rdoc: true
|
85
|
+
homepage: http://github.com/czak/authlogic_openid
|
86
|
+
licenses: []
|
87
|
+
|
88
|
+
post_install_message:
|
89
|
+
rdoc_options:
|
90
|
+
- --main
|
91
|
+
- README.rdoc
|
92
|
+
require_paths:
|
93
|
+
- lib
|
94
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: "0"
|
99
|
+
version:
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: "0"
|
105
|
+
version:
|
106
|
+
requirements: []
|
107
|
+
|
108
|
+
rubyforge_project: czak-authlogic-oid
|
109
|
+
rubygems_version: 1.3.5
|
110
|
+
signing_key:
|
111
|
+
specification_version: 3
|
112
|
+
summary: Extension of the Authlogic library to add OpenID support.
|
113
|
+
test_files:
|
114
|
+
- test/acts_as_authentic_test.rb
|
115
|
+
- test/session_test.rb
|