devise 1.5.1 → 2.0.0
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/CHANGELOG.rdoc +111 -68
- data/MIT-LICENSE +1 -1
- data/README.rdoc +7 -4
- data/app/controllers/devise/confirmations_controller.rb +3 -6
- data/app/controllers/devise/omniauth_callbacks_controller.rb +1 -3
- data/app/controllers/devise/passwords_controller.rb +3 -6
- data/app/controllers/devise/registrations_controller.rb +40 -42
- data/app/controllers/devise/sessions_controller.rb +2 -3
- data/app/controllers/devise/unlocks_controller.rb +4 -7
- data/app/controllers/devise_controller.rb +169 -0
- data/app/views/devise/_links.erb +25 -0
- data/app/views/devise/confirmations/new.html.erb +1 -1
- data/app/views/devise/mailer/confirmation_instructions.html.erb +1 -1
- data/app/views/devise/passwords/edit.html.erb +1 -1
- data/app/views/devise/passwords/new.html.erb +1 -1
- data/app/views/devise/registrations/new.html.erb +1 -1
- data/app/views/devise/sessions/new.html.erb +1 -1
- data/app/views/devise/shared/_links.erb +3 -25
- data/app/views/devise/unlocks/new.html.erb +1 -1
- data/config/locales/en.yml +5 -6
- data/lib/devise/controllers/helpers.rb +8 -2
- data/lib/devise/controllers/scoped_views.rb +0 -16
- data/lib/devise/controllers/url_helpers.rb +16 -2
- data/lib/devise/delegator.rb +2 -2
- data/lib/devise/failure_app.rb +43 -8
- data/lib/devise/mapping.rb +1 -4
- data/lib/devise/models/authenticatable.rb +22 -1
- data/lib/devise/models/confirmable.rb +80 -22
- data/lib/devise/models/database_authenticatable.rb +5 -16
- data/lib/devise/models/lockable.rb +1 -1
- data/lib/devise/models/recoverable.rb +5 -5
- data/lib/devise/models/rememberable.rb +5 -20
- data/lib/devise/models/serializable.rb +5 -2
- data/lib/devise/models/timeoutable.rb +9 -7
- data/lib/devise/models/token_authenticatable.rb +1 -4
- data/lib/devise/models/validatable.rb +1 -1
- data/lib/devise/models.rb +1 -1
- data/lib/devise/modules.rb +2 -2
- data/lib/devise/omniauth/config.rb +1 -1
- data/lib/devise/orm/active_record.rb +6 -0
- data/lib/devise/param_filter.rb +1 -1
- data/lib/devise/path_checker.rb +7 -2
- data/lib/devise/rails/routes.rb +23 -14
- data/lib/devise/rails/warden_compat.rb +0 -83
- data/lib/devise/rails.rb +61 -0
- data/lib/devise/schema.rb +5 -0
- data/lib/devise/strategies/authenticatable.rb +14 -10
- data/lib/devise/strategies/token_authenticatable.rb +3 -3
- data/lib/devise/version.rb +1 -1
- data/lib/devise.rb +56 -33
- data/lib/generators/active_record/devise_generator.rb +40 -2
- data/lib/generators/active_record/templates/migration.rb +1 -19
- data/lib/generators/active_record/templates/migration_existing.rb +1 -9
- data/lib/generators/devise/views_generator.rb +6 -14
- data/lib/generators/mongoid/devise_generator.rb +43 -0
- data/lib/generators/templates/devise.rb +28 -14
- data/lib/generators/templates/simple_form_for/confirmations/new.html.erb +1 -1
- data/lib/generators/templates/simple_form_for/passwords/edit.html.erb +1 -1
- data/lib/generators/templates/simple_form_for/passwords/new.html.erb +1 -1
- data/lib/generators/templates/simple_form_for/registrations/new.html.erb +1 -1
- data/lib/generators/templates/simple_form_for/sessions/new.html.erb +1 -1
- data/lib/generators/templates/simple_form_for/unlocks/new.html.erb +1 -1
- data/test/controllers/internal_helpers_test.rb +5 -4
- data/test/delegator_test.rb +19 -0
- data/test/devise_test.rb +2 -2
- data/test/failure_app_test.rb +24 -20
- data/test/generators/active_record_generator_test.rb +3 -13
- data/test/generators/views_generator_test.rb +1 -1
- data/test/integration/authenticatable_test.rb +4 -7
- data/test/integration/confirmable_test.rb +55 -3
- data/test/integration/http_authenticatable_test.rb +20 -5
- data/test/integration/lockable_test.rb +26 -14
- data/test/integration/registerable_test.rb +33 -2
- data/test/integration/rememberable_test.rb +0 -50
- data/test/integration/timeoutable_test.rb +18 -4
- data/test/integration/token_authenticatable_test.rb +5 -5
- data/test/integration/trackable_test.rb +6 -6
- data/test/mapping_test.rb +2 -3
- data/test/models/confirmable_test.rb +101 -8
- data/test/models/database_authenticatable_test.rb +19 -0
- data/test/models/encryptable_test.rb +1 -1
- data/test/models/lockable_test.rb +13 -0
- data/test/models/recoverable_test.rb +0 -27
- data/test/models/rememberable_test.rb +41 -160
- data/test/models/serializable_test.rb +1 -1
- data/test/models/timeoutable_test.rb +14 -0
- data/test/models_test.rb +7 -7
- data/test/path_checker_test.rb +21 -0
- data/test/rails_app/app/mongoid/admin.rb +22 -1
- data/test/rails_app/app/mongoid/user.rb +35 -0
- data/test/rails_app/config/initializers/devise.rb +6 -7
- data/test/rails_app/config/routes.rb +3 -5
- data/test/rails_app/db/migrate/20100401102949_create_tables.rb +58 -12
- data/test/rails_app/lib/shared_admin.rb +6 -2
- data/test/rails_app/log/development.log +13 -0
- data/test/rails_app/log/test.log +319550 -0
- data/test/routes_test.rb +4 -0
- data/test/support/assertions.rb +4 -1
- data/test/support/helpers.rb +0 -17
- data/test/support/integration.rb +3 -1
- data/test/test_helpers_test.rb +2 -2
- data/test/tmp/app/views/devise/_links.erb +25 -0
- data/test/tmp/app/views/devise/confirmations/new.html.erb +15 -0
- data/test/tmp/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/test/tmp/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/test/tmp/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/test/tmp/app/views/devise/passwords/edit.html.erb +19 -0
- data/test/tmp/app/views/devise/passwords/new.html.erb +15 -0
- data/test/tmp/app/views/devise/registrations/edit.html.erb +22 -0
- data/test/tmp/app/views/devise/registrations/new.html.erb +17 -0
- data/test/tmp/app/views/devise/sessions/new.html.erb +15 -0
- data/test/tmp/app/views/devise/unlocks/new.html.erb +15 -0
- data/test/tmp/app/views/users/_links.erb +25 -0
- data/test/tmp/app/views/users/confirmations/new.html.erb +15 -0
- data/test/tmp/app/views/users/mailer/confirmation_instructions.html.erb +5 -0
- data/test/tmp/app/views/users/mailer/reset_password_instructions.html.erb +8 -0
- data/test/tmp/app/views/users/mailer/unlock_instructions.html.erb +7 -0
- data/test/tmp/app/views/users/passwords/edit.html.erb +19 -0
- data/test/tmp/app/views/users/passwords/new.html.erb +15 -0
- data/test/tmp/app/views/users/registrations/edit.html.erb +22 -0
- data/test/tmp/app/views/users/registrations/new.html.erb +17 -0
- data/test/tmp/app/views/users/sessions/new.html.erb +15 -0
- data/test/tmp/app/views/users/unlocks/new.html.erb +15 -0
- metadata +83 -27
- data/.gitignore +0 -12
- data/.travis.yml +0 -13
- data/Gemfile +0 -35
- data/Rakefile +0 -34
- data/devise.gemspec +0 -25
- data/lib/devise/controllers/internal_helpers.rb +0 -154
- data/lib/devise/controllers/shared_helpers.rb +0 -26
- data/test/schema_test.rb +0 -33
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: devise
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -10,11 +10,11 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2012-01-26 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: warden
|
|
17
|
-
requirement: &
|
|
17
|
+
requirement: &2152505840 !ruby/object:Gem::Requirement
|
|
18
18
|
none: false
|
|
19
19
|
requirements:
|
|
20
20
|
- - ~>
|
|
@@ -22,10 +22,10 @@ dependencies:
|
|
|
22
22
|
version: '1.1'
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
|
-
version_requirements: *
|
|
25
|
+
version_requirements: *2152505840
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: orm_adapter
|
|
28
|
-
requirement: &
|
|
28
|
+
requirement: &2152501920 !ruby/object:Gem::Requirement
|
|
29
29
|
none: false
|
|
30
30
|
requirements:
|
|
31
31
|
- - ~>
|
|
@@ -33,10 +33,10 @@ dependencies:
|
|
|
33
33
|
version: 0.0.3
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
|
-
version_requirements: *
|
|
36
|
+
version_requirements: *2152501920
|
|
37
37
|
- !ruby/object:Gem::Dependency
|
|
38
38
|
name: bcrypt-ruby
|
|
39
|
-
requirement: &
|
|
39
|
+
requirement: &2152525080 !ruby/object:Gem::Requirement
|
|
40
40
|
none: false
|
|
41
41
|
requirements:
|
|
42
42
|
- - ~>
|
|
@@ -44,28 +44,37 @@ dependencies:
|
|
|
44
44
|
version: '3.0'
|
|
45
45
|
type: :runtime
|
|
46
46
|
prerelease: false
|
|
47
|
-
version_requirements: *
|
|
47
|
+
version_requirements: *2152525080
|
|
48
|
+
- !ruby/object:Gem::Dependency
|
|
49
|
+
name: railties
|
|
50
|
+
requirement: &2152523660 !ruby/object:Gem::Requirement
|
|
51
|
+
none: false
|
|
52
|
+
requirements:
|
|
53
|
+
- - ~>
|
|
54
|
+
- !ruby/object:Gem::Version
|
|
55
|
+
version: '3.1'
|
|
56
|
+
type: :runtime
|
|
57
|
+
prerelease: false
|
|
58
|
+
version_requirements: *2152523660
|
|
48
59
|
description: Flexible authentication solution for Rails with Warden
|
|
49
60
|
email: contact@plataformatec.com.br
|
|
50
61
|
executables: []
|
|
51
62
|
extensions: []
|
|
52
63
|
extra_rdoc_files: []
|
|
53
64
|
files:
|
|
54
|
-
- .gitignore
|
|
55
|
-
- .travis.yml
|
|
56
65
|
- CHANGELOG.rdoc
|
|
57
|
-
- Gemfile
|
|
58
66
|
- MIT-LICENSE
|
|
59
67
|
- README.rdoc
|
|
60
|
-
- Rakefile
|
|
61
68
|
- app/controllers/devise/confirmations_controller.rb
|
|
62
69
|
- app/controllers/devise/omniauth_callbacks_controller.rb
|
|
63
70
|
- app/controllers/devise/passwords_controller.rb
|
|
64
71
|
- app/controllers/devise/registrations_controller.rb
|
|
65
72
|
- app/controllers/devise/sessions_controller.rb
|
|
66
73
|
- app/controllers/devise/unlocks_controller.rb
|
|
74
|
+
- app/controllers/devise_controller.rb
|
|
67
75
|
- app/helpers/devise_helper.rb
|
|
68
76
|
- app/mailers/devise/mailer.rb
|
|
77
|
+
- app/views/devise/_links.erb
|
|
69
78
|
- app/views/devise/confirmations/new.html.erb
|
|
70
79
|
- app/views/devise/mailer/confirmation_instructions.html.erb
|
|
71
80
|
- app/views/devise/mailer/reset_password_instructions.html.erb
|
|
@@ -78,13 +87,9 @@ files:
|
|
|
78
87
|
- app/views/devise/shared/_links.erb
|
|
79
88
|
- app/views/devise/unlocks/new.html.erb
|
|
80
89
|
- config/locales/en.yml
|
|
81
|
-
- devise.gemspec
|
|
82
|
-
- lib/devise.rb
|
|
83
90
|
- lib/devise/controllers/helpers.rb
|
|
84
|
-
- lib/devise/controllers/internal_helpers.rb
|
|
85
91
|
- lib/devise/controllers/rememberable.rb
|
|
86
92
|
- lib/devise/controllers/scoped_views.rb
|
|
87
|
-
- lib/devise/controllers/shared_helpers.rb
|
|
88
93
|
- lib/devise/controllers/url_helpers.rb
|
|
89
94
|
- lib/devise/delegator.rb
|
|
90
95
|
- lib/devise/encryptors/authlogic_sha512.rb
|
|
@@ -101,7 +106,6 @@ files:
|
|
|
101
106
|
- lib/devise/hooks/trackable.rb
|
|
102
107
|
- lib/devise/mailers/helpers.rb
|
|
103
108
|
- lib/devise/mapping.rb
|
|
104
|
-
- lib/devise/models.rb
|
|
105
109
|
- lib/devise/models/authenticatable.rb
|
|
106
110
|
- lib/devise/models/confirmable.rb
|
|
107
111
|
- lib/devise/models/database_authenticatable.rb
|
|
@@ -116,17 +120,18 @@ files:
|
|
|
116
120
|
- lib/devise/models/token_authenticatable.rb
|
|
117
121
|
- lib/devise/models/trackable.rb
|
|
118
122
|
- lib/devise/models/validatable.rb
|
|
123
|
+
- lib/devise/models.rb
|
|
119
124
|
- lib/devise/modules.rb
|
|
120
|
-
- lib/devise/omniauth.rb
|
|
121
125
|
- lib/devise/omniauth/config.rb
|
|
122
126
|
- lib/devise/omniauth/url_helpers.rb
|
|
127
|
+
- lib/devise/omniauth.rb
|
|
123
128
|
- lib/devise/orm/active_record.rb
|
|
124
129
|
- lib/devise/orm/mongoid.rb
|
|
125
130
|
- lib/devise/param_filter.rb
|
|
126
131
|
- lib/devise/path_checker.rb
|
|
127
|
-
- lib/devise/rails.rb
|
|
128
132
|
- lib/devise/rails/routes.rb
|
|
129
133
|
- lib/devise/rails/warden_compat.rb
|
|
134
|
+
- lib/devise/rails.rb
|
|
130
135
|
- lib/devise/schema.rb
|
|
131
136
|
- lib/devise/strategies/authenticatable.rb
|
|
132
137
|
- lib/devise/strategies/base.rb
|
|
@@ -135,6 +140,7 @@ files:
|
|
|
135
140
|
- lib/devise/strategies/token_authenticatable.rb
|
|
136
141
|
- lib/devise/test_helpers.rb
|
|
137
142
|
- lib/devise/version.rb
|
|
143
|
+
- lib/devise.rb
|
|
138
144
|
- lib/generators/active_record/devise_generator.rb
|
|
139
145
|
- lib/generators/active_record/templates/migration.rb
|
|
140
146
|
- lib/generators/active_record/templates/migration_existing.rb
|
|
@@ -143,11 +149,11 @@ files:
|
|
|
143
149
|
- lib/generators/devise/orm_helpers.rb
|
|
144
150
|
- lib/generators/devise/views_generator.rb
|
|
145
151
|
- lib/generators/mongoid/devise_generator.rb
|
|
146
|
-
- lib/generators/templates/README
|
|
147
152
|
- lib/generators/templates/devise.rb
|
|
148
153
|
- lib/generators/templates/markerb/confirmation_instructions.markerb
|
|
149
154
|
- lib/generators/templates/markerb/reset_password_instructions.markerb
|
|
150
155
|
- lib/generators/templates/markerb/unlock_instructions.markerb
|
|
156
|
+
- lib/generators/templates/README
|
|
151
157
|
- lib/generators/templates/simple_form_for/confirmations/new.html.erb
|
|
152
158
|
- lib/generators/templates/simple_form_for/passwords/edit.html.erb
|
|
153
159
|
- lib/generators/templates/simple_form_for/passwords/new.html.erb
|
|
@@ -159,6 +165,7 @@ files:
|
|
|
159
165
|
- test/controllers/internal_helpers_test.rb
|
|
160
166
|
- test/controllers/sessions_controller_test.rb
|
|
161
167
|
- test/controllers/url_helpers_test.rb
|
|
168
|
+
- test/delegator_test.rb
|
|
162
169
|
- test/devise_test.rb
|
|
163
170
|
- test/encryptors_test.rb
|
|
164
171
|
- test/failure_app_test.rb
|
|
@@ -201,7 +208,7 @@ files:
|
|
|
201
208
|
- test/omniauth/url_helpers_test.rb
|
|
202
209
|
- test/orm/active_record.rb
|
|
203
210
|
- test/orm/mongoid.rb
|
|
204
|
-
- test/
|
|
211
|
+
- test/path_checker_test.rb
|
|
205
212
|
- test/rails_app/app/active_record/admin.rb
|
|
206
213
|
- test/rails_app/app/active_record/shim.rb
|
|
207
214
|
- test/rails_app/app/active_record/user.rb
|
|
@@ -229,7 +236,6 @@ files:
|
|
|
229
236
|
- test/rails_app/app/views/users/index.html.erb
|
|
230
237
|
- test/rails_app/app/views/users/mailer/confirmation_instructions.erb
|
|
231
238
|
- test/rails_app/app/views/users/sessions/new.html.erb
|
|
232
|
-
- test/rails_app/config.ru
|
|
233
239
|
- test/rails_app/config/application.rb
|
|
234
240
|
- test/rails_app/config/boot.rb
|
|
235
241
|
- test/rails_app/config/database.yml
|
|
@@ -242,17 +248,20 @@ files:
|
|
|
242
248
|
- test/rails_app/config/initializers/inflections.rb
|
|
243
249
|
- test/rails_app/config/initializers/secret_token.rb
|
|
244
250
|
- test/rails_app/config/routes.rb
|
|
251
|
+
- test/rails_app/config.ru
|
|
245
252
|
- test/rails_app/db/migrate/20100401102949_create_tables.rb
|
|
246
253
|
- test/rails_app/db/schema.rb
|
|
247
254
|
- test/rails_app/lib/shared_admin.rb
|
|
248
255
|
- test/rails_app/lib/shared_user.rb
|
|
256
|
+
- test/rails_app/log/development.log
|
|
257
|
+
- test/rails_app/log/test.log
|
|
249
258
|
- test/rails_app/public/404.html
|
|
250
259
|
- test/rails_app/public/422.html
|
|
251
260
|
- test/rails_app/public/500.html
|
|
252
261
|
- test/rails_app/public/favicon.ico
|
|
262
|
+
- test/rails_app/Rakefile
|
|
253
263
|
- test/rails_app/script/rails
|
|
254
264
|
- test/routes_test.rb
|
|
255
|
-
- test/schema_test.rb
|
|
256
265
|
- test/support/assertions.rb
|
|
257
266
|
- test/support/helpers.rb
|
|
258
267
|
- test/support/integration.rb
|
|
@@ -260,6 +269,28 @@ files:
|
|
|
260
269
|
- test/support/webrat/integrations/rails.rb
|
|
261
270
|
- test/test_helper.rb
|
|
262
271
|
- test/test_helpers_test.rb
|
|
272
|
+
- test/tmp/app/views/devise/_links.erb
|
|
273
|
+
- test/tmp/app/views/devise/confirmations/new.html.erb
|
|
274
|
+
- test/tmp/app/views/devise/mailer/confirmation_instructions.html.erb
|
|
275
|
+
- test/tmp/app/views/devise/mailer/reset_password_instructions.html.erb
|
|
276
|
+
- test/tmp/app/views/devise/mailer/unlock_instructions.html.erb
|
|
277
|
+
- test/tmp/app/views/devise/passwords/edit.html.erb
|
|
278
|
+
- test/tmp/app/views/devise/passwords/new.html.erb
|
|
279
|
+
- test/tmp/app/views/devise/registrations/edit.html.erb
|
|
280
|
+
- test/tmp/app/views/devise/registrations/new.html.erb
|
|
281
|
+
- test/tmp/app/views/devise/sessions/new.html.erb
|
|
282
|
+
- test/tmp/app/views/devise/unlocks/new.html.erb
|
|
283
|
+
- test/tmp/app/views/users/_links.erb
|
|
284
|
+
- test/tmp/app/views/users/confirmations/new.html.erb
|
|
285
|
+
- test/tmp/app/views/users/mailer/confirmation_instructions.html.erb
|
|
286
|
+
- test/tmp/app/views/users/mailer/reset_password_instructions.html.erb
|
|
287
|
+
- test/tmp/app/views/users/mailer/unlock_instructions.html.erb
|
|
288
|
+
- test/tmp/app/views/users/passwords/edit.html.erb
|
|
289
|
+
- test/tmp/app/views/users/passwords/new.html.erb
|
|
290
|
+
- test/tmp/app/views/users/registrations/edit.html.erb
|
|
291
|
+
- test/tmp/app/views/users/registrations/new.html.erb
|
|
292
|
+
- test/tmp/app/views/users/sessions/new.html.erb
|
|
293
|
+
- test/tmp/app/views/users/unlocks/new.html.erb
|
|
263
294
|
homepage: http://github.com/plataformatec/devise
|
|
264
295
|
licenses: []
|
|
265
296
|
post_install_message:
|
|
@@ -280,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
280
311
|
version: '0'
|
|
281
312
|
requirements: []
|
|
282
313
|
rubyforge_project: devise
|
|
283
|
-
rubygems_version: 1.8.
|
|
314
|
+
rubygems_version: 1.8.10
|
|
284
315
|
signing_key:
|
|
285
316
|
specification_version: 3
|
|
286
317
|
summary: Flexible authentication solution for Rails with Warden
|
|
@@ -289,6 +320,7 @@ test_files:
|
|
|
289
320
|
- test/controllers/internal_helpers_test.rb
|
|
290
321
|
- test/controllers/sessions_controller_test.rb
|
|
291
322
|
- test/controllers/url_helpers_test.rb
|
|
323
|
+
- test/delegator_test.rb
|
|
292
324
|
- test/devise_test.rb
|
|
293
325
|
- test/encryptors_test.rb
|
|
294
326
|
- test/failure_app_test.rb
|
|
@@ -331,7 +363,7 @@ test_files:
|
|
|
331
363
|
- test/omniauth/url_helpers_test.rb
|
|
332
364
|
- test/orm/active_record.rb
|
|
333
365
|
- test/orm/mongoid.rb
|
|
334
|
-
- test/
|
|
366
|
+
- test/path_checker_test.rb
|
|
335
367
|
- test/rails_app/app/active_record/admin.rb
|
|
336
368
|
- test/rails_app/app/active_record/shim.rb
|
|
337
369
|
- test/rails_app/app/active_record/user.rb
|
|
@@ -359,7 +391,6 @@ test_files:
|
|
|
359
391
|
- test/rails_app/app/views/users/index.html.erb
|
|
360
392
|
- test/rails_app/app/views/users/mailer/confirmation_instructions.erb
|
|
361
393
|
- test/rails_app/app/views/users/sessions/new.html.erb
|
|
362
|
-
- test/rails_app/config.ru
|
|
363
394
|
- test/rails_app/config/application.rb
|
|
364
395
|
- test/rails_app/config/boot.rb
|
|
365
396
|
- test/rails_app/config/database.yml
|
|
@@ -372,17 +403,20 @@ test_files:
|
|
|
372
403
|
- test/rails_app/config/initializers/inflections.rb
|
|
373
404
|
- test/rails_app/config/initializers/secret_token.rb
|
|
374
405
|
- test/rails_app/config/routes.rb
|
|
406
|
+
- test/rails_app/config.ru
|
|
375
407
|
- test/rails_app/db/migrate/20100401102949_create_tables.rb
|
|
376
408
|
- test/rails_app/db/schema.rb
|
|
377
409
|
- test/rails_app/lib/shared_admin.rb
|
|
378
410
|
- test/rails_app/lib/shared_user.rb
|
|
411
|
+
- test/rails_app/log/development.log
|
|
412
|
+
- test/rails_app/log/test.log
|
|
379
413
|
- test/rails_app/public/404.html
|
|
380
414
|
- test/rails_app/public/422.html
|
|
381
415
|
- test/rails_app/public/500.html
|
|
382
416
|
- test/rails_app/public/favicon.ico
|
|
417
|
+
- test/rails_app/Rakefile
|
|
383
418
|
- test/rails_app/script/rails
|
|
384
419
|
- test/routes_test.rb
|
|
385
|
-
- test/schema_test.rb
|
|
386
420
|
- test/support/assertions.rb
|
|
387
421
|
- test/support/helpers.rb
|
|
388
422
|
- test/support/integration.rb
|
|
@@ -390,3 +424,25 @@ test_files:
|
|
|
390
424
|
- test/support/webrat/integrations/rails.rb
|
|
391
425
|
- test/test_helper.rb
|
|
392
426
|
- test/test_helpers_test.rb
|
|
427
|
+
- test/tmp/app/views/devise/_links.erb
|
|
428
|
+
- test/tmp/app/views/devise/confirmations/new.html.erb
|
|
429
|
+
- test/tmp/app/views/devise/mailer/confirmation_instructions.html.erb
|
|
430
|
+
- test/tmp/app/views/devise/mailer/reset_password_instructions.html.erb
|
|
431
|
+
- test/tmp/app/views/devise/mailer/unlock_instructions.html.erb
|
|
432
|
+
- test/tmp/app/views/devise/passwords/edit.html.erb
|
|
433
|
+
- test/tmp/app/views/devise/passwords/new.html.erb
|
|
434
|
+
- test/tmp/app/views/devise/registrations/edit.html.erb
|
|
435
|
+
- test/tmp/app/views/devise/registrations/new.html.erb
|
|
436
|
+
- test/tmp/app/views/devise/sessions/new.html.erb
|
|
437
|
+
- test/tmp/app/views/devise/unlocks/new.html.erb
|
|
438
|
+
- test/tmp/app/views/users/_links.erb
|
|
439
|
+
- test/tmp/app/views/users/confirmations/new.html.erb
|
|
440
|
+
- test/tmp/app/views/users/mailer/confirmation_instructions.html.erb
|
|
441
|
+
- test/tmp/app/views/users/mailer/reset_password_instructions.html.erb
|
|
442
|
+
- test/tmp/app/views/users/mailer/unlock_instructions.html.erb
|
|
443
|
+
- test/tmp/app/views/users/passwords/edit.html.erb
|
|
444
|
+
- test/tmp/app/views/users/passwords/new.html.erb
|
|
445
|
+
- test/tmp/app/views/users/registrations/edit.html.erb
|
|
446
|
+
- test/tmp/app/views/users/registrations/new.html.erb
|
|
447
|
+
- test/tmp/app/views/users/sessions/new.html.erb
|
|
448
|
+
- test/tmp/app/views/users/unlocks/new.html.erb
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
script: "bundle exec rake test"
|
|
2
|
-
rvm:
|
|
3
|
-
- 1.8.7
|
|
4
|
-
- 1.9.2
|
|
5
|
-
- ree
|
|
6
|
-
- rbx
|
|
7
|
-
- rbx-2.0
|
|
8
|
-
notifications:
|
|
9
|
-
recipients:
|
|
10
|
-
- jose.valim@plataformatec.com.br
|
|
11
|
-
- carlos@plataformatec.com.br
|
|
12
|
-
- rodrigo.flores@plataformatec.com.br
|
|
13
|
-
- rafael.franca@plataformatec.com.br
|
data/Gemfile
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
source "http://rubygems.org"
|
|
2
|
-
|
|
3
|
-
gemspec
|
|
4
|
-
|
|
5
|
-
gem "rails", "~> 3.1.0"
|
|
6
|
-
gem "omniauth", "~> 1.0.0"
|
|
7
|
-
gem "omniauth-oauth2", "~> 1.0.0"
|
|
8
|
-
gem "rdoc"
|
|
9
|
-
|
|
10
|
-
group :test do
|
|
11
|
-
gem "omniauth-facebook"
|
|
12
|
-
gem "omniauth-openid", "~> 1.0.1"
|
|
13
|
-
gem "webrat", "0.7.2", :require => false
|
|
14
|
-
gem "mocha", :require => false
|
|
15
|
-
|
|
16
|
-
platforms :mri_18 do
|
|
17
|
-
gem "ruby-debug", ">= 0.10.3"
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
platforms :jruby do
|
|
22
|
-
gem "activerecord-jdbc-adapter"
|
|
23
|
-
gem "activerecord-jdbcsqlite3-adapter"
|
|
24
|
-
gem "jruby-openssl"
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
platforms :ruby do
|
|
28
|
-
gem "sqlite3-ruby"
|
|
29
|
-
|
|
30
|
-
group :mongoid do
|
|
31
|
-
gem "mongo", "~> 1.3.0"
|
|
32
|
-
gem "mongoid", "~> 2.0"
|
|
33
|
-
gem "bson_ext", "~> 1.3.0"
|
|
34
|
-
end
|
|
35
|
-
end
|
data/Rakefile
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# encoding: UTF-8
|
|
2
|
-
|
|
3
|
-
require 'rake/testtask'
|
|
4
|
-
require 'rdoc/task'
|
|
5
|
-
|
|
6
|
-
desc 'Default: run tests for all ORMs.'
|
|
7
|
-
task :default => :test
|
|
8
|
-
|
|
9
|
-
desc 'Run Devise tests for all ORMs.'
|
|
10
|
-
task :pre_commit do
|
|
11
|
-
Dir[File.join(File.dirname(__FILE__), 'test', 'orm', '*.rb')].each do |file|
|
|
12
|
-
orm = File.basename(file).split(".").first
|
|
13
|
-
# "Some day, my son, rake's inner wisdom will reveal itself. Until then,
|
|
14
|
-
# take this `system` -- may its brute force protect you well."
|
|
15
|
-
exit 1 unless system "rake test DEVISE_ORM=#{orm}"
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
desc 'Run Devise unit tests.'
|
|
20
|
-
Rake::TestTask.new(:test) do |t|
|
|
21
|
-
t.libs << 'lib'
|
|
22
|
-
t.libs << 'test'
|
|
23
|
-
t.pattern = 'test/**/*_test.rb'
|
|
24
|
-
t.verbose = true
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
desc 'Generate documentation for Devise.'
|
|
28
|
-
Rake::RDocTask.new(:rdoc) do |rdoc|
|
|
29
|
-
rdoc.rdoc_dir = 'rdoc'
|
|
30
|
-
rdoc.title = 'Devise'
|
|
31
|
-
rdoc.options << '--line-numbers' << '--inline-source'
|
|
32
|
-
rdoc.rdoc_files.include('README.rdoc')
|
|
33
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
34
|
-
end
|
data/devise.gemspec
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
|
3
|
-
require "devise/version"
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |s|
|
|
6
|
-
s.name = "devise"
|
|
7
|
-
s.version = Devise::VERSION.dup
|
|
8
|
-
s.platform = Gem::Platform::RUBY
|
|
9
|
-
s.summary = "Flexible authentication solution for Rails with Warden"
|
|
10
|
-
s.email = "contact@plataformatec.com.br"
|
|
11
|
-
s.homepage = "http://github.com/plataformatec/devise"
|
|
12
|
-
s.description = "Flexible authentication solution for Rails with Warden"
|
|
13
|
-
s.authors = ['José Valim', 'Carlos Antônio']
|
|
14
|
-
|
|
15
|
-
s.rubyforge_project = "devise"
|
|
16
|
-
|
|
17
|
-
s.files = `git ls-files`.split("\n")
|
|
18
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
19
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
20
|
-
s.require_paths = ["lib"]
|
|
21
|
-
|
|
22
|
-
s.add_dependency("warden", "~> 1.1")
|
|
23
|
-
s.add_dependency("orm_adapter", "~> 0.0.3")
|
|
24
|
-
s.add_dependency("bcrypt-ruby", "~> 3.0")
|
|
25
|
-
end
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
module Devise
|
|
2
|
-
module Controllers
|
|
3
|
-
# Those helpers are used only inside Devise controllers and should not be
|
|
4
|
-
# included in ApplicationController since they all depend on the url being
|
|
5
|
-
# accessed.
|
|
6
|
-
module InternalHelpers #:nodoc:
|
|
7
|
-
extend ActiveSupport::Concern
|
|
8
|
-
include Devise::Controllers::ScopedViews
|
|
9
|
-
include Devise::Controllers::SharedHelpers
|
|
10
|
-
|
|
11
|
-
included do
|
|
12
|
-
helper DeviseHelper
|
|
13
|
-
|
|
14
|
-
helpers = %w(resource scope_name resource_name signed_in_resource
|
|
15
|
-
resource_class devise_mapping devise_controller?)
|
|
16
|
-
hide_action *helpers
|
|
17
|
-
helper_method *helpers
|
|
18
|
-
|
|
19
|
-
prepend_before_filter :is_devise_resource?
|
|
20
|
-
respond_to *Mime::SET.map(&:to_sym) if mimes_for_respond_to.empty?
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
# Gets the actual resource stored in the instance variable
|
|
24
|
-
def resource
|
|
25
|
-
instance_variable_get(:"@#{resource_name}")
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# Proxy to devise map name
|
|
29
|
-
def resource_name
|
|
30
|
-
devise_mapping.name
|
|
31
|
-
end
|
|
32
|
-
alias :scope_name :resource_name
|
|
33
|
-
|
|
34
|
-
# Proxy to devise map class
|
|
35
|
-
def resource_class
|
|
36
|
-
devise_mapping.to
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
# Returns a signed in resource from session (if one exists)
|
|
40
|
-
def signed_in_resource
|
|
41
|
-
warden.authenticate(:scope => resource_name)
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
# Attempt to find the mapped route for devise based on request path
|
|
45
|
-
def devise_mapping
|
|
46
|
-
@devise_mapping ||= request.env["devise.mapping"]
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
# Overwrites devise_controller? to return true
|
|
50
|
-
def devise_controller?
|
|
51
|
-
true
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
protected
|
|
55
|
-
|
|
56
|
-
# Checks whether it's a devise mapped resource or not.
|
|
57
|
-
def is_devise_resource? #:nodoc:
|
|
58
|
-
unknown_action! <<-MESSAGE unless devise_mapping
|
|
59
|
-
Could not find devise mapping for path #{request.fullpath.inspect}.
|
|
60
|
-
Maybe you forgot to wrap your route inside the scope block? For example:
|
|
61
|
-
|
|
62
|
-
devise_scope :user do
|
|
63
|
-
match "/some/route" => "some_devise_controller"
|
|
64
|
-
end
|
|
65
|
-
MESSAGE
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
# Returns real navigational formats which are supported by Rails
|
|
69
|
-
def navigational_formats
|
|
70
|
-
@navigational_formats ||= Devise.navigational_formats.select{ |format| Mime::EXTENSION_LOOKUP[format.to_s] }
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
def unknown_action!(msg)
|
|
74
|
-
logger.debug "[Devise] #{msg}" if logger
|
|
75
|
-
raise ActionController::UnknownAction, msg
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
# Sets the resource creating an instance variable
|
|
79
|
-
def resource=(new_resource)
|
|
80
|
-
instance_variable_set(:"@#{resource_name}", new_resource)
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
# Build a devise resource.
|
|
84
|
-
def build_resource(hash=nil)
|
|
85
|
-
hash ||= params[resource_name] || {}
|
|
86
|
-
self.resource = resource_class.new(hash)
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
# Helper for use in before_filters where no authentication is required.
|
|
90
|
-
#
|
|
91
|
-
# Example:
|
|
92
|
-
# before_filter :require_no_authentication, :only => :new
|
|
93
|
-
def require_no_authentication
|
|
94
|
-
return unless is_navigational_format?
|
|
95
|
-
no_input = devise_mapping.no_input_strategies
|
|
96
|
-
args = no_input.dup.push :scope => resource_name
|
|
97
|
-
if no_input.present? && warden.authenticate?(*args)
|
|
98
|
-
resource = warden.user(resource_name)
|
|
99
|
-
flash[:alert] = I18n.t("devise.failure.already_authenticated")
|
|
100
|
-
redirect_to after_sign_in_path_for(resource)
|
|
101
|
-
end
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
# Helper for use after calling send_*_instructions methods on a resource.
|
|
105
|
-
# If we are in paranoid mode, we always act as if the resource was valid
|
|
106
|
-
# and instructions were sent.
|
|
107
|
-
def successfully_sent?(resource)
|
|
108
|
-
notice = if Devise.paranoid
|
|
109
|
-
resource.errors.clear
|
|
110
|
-
:send_paranoid_instructions
|
|
111
|
-
elsif resource.errors.empty?
|
|
112
|
-
:send_instructions
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
if notice
|
|
116
|
-
set_flash_message :notice, notice if is_navigational_format?
|
|
117
|
-
true
|
|
118
|
-
end
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
# Sets the flash message with :key, using I18n. By default you are able
|
|
122
|
-
# to setup your messages using specific resource scope, and if no one is
|
|
123
|
-
# found we look to default scope.
|
|
124
|
-
# Example (i18n locale file):
|
|
125
|
-
#
|
|
126
|
-
# en:
|
|
127
|
-
# devise:
|
|
128
|
-
# passwords:
|
|
129
|
-
# #default_scope_messages - only if resource_scope is not found
|
|
130
|
-
# user:
|
|
131
|
-
# #resource_scope_messages
|
|
132
|
-
#
|
|
133
|
-
# Please refer to README or en.yml locale file to check what messages are
|
|
134
|
-
# available.
|
|
135
|
-
def set_flash_message(key, kind, options={}) #:nodoc:
|
|
136
|
-
options[:scope] = "devise.#{controller_name}"
|
|
137
|
-
options[:default] = Array(options[:default]).unshift(kind.to_sym)
|
|
138
|
-
options[:resource_name] = resource_name
|
|
139
|
-
message = I18n.t("#{resource_name}.#{kind}", options)
|
|
140
|
-
flash[key] = message if message.present?
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
def clean_up_passwords(object) #:nodoc:
|
|
144
|
-
object.clean_up_passwords if object.respond_to?(:clean_up_passwords)
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
def respond_with_navigational(*args, &block)
|
|
148
|
-
respond_with(*args) do |format|
|
|
149
|
-
format.any(*navigational_formats, &block)
|
|
150
|
-
end
|
|
151
|
-
end
|
|
152
|
-
end
|
|
153
|
-
end
|
|
154
|
-
end
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
module Devise
|
|
2
|
-
module Controllers
|
|
3
|
-
# Helpers used in both FailureApp and Devise controllers.
|
|
4
|
-
module SharedHelpers
|
|
5
|
-
MIME_REFERENCES = Mime::HTML.respond_to?(:ref)
|
|
6
|
-
|
|
7
|
-
protected
|
|
8
|
-
|
|
9
|
-
# Helper used by FailureApp and Devise controllers to retrieve proper formats.
|
|
10
|
-
def request_format
|
|
11
|
-
@request_format ||= if request.format.respond_to?(:ref)
|
|
12
|
-
request.format.ref
|
|
13
|
-
elsif MIME_REFERENCES
|
|
14
|
-
request.format
|
|
15
|
-
elsif request.format # Rails < 3.0.4
|
|
16
|
-
request.format.to_sym
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# Check whether it's navigational format, such as :html or :iphone, or not.
|
|
21
|
-
def is_navigational_format?
|
|
22
|
-
Devise.navigational_formats.include?(request_format)
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
data/test/schema_test.rb
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
if DEVISE_ORM == :mongoid
|
|
2
|
-
|
|
3
|
-
require 'test_helper'
|
|
4
|
-
|
|
5
|
-
class User2
|
|
6
|
-
include Mongoid::Document
|
|
7
|
-
devise :database_authenticatable
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
class User3
|
|
11
|
-
include Mongoid::Document
|
|
12
|
-
devise :database_authenticatable, :authentication_keys => [:username, :email]
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
class User4
|
|
16
|
-
include Mongoid::Document
|
|
17
|
-
devise :database_authenticatable, :authentication_keys => [:username]
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
class SchemaTest < ActiveSupport::TestCase
|
|
21
|
-
test 'should create an email field if there are no custom authentication keys' do
|
|
22
|
-
assert_not_equal User2.fields['email'], nil
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
test 'should create an email field if there are custom authentication keys and they include email' do
|
|
26
|
-
assert_not_equal User3.fields['email'], nil
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
test 'should not create an email field if there are custom authentication keys they don\'t include email' do
|
|
30
|
-
assert_equal User4.fields['email'], nil
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|