clearance 0.16.3 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of clearance might be problematic. Click here for more details.

Files changed (85) hide show
  1. data/.gitignore +1 -0
  2. data/.travis.yml +0 -2
  3. data/Appraisals +2 -2
  4. data/CONTRIBUTING.md +10 -19
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +81 -82
  7. data/NEWS.md +17 -4
  8. data/README.md +176 -113
  9. data/app/controllers/clearance/passwords_controller.rb +44 -31
  10. data/app/controllers/clearance/sessions_controller.rb +11 -10
  11. data/app/controllers/clearance/users_controller.rb +8 -12
  12. data/app/mailers/clearance_mailer.rb +4 -5
  13. data/app/views/clearance_mailer/change_password.html.erb +2 -4
  14. data/app/views/layouts/application.html.erb +7 -5
  15. data/app/views/passwords/edit.html.erb +8 -7
  16. data/app/views/passwords/new.html.erb +6 -5
  17. data/app/views/sessions/_form.html.erb +7 -5
  18. data/app/views/sessions/new.html.erb +3 -2
  19. data/app/views/users/_form.html.erb +4 -3
  20. data/clearance.gemspec +29 -27
  21. data/config/routes.rb +10 -13
  22. data/db/migrate/20110111224543_create_clearance_users.rb +18 -0
  23. data/db/schema.rb +4 -5
  24. data/features/engine/visitor_resets_password.feature +0 -7
  25. data/features/engine/visitor_signs_in.feature +7 -0
  26. data/features/engine/visitor_signs_up.feature +2 -2
  27. data/features/integration.feature +0 -1
  28. data/features/integration_with_test_unit.feature +43 -0
  29. data/features/step_definitions/configuration_steps.rb +8 -15
  30. data/features/step_definitions/engine/clearance_steps.rb +38 -38
  31. data/features/support/clearance.rb +1 -1
  32. data/features/support/env.rb +4 -21
  33. data/gemfiles/{3.0.12.gemfile → 3.0.15.gemfile} +1 -1
  34. data/gemfiles/{3.0.12.gemfile.lock → 3.0.15.gemfile.lock} +75 -76
  35. data/gemfiles/{3.2.3.gemfile → 3.1.6.gemfile} +1 -1
  36. data/gemfiles/{3.1.4.gemfile.lock → 3.1.6.gemfile.lock} +79 -80
  37. data/gemfiles/{3.1.4.gemfile → 3.2.6.gemfile} +1 -1
  38. data/gemfiles/{3.2.3.gemfile.lock → 3.2.6.gemfile.lock} +80 -81
  39. data/lib/clearance.rb +1 -0
  40. data/lib/clearance/authentication.rb +37 -69
  41. data/lib/clearance/configuration.rb +3 -18
  42. data/lib/clearance/constraints.rb +2 -0
  43. data/lib/clearance/constraints/signed_in.rb +28 -0
  44. data/lib/clearance/constraints/signed_out.rb +9 -0
  45. data/lib/clearance/engine.rb +4 -4
  46. data/lib/clearance/password_strategies.rb +5 -1
  47. data/lib/clearance/password_strategies/bcrypt.rb +27 -0
  48. data/lib/clearance/password_strategies/bcrypt_migration_from_sha1.rb +52 -0
  49. data/lib/clearance/password_strategies/blowfish.rb +11 -15
  50. data/lib/clearance/password_strategies/fake.rb +23 -0
  51. data/lib/clearance/password_strategies/sha1.rb +15 -21
  52. data/lib/clearance/session.rb +28 -20
  53. data/lib/clearance/testing.rb +8 -3
  54. data/lib/clearance/testing/assertion_error.rb +2 -7
  55. data/lib/clearance/testing/deny_access_matcher.rb +27 -32
  56. data/lib/clearance/testing/helpers.rb +7 -8
  57. data/lib/clearance/user.rb +26 -92
  58. data/lib/clearance/version.rb +1 -1
  59. data/lib/generators/clearance/install/templates/db/migrate/upgrade_clearance_to_diesel.rb +24 -26
  60. data/spec/clearance/constraints/signed_in_spec.rb +51 -0
  61. data/spec/clearance/constraints/signed_out_spec.rb +15 -0
  62. data/spec/clearance/rack_session_spec.rb +8 -7
  63. data/spec/clearance/session_spec.rb +28 -27
  64. data/spec/configuration_spec.rb +7 -6
  65. data/spec/controllers/denies_controller_spec.rb +11 -10
  66. data/spec/controllers/flashes_controller_spec.rb +5 -5
  67. data/spec/controllers/forgeries_controller_spec.rb +9 -9
  68. data/spec/controllers/passwords_controller_spec.rb +42 -55
  69. data/spec/controllers/sessions_controller_spec.rb +26 -33
  70. data/spec/controllers/users_controller_spec.rb +16 -14
  71. data/spec/factories.rb +1 -3
  72. data/spec/mailers/clearance_mailer_spec.rb +4 -4
  73. data/spec/models/bcrypt_migration_from_sha1_spec.rb +71 -0
  74. data/spec/models/bcrypt_spec.rb +40 -0
  75. data/spec/models/blowfish_spec.rb +14 -13
  76. data/spec/models/{clearance_user_spec.rb → password_strategies_spec.rb} +5 -5
  77. data/spec/models/sha1_spec.rb +18 -13
  78. data/spec/models/user_spec.rb +58 -73
  79. data/spec/spec_helper.rb +5 -6
  80. data/spec/support/clearance.rb +0 -4
  81. data/spec/support/cookies.rb +25 -27
  82. data/spec/support/request_with_remember_token.rb +19 -0
  83. metadata +95 -90
  84. data/db/migrate/20110111224543_create_diesel_clearance_users.rb +0 -19
  85. data/init.rb +0 -1
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clearance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.3
5
- prerelease:
4
+ version: 1.0.0.rc1
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Dan Croak
@@ -18,173 +18,173 @@ authors:
18
18
  autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
- date: 2012-06-01 00:00:00.000000000Z
21
+ date: 2012-07-23 00:00:00.000000000Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
- name: rails
25
- requirement: &26263740 !ruby/object:Gem::Requirement
24
+ name: bcrypt-ruby
25
+ requirement: &17307160 !ruby/object:Gem::Requirement
26
26
  none: false
27
27
  requirements:
28
28
  - - ! '>='
29
29
  - !ruby/object:Gem::Version
30
- version: '3.0'
30
+ version: '0'
31
31
  type: :runtime
32
32
  prerelease: false
33
- version_requirements: *26263740
33
+ version_requirements: *17307160
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: diesel
36
- requirement: &26263200 !ruby/object:Gem::Requirement
36
+ requirement: &17306160 !ruby/object:Gem::Requirement
37
37
  none: false
38
38
  requirements:
39
- - - ~>
39
+ - - =
40
40
  - !ruby/object:Gem::Version
41
41
  version: 0.1.5
42
42
  type: :runtime
43
43
  prerelease: false
44
- version_requirements: *26263200
44
+ version_requirements: *17306160
45
45
  - !ruby/object:Gem::Dependency
46
- name: bundler
47
- requirement: &26262720 !ruby/object:Gem::Requirement
46
+ name: rails
47
+ requirement: &17299600 !ruby/object:Gem::Requirement
48
48
  none: false
49
49
  requirements:
50
- - - ~>
50
+ - - ! '>='
51
51
  - !ruby/object:Gem::Version
52
- version: 1.1.0
53
- type: :development
52
+ version: '3.0'
53
+ type: :runtime
54
54
  prerelease: false
55
- version_requirements: *26262720
55
+ version_requirements: *17299600
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: appraisal
58
- requirement: &26262240 !ruby/object:Gem::Requirement
58
+ requirement: &17296840 !ruby/object:Gem::Requirement
59
59
  none: false
60
60
  requirements:
61
- - - ~>
61
+ - - =
62
62
  - !ruby/object:Gem::Version
63
63
  version: 0.4.1
64
64
  type: :development
65
65
  prerelease: false
66
- version_requirements: *26262240
66
+ version_requirements: *17296840
67
67
  - !ruby/object:Gem::Dependency
68
- name: cucumber-rails
69
- requirement: &26254940 !ruby/object:Gem::Requirement
68
+ name: aruba
69
+ requirement: &17295840 !ruby/object:Gem::Requirement
70
70
  none: false
71
71
  requirements:
72
- - - ~>
72
+ - - =
73
73
  - !ruby/object:Gem::Version
74
- version: 1.1.1
74
+ version: 0.4.11
75
75
  type: :development
76
76
  prerelease: false
77
- version_requirements: *26254940
77
+ version_requirements: *17295840
78
78
  - !ruby/object:Gem::Dependency
79
- name: rspec-rails
80
- requirement: &26254480 !ruby/object:Gem::Requirement
79
+ name: bourne
80
+ requirement: &17294500 !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements:
83
- - - ~>
83
+ - - =
84
84
  - !ruby/object:Gem::Version
85
- version: 2.9.0
85
+ version: 1.1.2
86
86
  type: :development
87
87
  prerelease: false
88
- version_requirements: *26254480
88
+ version_requirements: *17294500
89
89
  - !ruby/object:Gem::Dependency
90
- name: sqlite3
91
- requirement: &26254100 !ruby/object:Gem::Requirement
90
+ name: bundler
91
+ requirement: &17293220 !ruby/object:Gem::Requirement
92
92
  none: false
93
93
  requirements:
94
- - - ! '>='
94
+ - - =
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: 1.1.3
97
97
  type: :development
98
98
  prerelease: false
99
- version_requirements: *26254100
99
+ version_requirements: *17293220
100
100
  - !ruby/object:Gem::Dependency
101
- name: bourne
102
- requirement: &26253520 !ruby/object:Gem::Requirement
101
+ name: capybara
102
+ requirement: &17292640 !ruby/object:Gem::Requirement
103
103
  none: false
104
104
  requirements:
105
- - - ~>
105
+ - - =
106
106
  - !ruby/object:Gem::Version
107
107
  version: 1.1.2
108
108
  type: :development
109
109
  prerelease: false
110
- version_requirements: *26253520
110
+ version_requirements: *17292640
111
111
  - !ruby/object:Gem::Dependency
112
- name: timecop
113
- requirement: &26253100 !ruby/object:Gem::Requirement
112
+ name: cucumber-rails
113
+ requirement: &17291720 !ruby/object:Gem::Requirement
114
114
  none: false
115
115
  requirements:
116
- - - ! '>='
116
+ - - =
117
117
  - !ruby/object:Gem::Version
118
- version: '0'
118
+ version: 1.1.1
119
119
  type: :development
120
120
  prerelease: false
121
- version_requirements: *26253100
121
+ version_requirements: *17291720
122
122
  - !ruby/object:Gem::Dependency
123
- name: capybara
124
- requirement: &26252540 !ruby/object:Gem::Requirement
123
+ name: database_cleaner
124
+ requirement: &17291020 !ruby/object:Gem::Requirement
125
125
  none: false
126
126
  requirements:
127
- - - ~>
127
+ - - =
128
128
  - !ruby/object:Gem::Version
129
- version: 1.1.2
129
+ version: 0.8.0
130
130
  type: :development
131
131
  prerelease: false
132
- version_requirements: *26252540
132
+ version_requirements: *17291020
133
133
  - !ruby/object:Gem::Dependency
134
134
  name: factory_girl_rails
135
- requirement: &26252040 !ruby/object:Gem::Requirement
135
+ requirement: &17290420 !ruby/object:Gem::Requirement
136
136
  none: false
137
137
  requirements:
138
- - - ~>
138
+ - - =
139
139
  - !ruby/object:Gem::Version
140
- version: 3.1.0
140
+ version: 3.5.0
141
141
  type: :development
142
142
  prerelease: false
143
- version_requirements: *26252040
143
+ version_requirements: *17290420
144
144
  - !ruby/object:Gem::Dependency
145
- name: shoulda-matchers
146
- requirement: &26251580 !ruby/object:Gem::Requirement
145
+ name: rspec-rails
146
+ requirement: &17289660 !ruby/object:Gem::Requirement
147
147
  none: false
148
148
  requirements:
149
- - - ~>
149
+ - - =
150
150
  - !ruby/object:Gem::Version
151
- version: 1.1.0
151
+ version: 2.11.0
152
152
  type: :development
153
153
  prerelease: false
154
- version_requirements: *26251580
154
+ version_requirements: *17289660
155
155
  - !ruby/object:Gem::Dependency
156
- name: database_cleaner
157
- requirement: &26251200 !ruby/object:Gem::Requirement
156
+ name: shoulda-matchers
157
+ requirement: &17289100 !ruby/object:Gem::Requirement
158
158
  none: false
159
159
  requirements:
160
- - - ! '>='
160
+ - - =
161
161
  - !ruby/object:Gem::Version
162
- version: '0'
162
+ version: 1.2.0
163
163
  type: :development
164
164
  prerelease: false
165
- version_requirements: *26251200
165
+ version_requirements: *17289100
166
166
  - !ruby/object:Gem::Dependency
167
- name: launchy
168
- requirement: &26250740 !ruby/object:Gem::Requirement
167
+ name: sqlite3
168
+ requirement: &17288340 !ruby/object:Gem::Requirement
169
169
  none: false
170
170
  requirements:
171
- - - ! '>='
171
+ - - =
172
172
  - !ruby/object:Gem::Version
173
- version: '0'
173
+ version: 1.3.6
174
174
  type: :development
175
175
  prerelease: false
176
- version_requirements: *26250740
176
+ version_requirements: *17288340
177
177
  - !ruby/object:Gem::Dependency
178
- name: aruba
179
- requirement: &26250240 !ruby/object:Gem::Requirement
178
+ name: timecop
179
+ requirement: &17286940 !ruby/object:Gem::Requirement
180
180
  none: false
181
181
  requirements:
182
- - - ~>
182
+ - - =
183
183
  - !ruby/object:Gem::Version
184
- version: 0.4.11
184
+ version: 0.3.5
185
185
  type: :development
186
186
  prerelease: false
187
- version_requirements: *26250240
187
+ version_requirements: *17286940
188
188
  description: Rails authentication & authorization with email & password.
189
189
  email: support@thoughtbot.com
190
190
  executables: []
@@ -220,31 +220,37 @@ files:
220
220
  - clearance.gemspec
221
221
  - config/routes.rb
222
222
  - cucumber.yml
223
- - db/migrate/20110111224543_create_diesel_clearance_users.rb
223
+ - db/migrate/20110111224543_create_clearance_users.rb
224
224
  - db/schema.rb
225
225
  - features/engine/visitor_resets_password.feature
226
226
  - features/engine/visitor_signs_in.feature
227
227
  - features/engine/visitor_signs_out.feature
228
228
  - features/engine/visitor_signs_up.feature
229
229
  - features/integration.feature
230
+ - features/integration_with_test_unit.feature
230
231
  - features/step_definitions/configuration_steps.rb
231
232
  - features/step_definitions/engine/clearance_steps.rb
232
233
  - features/support/aruba.rb
233
234
  - features/support/clearance.rb
234
235
  - features/support/env.rb
235
- - gemfiles/3.0.12.gemfile
236
- - gemfiles/3.0.12.gemfile.lock
237
- - gemfiles/3.1.4.gemfile
238
- - gemfiles/3.1.4.gemfile.lock
239
- - gemfiles/3.2.3.gemfile
240
- - gemfiles/3.2.3.gemfile.lock
241
- - init.rb
236
+ - gemfiles/3.0.15.gemfile
237
+ - gemfiles/3.0.15.gemfile.lock
238
+ - gemfiles/3.1.6.gemfile
239
+ - gemfiles/3.1.6.gemfile.lock
240
+ - gemfiles/3.2.6.gemfile
241
+ - gemfiles/3.2.6.gemfile.lock
242
242
  - lib/clearance.rb
243
243
  - lib/clearance/authentication.rb
244
244
  - lib/clearance/configuration.rb
245
+ - lib/clearance/constraints.rb
246
+ - lib/clearance/constraints/signed_in.rb
247
+ - lib/clearance/constraints/signed_out.rb
245
248
  - lib/clearance/engine.rb
246
249
  - lib/clearance/password_strategies.rb
250
+ - lib/clearance/password_strategies/bcrypt.rb
251
+ - lib/clearance/password_strategies/bcrypt_migration_from_sha1.rb
247
252
  - lib/clearance/password_strategies/blowfish.rb
253
+ - lib/clearance/password_strategies/fake.rb
248
254
  - lib/clearance/password_strategies/sha1.rb
249
255
  - lib/clearance/rack_session.rb
250
256
  - lib/clearance/session.rb
@@ -261,6 +267,8 @@ files:
261
267
  - lib/generators/clearance/install/templates/db/migrate/upgrade_clearance_to_diesel.rb
262
268
  - lib/generators/clearance/install/templates/user.rb
263
269
  - lib/generators/clearance/views/views_generator.rb
270
+ - spec/clearance/constraints/signed_in_spec.rb
271
+ - spec/clearance/constraints/signed_out_spec.rb
264
272
  - spec/clearance/rack_session_spec.rb
265
273
  - spec/clearance/session_spec.rb
266
274
  - spec/configuration_spec.rb
@@ -272,13 +280,16 @@ files:
272
280
  - spec/controllers/users_controller_spec.rb
273
281
  - spec/factories.rb
274
282
  - spec/mailers/clearance_mailer_spec.rb
283
+ - spec/models/bcrypt_migration_from_sha1_spec.rb
284
+ - spec/models/bcrypt_spec.rb
275
285
  - spec/models/blowfish_spec.rb
276
- - spec/models/clearance_user_spec.rb
286
+ - spec/models/password_strategies_spec.rb
277
287
  - spec/models/sha1_spec.rb
278
288
  - spec/models/user_spec.rb
279
289
  - spec/spec_helper.rb
280
290
  - spec/support/clearance.rb
281
291
  - spec/support/cookies.rb
292
+ - spec/support/request_with_remember_token.rb
282
293
  homepage: http://github.com/thoughtbot/clearance
283
294
  licenses: []
284
295
  post_install_message:
@@ -291,19 +302,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
291
302
  requirements:
292
303
  - - ! '>='
293
304
  - !ruby/object:Gem::Version
294
- version: '0'
295
- segments:
296
- - 0
297
- hash: 1832581337987577676
305
+ version: 1.9.2
298
306
  required_rubygems_version: !ruby/object:Gem::Requirement
299
307
  none: false
300
308
  requirements:
301
- - - ! '>='
309
+ - - ! '>'
302
310
  - !ruby/object:Gem::Version
303
- version: '0'
304
- segments:
305
- - 0
306
- hash: 1832581337987577676
311
+ version: 1.3.1
307
312
  requirements: []
308
313
  rubyforge_project:
309
314
  rubygems_version: 1.8.10
@@ -1,19 +0,0 @@
1
- class CreateDieselClearanceUsers < ActiveRecord::Migration
2
- def self.up
3
- create_table(:users) do |t|
4
- t.string :email
5
- t.string :encrypted_password, :limit => 128
6
- t.string :salt, :limit => 128
7
- t.string :confirmation_token, :limit => 128
8
- t.string :remember_token, :limit => 128
9
- t.timestamps
10
- end
11
-
12
- add_index :users, :email
13
- add_index :users, :remember_token
14
- end
15
-
16
- def self.down
17
- drop_table :users
18
- end
19
- end
data/init.rb DELETED
@@ -1 +0,0 @@
1
- require 'clearance'