jspooner-authlogic-connect 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/MIT-LICENSE +20 -0
- data/README.markdown +234 -0
- data/Rakefile +85 -0
- data/init.rb +1 -0
- data/lib/authlogic-connect.rb +39 -0
- data/lib/authlogic_connect/access_token.rb +61 -0
- data/lib/authlogic_connect/authlogic_connect.rb +46 -0
- data/lib/authlogic_connect/callback_filter.rb +19 -0
- data/lib/authlogic_connect/common/session.rb +30 -0
- data/lib/authlogic_connect/common/state.rb +45 -0
- data/lib/authlogic_connect/common/user.rb +77 -0
- data/lib/authlogic_connect/common/variables.rb +124 -0
- data/lib/authlogic_connect/common.rb +10 -0
- data/lib/authlogic_connect/engine.rb +14 -0
- data/lib/authlogic_connect/ext.rb +56 -0
- data/lib/authlogic_connect/oauth/helper.rb +20 -0
- data/lib/authlogic_connect/oauth/process.rb +77 -0
- data/lib/authlogic_connect/oauth/session.rb +90 -0
- data/lib/authlogic_connect/oauth/state.rb +60 -0
- data/lib/authlogic_connect/oauth/tokens/aol_token.rb +2 -0
- data/lib/authlogic_connect/oauth/tokens/facebook_token.rb +11 -0
- data/lib/authlogic_connect/oauth/tokens/foursquare_token.rb +15 -0
- data/lib/authlogic_connect/oauth/tokens/get_satisfaction_token.rb +9 -0
- data/lib/authlogic_connect/oauth/tokens/github_token.rb +14 -0
- data/lib/authlogic_connect/oauth/tokens/google_token.rb +41 -0
- data/lib/authlogic_connect/oauth/tokens/linked_in_token.rb +19 -0
- data/lib/authlogic_connect/oauth/tokens/meetup_token.rb +12 -0
- data/lib/authlogic_connect/oauth/tokens/myspace_token.rb +26 -0
- data/lib/authlogic_connect/oauth/tokens/netflix_token.rb +10 -0
- data/lib/authlogic_connect/oauth/tokens/oauth_token.rb +164 -0
- data/lib/authlogic_connect/oauth/tokens/ohloh_token.rb +9 -0
- data/lib/authlogic_connect/oauth/tokens/opensocial_token.rb +0 -0
- data/lib/authlogic_connect/oauth/tokens/twitter_token.rb +8 -0
- data/lib/authlogic_connect/oauth/tokens/vimeo_token.rb +18 -0
- data/lib/authlogic_connect/oauth/tokens/yahoo_token.rb +19 -0
- data/lib/authlogic_connect/oauth/user.rb +64 -0
- data/lib/authlogic_connect/oauth/variables.rb +64 -0
- data/lib/authlogic_connect/oauth.rb +14 -0
- data/lib/authlogic_connect/openid/process.rb +74 -0
- data/lib/authlogic_connect/openid/session.rb +56 -0
- data/lib/authlogic_connect/openid/state.rb +48 -0
- data/lib/authlogic_connect/openid/tokens/aol_token.rb +0 -0
- data/lib/authlogic_connect/openid/tokens/blogger_token.rb +0 -0
- data/lib/authlogic_connect/openid/tokens/flickr_token.rb +0 -0
- data/lib/authlogic_connect/openid/tokens/my_openid_token.rb +3 -0
- data/lib/authlogic_connect/openid/tokens/openid_token.rb +9 -0
- data/lib/authlogic_connect/openid/user.rb +38 -0
- data/lib/authlogic_connect/openid/variables.rb +19 -0
- data/lib/authlogic_connect/openid.rb +11 -0
- data/lib/authlogic_connect/rack_state.rb +19 -0
- data/lib/open_id_authentication.rb +127 -0
- data/rails/init.rb +19 -0
- data/test/controllers/test_users_controller.rb +21 -0
- data/test/libs/database.rb +47 -0
- data/test/libs/user.rb +7 -0
- data/test/libs/user_session.rb +2 -0
- data/test/test_helper.rb +178 -0
- data/test/test_oauth.rb +178 -0
- data/test/test_openid.rb +71 -0
- data/test/test_user.rb +85 -0
- metadata +243 -0
data/test/test_user.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
module AuthlogicConnect
|
4
|
+
class UserTest < Test::Unit::TestCase
|
5
|
+
context "User creation" do
|
6
|
+
setup do
|
7
|
+
@user = User.new(:login => "viatropos")
|
8
|
+
end
|
9
|
+
|
10
|
+
should "make sure we are loading the models" do
|
11
|
+
assert_equal "viatropos", @user.login
|
12
|
+
end
|
13
|
+
|
14
|
+
context "responds to added oauth methods (our oauth api on the user)" do
|
15
|
+
|
16
|
+
should "have 'access_tokens' method" do
|
17
|
+
assert @user.respond_to?(:access_tokens)
|
18
|
+
assert_equal [], @user.access_tokens
|
19
|
+
end
|
20
|
+
|
21
|
+
should "have 'active_token' method" do
|
22
|
+
assert @user.respond_to?(:active_token)
|
23
|
+
assert_equal nil, @user.active_token
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
context "with controller and session..." do
|
29
|
+
|
30
|
+
setup do
|
31
|
+
controller.params.merge!(:authentication_type => "user")
|
32
|
+
Authlogic::Session::Base.controller = controller
|
33
|
+
end
|
34
|
+
|
35
|
+
should "have a valid controller" do
|
36
|
+
assert @user.auth_controller
|
37
|
+
end
|
38
|
+
|
39
|
+
should "have auth_params" do
|
40
|
+
assert @user.auth_params?
|
41
|
+
end
|
42
|
+
|
43
|
+
should "have an empty 'auth_session'" do
|
44
|
+
assert @user.auth_session.empty?
|
45
|
+
assert_equal false, @user.auth_session?
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
context "save the user without any parameters" do
|
51
|
+
|
52
|
+
setup do
|
53
|
+
@save_success = @user.save
|
54
|
+
end
|
55
|
+
|
56
|
+
should "be a valid save" do
|
57
|
+
assert @save_success
|
58
|
+
end
|
59
|
+
|
60
|
+
should "not be using oauth" do
|
61
|
+
assert_equal false, @user.using_oauth?
|
62
|
+
# using_oauth? == (oauth_request? || oauth_response? || stored_oauth_token_and_secret?)
|
63
|
+
assert_equal false, @user.oauth_request?
|
64
|
+
# oauth_request? == (auth_params? && oauth_provider?)
|
65
|
+
assert_equal false, @user.auth_params?
|
66
|
+
assert_equal false, @user.oauth_provider?
|
67
|
+
assert_equal false, @user.oauth_response?
|
68
|
+
# oauth_response? == (!oauth_response.nil? && auth_session? && auth_session[:auth_request_class] == self.class.name && auth_session[:auth_method] == "oauth")
|
69
|
+
assert_equal false, !@user.oauth_response.nil?
|
70
|
+
assert_equal false, @user.auth_session?
|
71
|
+
assert_equal false, @user.stored_oauth_token_and_secret?
|
72
|
+
end
|
73
|
+
|
74
|
+
should "not be using openid" do
|
75
|
+
assert_equal false, @user.using_openid?
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
context "user with required password field" do
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
metadata
ADDED
@@ -0,0 +1,243 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jspooner-authlogic-connect
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 57
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 19
|
10
|
+
version: 0.0.19
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Lance Pollard
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-10-28 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: activesupport
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 15
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 1
|
33
|
+
- 2
|
34
|
+
version: 2.1.2
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: activerecord
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 15
|
46
|
+
segments:
|
47
|
+
- 2
|
48
|
+
- 1
|
49
|
+
- 2
|
50
|
+
version: 2.1.2
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: json
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 3
|
62
|
+
segments:
|
63
|
+
- 0
|
64
|
+
version: "0"
|
65
|
+
type: :runtime
|
66
|
+
version_requirements: *id003
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: ruby-openid
|
69
|
+
prerelease: false
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 3
|
76
|
+
segments:
|
77
|
+
- 0
|
78
|
+
version: "0"
|
79
|
+
type: :runtime
|
80
|
+
version_requirements: *id004
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: rack-openid
|
83
|
+
prerelease: false
|
84
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
hash: 21
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
- 2
|
93
|
+
- 1
|
94
|
+
version: 0.2.1
|
95
|
+
type: :runtime
|
96
|
+
version_requirements: *id005
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: oauth
|
99
|
+
prerelease: false
|
100
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
hash: 3
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
version: "0"
|
109
|
+
type: :runtime
|
110
|
+
version_requirements: *id006
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: oauth2
|
113
|
+
prerelease: false
|
114
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
hash: 3
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
version: "0"
|
123
|
+
type: :runtime
|
124
|
+
version_requirements: *id007
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: authlogic
|
127
|
+
prerelease: false
|
128
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
hash: 3
|
134
|
+
segments:
|
135
|
+
- 0
|
136
|
+
version: "0"
|
137
|
+
type: :runtime
|
138
|
+
version_requirements: *id008
|
139
|
+
description: Oauth and OpenID made dead simple
|
140
|
+
email: lancejpollard@gmail.com
|
141
|
+
executables: []
|
142
|
+
|
143
|
+
extensions: []
|
144
|
+
|
145
|
+
extra_rdoc_files: []
|
146
|
+
|
147
|
+
files:
|
148
|
+
- README.markdown
|
149
|
+
- Rakefile
|
150
|
+
- init.rb
|
151
|
+
- MIT-LICENSE
|
152
|
+
- lib/authlogic-connect.rb
|
153
|
+
- lib/authlogic_connect/access_token.rb
|
154
|
+
- lib/authlogic_connect/authlogic_connect.rb
|
155
|
+
- lib/authlogic_connect/callback_filter.rb
|
156
|
+
- lib/authlogic_connect/common/session.rb
|
157
|
+
- lib/authlogic_connect/common/state.rb
|
158
|
+
- lib/authlogic_connect/common/user.rb
|
159
|
+
- lib/authlogic_connect/common/variables.rb
|
160
|
+
- lib/authlogic_connect/common.rb
|
161
|
+
- lib/authlogic_connect/engine.rb
|
162
|
+
- lib/authlogic_connect/ext.rb
|
163
|
+
- lib/authlogic_connect/oauth/helper.rb
|
164
|
+
- lib/authlogic_connect/oauth/process.rb
|
165
|
+
- lib/authlogic_connect/oauth/session.rb
|
166
|
+
- lib/authlogic_connect/oauth/state.rb
|
167
|
+
- lib/authlogic_connect/oauth/tokens/aol_token.rb
|
168
|
+
- lib/authlogic_connect/oauth/tokens/facebook_token.rb
|
169
|
+
- lib/authlogic_connect/oauth/tokens/foursquare_token.rb
|
170
|
+
- lib/authlogic_connect/oauth/tokens/get_satisfaction_token.rb
|
171
|
+
- lib/authlogic_connect/oauth/tokens/github_token.rb
|
172
|
+
- lib/authlogic_connect/oauth/tokens/google_token.rb
|
173
|
+
- lib/authlogic_connect/oauth/tokens/linked_in_token.rb
|
174
|
+
- lib/authlogic_connect/oauth/tokens/meetup_token.rb
|
175
|
+
- lib/authlogic_connect/oauth/tokens/myspace_token.rb
|
176
|
+
- lib/authlogic_connect/oauth/tokens/netflix_token.rb
|
177
|
+
- lib/authlogic_connect/oauth/tokens/oauth_token.rb
|
178
|
+
- lib/authlogic_connect/oauth/tokens/ohloh_token.rb
|
179
|
+
- lib/authlogic_connect/oauth/tokens/opensocial_token.rb
|
180
|
+
- lib/authlogic_connect/oauth/tokens/twitter_token.rb
|
181
|
+
- lib/authlogic_connect/oauth/tokens/vimeo_token.rb
|
182
|
+
- lib/authlogic_connect/oauth/tokens/yahoo_token.rb
|
183
|
+
- lib/authlogic_connect/oauth/user.rb
|
184
|
+
- lib/authlogic_connect/oauth/variables.rb
|
185
|
+
- lib/authlogic_connect/oauth.rb
|
186
|
+
- lib/authlogic_connect/openid/process.rb
|
187
|
+
- lib/authlogic_connect/openid/session.rb
|
188
|
+
- lib/authlogic_connect/openid/state.rb
|
189
|
+
- lib/authlogic_connect/openid/tokens/aol_token.rb
|
190
|
+
- lib/authlogic_connect/openid/tokens/blogger_token.rb
|
191
|
+
- lib/authlogic_connect/openid/tokens/flickr_token.rb
|
192
|
+
- lib/authlogic_connect/openid/tokens/my_openid_token.rb
|
193
|
+
- lib/authlogic_connect/openid/tokens/openid_token.rb
|
194
|
+
- lib/authlogic_connect/openid/user.rb
|
195
|
+
- lib/authlogic_connect/openid/variables.rb
|
196
|
+
- lib/authlogic_connect/openid.rb
|
197
|
+
- lib/authlogic_connect/rack_state.rb
|
198
|
+
- lib/open_id_authentication.rb
|
199
|
+
- rails/init.rb
|
200
|
+
- test/controllers/test_users_controller.rb
|
201
|
+
- test/libs/database.rb
|
202
|
+
- test/libs/user.rb
|
203
|
+
- test/libs/user_session.rb
|
204
|
+
- test/test_helper.rb
|
205
|
+
- test/test_oauth.rb
|
206
|
+
- test/test_openid.rb
|
207
|
+
- test/test_user.rb
|
208
|
+
has_rdoc: true
|
209
|
+
homepage: http://github.com/jspooner/authlogic-connect
|
210
|
+
licenses: []
|
211
|
+
|
212
|
+
post_install_message:
|
213
|
+
rdoc_options: []
|
214
|
+
|
215
|
+
require_paths:
|
216
|
+
- lib
|
217
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
218
|
+
none: false
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
hash: 3
|
223
|
+
segments:
|
224
|
+
- 0
|
225
|
+
version: "0"
|
226
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
227
|
+
none: false
|
228
|
+
requirements:
|
229
|
+
- - ">="
|
230
|
+
- !ruby/object:Gem::Version
|
231
|
+
hash: 3
|
232
|
+
segments:
|
233
|
+
- 0
|
234
|
+
version: "0"
|
235
|
+
requirements: []
|
236
|
+
|
237
|
+
rubyforge_project: jspooner-authlogic-connect
|
238
|
+
rubygems_version: 1.3.7
|
239
|
+
signing_key:
|
240
|
+
specification_version: 3
|
241
|
+
summary: "Authlogic Connect: Oauth and OpenID made dead simple"
|
242
|
+
test_files: []
|
243
|
+
|