multi_auth 0.0.7 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -69,6 +69,13 @@ Ex.
69
69
  s.session_times_out_in = 1.hour
70
70
  end
71
71
 
72
+ You can use OpenID::CustomFetcher to use OpenID provider which uses SSL.
73
+
74
+ Ex.
75
+
76
+ OpenID.fetcher = OpenID::CustomFetcher.new
77
+ OpenID.fetcher.ca_path = OpenSSL::X509::DEFAULT_CERT_PATH
78
+
72
79
  Customize
73
80
  =========
74
81
 
@@ -91,4 +91,8 @@ class EmailCredential < ActiveRecord::Base
91
91
  def login!
92
92
  self.update_attributes!(:loggedin_at => Time.now)
93
93
  end
94
+
95
+ def to_label
96
+ email
97
+ end
94
98
  end
@@ -35,4 +35,8 @@ class OpenIdCredential < ActiveRecord::Base
35
35
  def login!
36
36
  self.update_attributes!(:loggedin_at => Time.now)
37
37
  end
38
+
39
+ def to_label
40
+ identity_url
41
+ end
38
42
  end
@@ -6,11 +6,11 @@
6
6
  <%- form_for(:edit_form, @edit_form, :url => {:action => "update_password"}) { |f| -%>
7
7
  <table>
8
8
  <tr>
9
- <th><%=h f.label(:email) %></th>
9
+ <th><%= f.label(:email) %></th>
10
10
  <td><%=h @email_credential.email %></td>
11
11
  </tr>
12
12
  <tr>
13
- <th><%=h f.label(:password) %></th>
13
+ <th><%= f.label(:password) %></th>
14
14
  <td>
15
15
  <div><%= f.password_field(:password, :size => 20) %></div>
16
16
  <div><%= f.password_field(:password_confirmation, :size => 20) %></div>
data/config/database.yml CHANGED
@@ -9,7 +9,7 @@ development:
9
9
  # Warning: The database defined as "test" will be erased and
10
10
  # re-generated from your development database when you run "rake".
11
11
  # Do not set this db to the same as development or production.
12
- test: &TEST
12
+ test:
13
13
  adapter: sqlite3
14
14
  database: db/test.sqlite3
15
15
  pool: 5
@@ -20,6 +20,3 @@ production:
20
20
  database: db/production.sqlite3
21
21
  pool: 5
22
22
  timeout: 5000
23
-
24
- cucumber:
25
- <<: *TEST
Binary file
data/db/schema.rb CHANGED
@@ -9,21 +9,7 @@
9
9
  #
10
10
  # It's strongly recommended to check this file into your version control system.
11
11
 
12
- ActiveRecord::Schema.define(:version => 20090420020617) do
13
-
14
- create_table "email_addresses", :force => true do |t|
15
- t.datetime "created_at", :null => false
16
- t.string "activation_token", :limit => 40, :null => false
17
- t.integer "user_id", :null => false
18
- t.string "email", :limit => 200, :null => false
19
- t.datetime "activated_at"
20
- end
21
-
22
- add_index "email_addresses", ["activated_at"], :name => "index_email_addresses_on_activated_at"
23
- add_index "email_addresses", ["activation_token"], :name => "index_email_addresses_on_activation_token", :unique => true
24
- add_index "email_addresses", ["created_at"], :name => "index_email_addresses_on_created_at"
25
- add_index "email_addresses", ["email", "user_id"], :name => "index_email_addresses_on_email_and_user_id", :unique => true
26
- add_index "email_addresses", ["user_id"], :name => "index_email_addresses_on_user_id"
12
+ ActiveRecord::Schema.define(:version => 20090415163347) do
27
13
 
28
14
  create_table "email_credentials", :force => true do |t|
29
15
  t.datetime "created_at", :null => false
data/db/test.sqlite3 CHANGED
Binary file
@@ -0,0 +1,39 @@
1
+ module OpenID
2
+ class CustomFetcher < StandardFetcher
3
+
4
+ attr_accessor :ca_path
5
+
6
+ def make_connection(uri)
7
+ conn = make_http(uri)
8
+
9
+ if !conn.is_a?(Net::HTTP)
10
+ raise RuntimeError, sprintf("Expected Net::HTTP object from make_http; got %s",
11
+ conn.class)
12
+ end
13
+
14
+ if uri.scheme == 'https'
15
+ if supports_ssl?(conn)
16
+
17
+ conn.use_ssl = true
18
+
19
+ case
20
+ when @ca_path
21
+ set_verified(conn, true)
22
+ conn.ca_path = @ca_path
23
+ when @ca_file
24
+ set_verified(conn, true)
25
+ conn.ca_file = @ca_file
26
+ else
27
+ Util.log("WARNING: making https request to #{uri} without verifying " +
28
+ "server certificate; no CA path was specified.")
29
+ set_verified(conn, false)
30
+ end
31
+ else
32
+ raise RuntimeError, "SSL support not found; cannot fetch #{uri}"
33
+ end
34
+ end
35
+
36
+ return conn
37
+ end
38
+ end
39
+ end
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ hash: 27
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
5
11
  platform: ruby
6
12
  authors:
7
13
  - okkez
@@ -10,39 +16,51 @@ autorequire:
10
16
  bindir: bin
11
17
  cert_chain: []
12
18
 
13
- date: 2010-01-23 00:00:00 +09:00
19
+ date: 2010-06-02 00:00:00 +09:00
14
20
  default_executable:
15
21
  dependencies:
16
22
  - !ruby/object:Gem::Dependency
17
23
  name: okkez-open_id_authentication
18
- type: :runtime
19
- version_requirement:
20
- version_requirements: !ruby/object:Gem::Requirement
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
21
27
  requirements:
22
28
  - - ">="
23
29
  - !ruby/object:Gem::Version
30
+ hash: 3
31
+ segments:
32
+ - 0
24
33
  version: "0"
25
- version:
34
+ type: :runtime
35
+ version_requirements: *id001
26
36
  - !ruby/object:Gem::Dependency
27
37
  name: validates_email_format_of
28
- type: :runtime
29
- version_requirement:
30
- version_requirements: !ruby/object:Gem::Requirement
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
31
41
  requirements:
32
42
  - - ">="
33
43
  - !ruby/object:Gem::Version
44
+ hash: 3
45
+ segments:
46
+ - 0
34
47
  version: "0"
35
- version:
48
+ type: :runtime
49
+ version_requirements: *id002
36
50
  - !ruby/object:Gem::Dependency
37
51
  name: nayutaya-active-form
38
- type: :runtime
39
- version_requirement:
40
- version_requirements: !ruby/object:Gem::Requirement
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
41
55
  requirements:
42
56
  - - ">="
43
57
  - !ruby/object:Gem::Version
58
+ hash: 3
59
+ segments:
60
+ - 0
44
61
  version: "0"
45
- version:
62
+ type: :runtime
63
+ version_requirements: *id003
46
64
  description:
47
65
  email: ""
48
66
  executables: []
@@ -52,143 +70,144 @@ extensions: []
52
70
  extra_rdoc_files:
53
71
  - README
54
72
  files:
55
- - app/helpers/application_helper.rb
56
73
  - app/controllers/auth_controller.rb
74
+ - app/controllers/credentials_controller.rb
57
75
  - app/controllers/application_controller.rb
58
76
  - app/controllers/credentials/email_controller.rb
59
77
  - app/controllers/credentials/open_id_controller.rb
60
- - app/controllers/auth/email_controller.rb
61
- - app/controllers/auth/open_id_controller.rb
62
- - app/controllers/signup_controller.rb
63
- - app/controllers/credentials_controller.rb
64
78
  - app/controllers/signup/email_controller.rb
65
79
  - app/controllers/signup/open_id_controller.rb
66
- - app/models/dummy_user.rb
80
+ - app/controllers/signup_controller.rb
81
+ - app/controllers/auth/email_controller.rb
82
+ - app/controllers/auth/open_id_controller.rb
83
+ - app/models/email_login_form.rb
67
84
  - app/models/email_credential_edit_form.rb
68
85
  - app/models/open_id_login_form.rb
69
- - app/models/activation_mailer.rb
70
- - app/models/email_credential.rb
71
86
  - app/models/session.rb
72
- - app/models/open_id_credential.rb
73
- - app/models/email_login_form.rb
87
+ - app/models/email_credential.rb
88
+ - app/models/activation_mailer.rb
74
89
  - app/models/email_password_edit_form.rb
75
- - app/views/credentials/index.html.erb
76
- - app/views/credentials/open_id/delete.html.erb
77
- - app/views/credentials/open_id/new.html.erb
78
- - app/views/credentials/email/edit_password.html.erb
79
- - app/views/credentials/email/activated.html.erb
80
- - app/views/credentials/email/delete.html.erb
81
- - app/views/credentials/email/new.html.erb
82
- - app/views/credentials/email/created.html.erb
83
- - app/views/credentials/email/activation.html.erb
84
- - app/views/auth/logged_out.html.erb
85
- - app/views/auth/index.html.erb
86
- - app/views/auth/_header.html.erb
87
- - app/views/auth/open_id/index.html.erb
88
- - app/views/auth/email/index.html.erb
89
- - app/views/auth/logged_in.html.erb
90
- - app/views/activation_mailer/request_for_credential.erb
90
+ - app/models/dummy_user.rb
91
+ - app/models/open_id_credential.rb
92
+ - app/helpers/application_helper.rb
93
+ - app/views/activation_mailer/complete_for_credential.erb
94
+ - app/views/activation_mailer/request_for_notice.erb
91
95
  - app/views/activation_mailer/request_for_signup.erb
92
96
  - app/views/activation_mailer/complete_for_notice.erb
93
- - app/views/activation_mailer/request_for_notice.erb
94
- - app/views/activation_mailer/complete_for_credential.erb
97
+ - app/views/activation_mailer/request_for_credential.erb
95
98
  - app/views/activation_mailer/complete_for_signup.erb
99
+ - app/views/credentials/email/delete.html.erb
100
+ - app/views/credentials/email/activated.html.erb
101
+ - app/views/credentials/email/activation.html.erb
102
+ - app/views/credentials/email/new.html.erb
103
+ - app/views/credentials/email/created.html.erb
104
+ - app/views/credentials/email/edit_password.html.erb
105
+ - app/views/credentials/index.html.erb
106
+ - app/views/credentials/open_id/delete.html.erb
107
+ - app/views/credentials/open_id/new.html.erb
108
+ - app/views/signup/email/activated.html.erb
109
+ - app/views/signup/email/activation.html.erb
110
+ - app/views/signup/email/validated.html.erb
111
+ - app/views/signup/email/index.html.erb
112
+ - app/views/signup/email/created.html.erb
113
+ - app/views/signup/email/_progress.html.erb
96
114
  - app/views/signup/index.html.erb
97
115
  - app/views/signup/open_id/authenticated.html.erb
98
116
  - app/views/signup/open_id/index.html.erb
99
117
  - app/views/signup/open_id/created.html.erb
100
- - app/views/signup/email/_progress.html.erb
101
- - app/views/signup/email/activated.html.erb
102
- - app/views/signup/email/index.html.erb
103
- - app/views/signup/email/created.html.erb
104
- - app/views/signup/email/validated.html.erb
105
- - app/views/signup/email/activation.html.erb
106
- - config/routes.rb
107
- - config/cucumber.yml
118
+ - app/views/auth/email/index.html.erb
119
+ - app/views/auth/_header.html.erb
120
+ - app/views/auth/logged_out.html.erb
121
+ - app/views/auth/index.html.erb
122
+ - app/views/auth/logged_in.html.erb
123
+ - app/views/auth/open_id/index.html.erb
108
124
  - config/database.yml.sqlite3
125
+ - config/cucumber.yml
126
+ - config/smtp.yml.sample
109
127
  - config/environment.rb
110
- - config/boot.rb
111
128
  - config/database.yml
112
- - config/smtp.yml.sample
113
- - db/schema.rb
114
- - db/development.sqlite3
129
+ - config/boot.rb
130
+ - config/routes.rb
115
131
  - db/test.sqlite3
116
- - lib/action_mailer_util.rb
117
- - lib/notice_formatter.rb
118
- - lib/multi_auth.rb
119
- - lib/multi_auth_helper.rb
132
+ - db/development.sqlite3
133
+ - db/schema.rb
120
134
  - lib/token_util.rb
121
- - lib/open_id_authentication/result.rb
135
+ - lib/multi_auth.rb
122
136
  - lib/multi_auth/active_record.rb
123
137
  - lib/multi_auth/action_controller.rb
138
+ - lib/open_id_authentication/result.rb
139
+ - lib/multi_auth_helper.rb
140
+ - lib/notice_formatter.rb
141
+ - lib/action_mailer_util.rb
142
+ - lib/open_id/custom_fetcher.rb
124
143
  - rails/init.rb
125
- - generators/multi_auth_migration/multi_auth_migration_generator.rb
126
- - generators/multi_auth_migration/USAGE
127
- - generators/multi_auth_migration/templates/migration.rb
128
- - generators/multi_auth_public_assets/multi_auth_public_assets_generator.rb
129
- - generators/multi_auth_public_assets/USAGE
130
- - generators/multi_auth_public_assets/templates/style.css
131
- - generators/multi_auth_public_assets/templates/images/favicons/yahoo.png
132
- - generators/multi_auth_public_assets/templates/images/favicons/livedoor.png
133
- - generators/multi_auth_public_assets/templates/images/favicons/mixi.png
134
- - generators/multi_auth_public_assets/templates/images/icons/openid.png
135
- - generators/multi_auth_public_assets/templates/images/icons/openid-with-desc.png
136
- - generators/multi_auth_public_assets/templates/images/icons/fam/email-with-desc.png
137
- - generators/multi_auth_public_assets/templates/images/icons/fam/plugin.png
138
- - generators/multi_auth_public_assets/templates/images/icons/fam/key.png
139
- - generators/multi_auth_public_assets/templates/images/icons/fam/feed.png
140
- - generators/multi_auth_public_assets/templates/images/icons/fam/key-with-desc.png
144
+ - generators/multi_auth_public_assets/templates/images/icons/fam/bin.png
141
145
  - generators/multi_auth_public_assets/templates/images/icons/fam/help.png
146
+ - generators/multi_auth_public_assets/templates/images/icons/fam/tick.png
147
+ - generators/multi_auth_public_assets/templates/images/icons/fam/key-with-desc.png
142
148
  - generators/multi_auth_public_assets/templates/images/icons/fam/cog.png
149
+ - generators/multi_auth_public_assets/templates/images/icons/fam/lightning.png
150
+ - generators/multi_auth_public_assets/templates/images/icons/fam/user.png
151
+ - generators/multi_auth_public_assets/templates/images/icons/fam/email.png
143
152
  - generators/multi_auth_public_assets/templates/images/icons/fam/add.png
144
- - generators/multi_auth_public_assets/templates/images/icons/fam/stop.png
145
- - generators/multi_auth_public_assets/templates/images/icons/fam/tick.png
146
- - generators/multi_auth_public_assets/templates/images/icons/fam/delete.png
147
153
  - generators/multi_auth_public_assets/templates/images/icons/fam/vcard.png
154
+ - generators/multi_auth_public_assets/templates/images/icons/fam/delete.png
148
155
  - generators/multi_auth_public_assets/templates/images/icons/fam/table_save.png
149
- - generators/multi_auth_public_assets/templates/images/icons/fam/lightning.png
150
- - generators/multi_auth_public_assets/templates/images/icons/fam/email.png
151
- - generators/multi_auth_public_assets/templates/images/icons/fam/bin.png
152
- - generators/multi_auth_public_assets/templates/images/icons/fam/user.png
156
+ - generators/multi_auth_public_assets/templates/images/icons/fam/email-with-desc.png
153
157
  - generators/multi_auth_public_assets/templates/images/icons/fam/bomb.png
154
- - po/ja/multi_auth.po
158
+ - generators/multi_auth_public_assets/templates/images/icons/fam/plugin.png
159
+ - generators/multi_auth_public_assets/templates/images/icons/fam/key.png
160
+ - generators/multi_auth_public_assets/templates/images/icons/fam/feed.png
161
+ - generators/multi_auth_public_assets/templates/images/icons/fam/stop.png
162
+ - generators/multi_auth_public_assets/templates/images/icons/openid.png
163
+ - generators/multi_auth_public_assets/templates/images/icons/openid-with-desc.png
164
+ - generators/multi_auth_public_assets/templates/images/favicons/yahoo.png
165
+ - generators/multi_auth_public_assets/templates/images/favicons/mixi.png
166
+ - generators/multi_auth_public_assets/templates/images/favicons/livedoor.png
167
+ - generators/multi_auth_public_assets/templates/style.css
168
+ - generators/multi_auth_public_assets/multi_auth_public_assets_generator.rb
169
+ - generators/multi_auth_public_assets/USAGE
170
+ - generators/multi_auth_migration/multi_auth_migration_generator.rb
171
+ - generators/multi_auth_migration/templates/migration.rb
172
+ - generators/multi_auth_migration/USAGE
155
173
  - po/multi_auth.pot
174
+ - po/ja/multi_auth.po
156
175
  - locale/ja/LC_MESSAGES/multi_auth.mo
157
- - test/unit/token_util_test.rb
158
- - test/unit/open_id_login_form_test.rb
159
- - test/unit/notice_formatter_test.rb
176
+ - test/test_helper.rb
177
+ - test/performance/browsing_test.rb
178
+ - test/functional/auth_controller_test.rb
179
+ - test/functional/credentials/email_controller_test.rb
180
+ - test/functional/credentials/open_id_controller_test.rb
181
+ - test/functional/credentials_controller_test.rb
182
+ - test/functional/signup/email_controller_test.rb
183
+ - test/functional/signup/open_id_controller_test.rb
184
+ - test/functional/auth/email_controller_test.rb
185
+ - test/functional/auth/open_id_controller_test.rb
186
+ - test/functional/signup_controller_test.rb
187
+ - test/unit/email_credential_test.rb
188
+ - test/unit/multi_auth_public_assets_generator_test.rb
189
+ - test/unit/action_mailer_util_test.rb
190
+ - test/unit/session_test.rb
160
191
  - test/unit/email_login_form_test.rb
161
- - test/unit/helpers/open_id_signup_helper_test.rb
192
+ - test/unit/email_credential_edit_form_test.rb
193
+ - test/unit/notice_formatter_test.rb
194
+ - test/unit/open_id_login_form_test.rb
195
+ - test/unit/dummy_user_test.rb
196
+ - test/unit/open_id_credential_test.rb
197
+ - test/unit/activation_mailer_test.rb
198
+ - test/unit/helpers/email_signup_helper_test.rb
199
+ - test/unit/helpers/email_auth_helper_test.rb
162
200
  - test/unit/helpers/signup_helper_test.rb
163
- - test/unit/helpers/password_signup_helper_test.rb
201
+ - test/unit/helpers/open_id_signup_helper_test.rb
202
+ - test/unit/helpers/credentials/open_id_helper_test.rb
203
+ - test/unit/helpers/credentials/email_helper_test.rb
164
204
  - test/unit/helpers/open_id_auth_helper_test.rb
205
+ - test/unit/helpers/auth_helper_test.rb
206
+ - test/unit/helpers/password_signup_helper_test.rb
165
207
  - test/unit/helpers/password_auth_helper_test.rb
166
- - test/unit/helpers/email_auth_helper_test.rb
167
- - test/unit/helpers/credentials/email_helper_test.rb
168
- - test/unit/helpers/credentials/open_id_helper_test.rb
169
- - test/unit/helpers/email_signup_helper_test.rb
170
208
  - test/unit/helpers/credentials_helper_test.rb
171
- - test/unit/helpers/auth_helper_test.rb
172
- - test/unit/multi_auth_public_assets_generator_test.rb
173
- - test/unit/action_mailer_util_test.rb
174
- - test/unit/open_id_credential_test.rb
175
- - test/unit/dummy_user_test.rb
176
- - test/unit/activation_mailer_test.rb
177
- - test/unit/session_test.rb
178
- - test/unit/email_credential_test.rb
209
+ - test/unit/token_util_test.rb
179
210
  - test/unit/email_password_edit_form_test.rb
180
- - test/unit/email_credential_edit_form_test.rb
181
- - test/functional/signup_controller_test.rb
182
- - test/functional/auth_controller_test.rb
183
- - test/functional/credentials_controller_test.rb
184
- - test/functional/credentials/open_id_controller_test.rb
185
- - test/functional/credentials/email_controller_test.rb
186
- - test/functional/auth/open_id_controller_test.rb
187
- - test/functional/auth/email_controller_test.rb
188
- - test/functional/signup/open_id_controller_test.rb
189
- - test/functional/signup/email_controller_test.rb
190
- - test/test_helper.rb
191
- - test/performance/browsing_test.rb
192
211
  - README
193
212
  has_rdoc: true
194
213
  homepage: https://github.com/okkez/multi_auth
@@ -200,21 +219,27 @@ rdoc_options: []
200
219
  require_paths:
201
220
  - lib
202
221
  required_ruby_version: !ruby/object:Gem::Requirement
222
+ none: false
203
223
  requirements:
204
224
  - - ">="
205
225
  - !ruby/object:Gem::Version
226
+ hash: 3
227
+ segments:
228
+ - 0
206
229
  version: "0"
207
- version:
208
230
  required_rubygems_version: !ruby/object:Gem::Requirement
231
+ none: false
209
232
  requirements:
210
233
  - - ">="
211
234
  - !ruby/object:Gem::Version
235
+ hash: 3
236
+ segments:
237
+ - 0
212
238
  version: "0"
213
- version:
214
239
  requirements: []
215
240
 
216
241
  rubyforge_project:
217
- rubygems_version: 1.3.5
242
+ rubygems_version: 1.3.7
218
243
  signing_key:
219
244
  specification_version: 3
220
245
  summary: This Rails plugin provides basic login fanctionality