clearance 1.0.0.rc8 → 1.0.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +8 -1
- data/Gemfile +3 -1
- data/Gemfile.lock +71 -73
- data/NEWS.md +1 -1
- data/README.md +27 -3
- data/clearance.gemspec +12 -14
- data/lib/clearance/version.rb +1 -1
- data/lib/generators/clearance/install/install_generator.rb +5 -1
- data/spec/models/bcrypt_migration_from_sha1_spec.rb +2 -2
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dee0a601f1ee2b04fc8878923101650fc4304caa
|
4
|
+
data.tar.gz: 7327399d9f9e95f00b7846b2969a57617f0f6a80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3972adda04cb8f7a6d61d963cd5454b1dece3836e74722d91f59b5749a8f88b0e84e437461336c3ed30b9fe3f469d058e06340e339ba78ae48b784ce1dd9d3d5
|
7
|
+
data.tar.gz: 177c710269e683a5a97af3ee372be2fed1db48cb49089c9156a9adc5538c20f3ecf47519546a44fb92a70be212f0794cb6915a5930f33579cba0c1b6f110bb3a
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -13,6 +13,8 @@ gem 'factory_girl_rails', '~> 4.2'
|
|
13
13
|
gem 'jbuilder', '~> 1.2'
|
14
14
|
gem 'rspec-rails', '~> 2.13'
|
15
15
|
gem 'sdoc'
|
16
|
-
gem 'shoulda-matchers',
|
16
|
+
gem 'shoulda-matchers',
|
17
|
+
github: 'thoughtbot/shoulda-matchers',
|
18
|
+
branch: 'dp-rails-four'
|
17
19
|
gem 'sqlite3', '~> 1.3'
|
18
20
|
gem 'timecop', '~> 0.6'
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
GIT
|
2
2
|
remote: git://github.com/thoughtbot/shoulda-matchers.git
|
3
|
-
revision:
|
3
|
+
revision: 2b452d5d3970e7319d0d4ea82942960616e05453
|
4
4
|
branch: dp-rails-four
|
5
5
|
specs:
|
6
|
-
shoulda-matchers (2.
|
6
|
+
shoulda-matchers (2.2.0)
|
7
7
|
activesupport (>= 3.0.0)
|
8
8
|
|
9
9
|
PATH
|
10
10
|
remote: .
|
11
11
|
specs:
|
12
|
-
clearance (1.0.0
|
12
|
+
clearance (1.0.0)
|
13
13
|
bcrypt-ruby
|
14
14
|
email_validator (~> 1.4)
|
15
15
|
rails (>= 3.1)
|
@@ -17,45 +17,43 @@ PATH
|
|
17
17
|
GEM
|
18
18
|
remote: https://rubygems.org/
|
19
19
|
specs:
|
20
|
-
actionmailer (
|
21
|
-
actionpack (=
|
22
|
-
mail (~> 2.
|
23
|
-
actionpack (
|
24
|
-
|
25
|
-
|
26
|
-
builder (~> 3.0.0)
|
20
|
+
actionmailer (4.0.0)
|
21
|
+
actionpack (= 4.0.0)
|
22
|
+
mail (~> 2.5.3)
|
23
|
+
actionpack (4.0.0)
|
24
|
+
activesupport (= 4.0.0)
|
25
|
+
builder (~> 3.1.0)
|
27
26
|
erubis (~> 2.7.0)
|
28
|
-
|
29
|
-
rack (~>
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
i18n (~> 0.6)
|
46
|
-
multi_json (~> 1.0)
|
27
|
+
rack (~> 1.5.2)
|
28
|
+
rack-test (~> 0.6.2)
|
29
|
+
activemodel (4.0.0)
|
30
|
+
activesupport (= 4.0.0)
|
31
|
+
builder (~> 3.1.0)
|
32
|
+
activerecord (4.0.0)
|
33
|
+
activemodel (= 4.0.0)
|
34
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
35
|
+
activesupport (= 4.0.0)
|
36
|
+
arel (~> 4.0.0)
|
37
|
+
activerecord-deprecated_finders (1.0.3)
|
38
|
+
activesupport (4.0.0)
|
39
|
+
i18n (~> 0.6, >= 0.6.4)
|
40
|
+
minitest (~> 4.2)
|
41
|
+
multi_json (~> 1.3)
|
42
|
+
thread_safe (~> 0.1)
|
43
|
+
tzinfo (~> 0.3.37)
|
47
44
|
appraisal (0.5.2)
|
48
45
|
bundler
|
49
46
|
rake
|
50
|
-
arel (
|
47
|
+
arel (4.0.0)
|
51
48
|
aruba (0.5.3)
|
52
49
|
childprocess (>= 0.3.6)
|
53
50
|
cucumber (>= 1.1.1)
|
54
51
|
rspec-expectations (>= 2.7.0)
|
52
|
+
atomic (1.1.10)
|
55
53
|
bcrypt-ruby (3.1.1)
|
56
|
-
bourne (1.
|
57
|
-
mocha (
|
58
|
-
builder (3.
|
54
|
+
bourne (1.5.0)
|
55
|
+
mocha (>= 0.13.2, < 0.15)
|
56
|
+
builder (3.1.4)
|
59
57
|
capybara (2.0.3)
|
60
58
|
mime-types (>= 1.16)
|
61
59
|
nokogiri (>= 1.3.3)
|
@@ -65,16 +63,16 @@ GEM
|
|
65
63
|
xpath (~> 1.0.0)
|
66
64
|
childprocess (0.3.9)
|
67
65
|
ffi (~> 1.0, >= 1.0.11)
|
68
|
-
cucumber (1.3.
|
66
|
+
cucumber (1.3.5)
|
69
67
|
builder (>= 2.1.2)
|
70
68
|
diff-lcs (>= 1.1.3)
|
71
69
|
gherkin (~> 2.12.0)
|
72
|
-
multi_json (~> 1.
|
73
|
-
|
70
|
+
multi_json (~> 1.7.5)
|
71
|
+
multi_test (>= 0.0.2)
|
72
|
+
cucumber-rails (1.3.0)
|
74
73
|
capybara (>= 1.1.2)
|
75
|
-
cucumber (>= 1.
|
74
|
+
cucumber (>= 1.1.8)
|
76
75
|
nokogiri (>= 1.5.0)
|
77
|
-
rails (~> 3.0)
|
78
76
|
database_cleaner (1.0.1)
|
79
77
|
diff-lcs (1.2.4)
|
80
78
|
email_validator (1.4.0)
|
@@ -90,60 +88,54 @@ GEM
|
|
90
88
|
multi_json (~> 1.3)
|
91
89
|
hike (1.2.3)
|
92
90
|
i18n (0.6.4)
|
93
|
-
jbuilder (1.
|
91
|
+
jbuilder (1.5.0)
|
94
92
|
activesupport (>= 3.0.0)
|
95
93
|
multi_json (>= 1.2.0)
|
96
|
-
journey (1.0.4)
|
97
94
|
json (1.8.0)
|
98
|
-
mail (2.
|
99
|
-
i18n (>= 0.4.0)
|
95
|
+
mail (2.5.4)
|
100
96
|
mime-types (~> 1.16)
|
101
97
|
treetop (~> 1.4.8)
|
102
98
|
metaclass (0.0.1)
|
103
99
|
mime-types (1.23)
|
104
|
-
mini_portile (0.5.
|
105
|
-
|
100
|
+
mini_portile (0.5.1)
|
101
|
+
minitest (4.7.5)
|
102
|
+
mocha (0.14.0)
|
106
103
|
metaclass (~> 0.0.1)
|
107
104
|
multi_json (1.7.7)
|
105
|
+
multi_test (0.0.2)
|
108
106
|
nokogiri (1.6.0)
|
109
107
|
mini_portile (~> 0.5.0)
|
110
108
|
polyglot (0.3.3)
|
111
|
-
rack (1.
|
112
|
-
rack-cache (1.2)
|
113
|
-
rack (>= 0.4)
|
114
|
-
rack-ssl (1.3.3)
|
115
|
-
rack
|
109
|
+
rack (1.5.2)
|
116
110
|
rack-test (0.6.2)
|
117
111
|
rack (>= 1.0)
|
118
|
-
rails (
|
119
|
-
actionmailer (=
|
120
|
-
actionpack (=
|
121
|
-
activerecord (=
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
railties (
|
127
|
-
actionpack (=
|
128
|
-
activesupport (=
|
129
|
-
rack-ssl (~> 1.3.2)
|
112
|
+
rails (4.0.0)
|
113
|
+
actionmailer (= 4.0.0)
|
114
|
+
actionpack (= 4.0.0)
|
115
|
+
activerecord (= 4.0.0)
|
116
|
+
activesupport (= 4.0.0)
|
117
|
+
bundler (>= 1.3.0, < 2.0)
|
118
|
+
railties (= 4.0.0)
|
119
|
+
sprockets-rails (~> 2.0.0)
|
120
|
+
railties (4.0.0)
|
121
|
+
actionpack (= 4.0.0)
|
122
|
+
activesupport (= 4.0.0)
|
130
123
|
rake (>= 0.8.7)
|
131
|
-
|
132
|
-
thor (>= 0.14.6, < 2.0)
|
124
|
+
thor (>= 0.18.1, < 2.0)
|
133
125
|
rake (10.1.0)
|
134
126
|
rdoc (3.12.2)
|
135
127
|
json (~> 1.4)
|
136
|
-
rspec-core (2.
|
137
|
-
rspec-expectations (2.
|
128
|
+
rspec-core (2.14.4)
|
129
|
+
rspec-expectations (2.14.0)
|
138
130
|
diff-lcs (>= 1.1.3, < 2.0)
|
139
|
-
rspec-mocks (2.
|
140
|
-
rspec-rails (2.
|
131
|
+
rspec-mocks (2.14.2)
|
132
|
+
rspec-rails (2.14.0)
|
141
133
|
actionpack (>= 3.0)
|
142
134
|
activesupport (>= 3.0)
|
143
135
|
railties (>= 3.0)
|
144
|
-
rspec-core (~> 2.
|
145
|
-
rspec-expectations (~> 2.
|
146
|
-
rspec-mocks (~> 2.
|
136
|
+
rspec-core (~> 2.14.0)
|
137
|
+
rspec-expectations (~> 2.14.0)
|
138
|
+
rspec-mocks (~> 2.14.0)
|
147
139
|
rubyzip (0.9.9)
|
148
140
|
sdoc (0.3.20)
|
149
141
|
json (>= 1.1.3)
|
@@ -153,15 +145,21 @@ GEM
|
|
153
145
|
multi_json (~> 1.0)
|
154
146
|
rubyzip
|
155
147
|
websocket (~> 1.0.4)
|
156
|
-
sprockets (2.
|
148
|
+
sprockets (2.10.0)
|
157
149
|
hike (~> 1.2)
|
158
150
|
multi_json (~> 1.0)
|
159
151
|
rack (~> 1.0)
|
160
152
|
tilt (~> 1.1, != 1.3.0)
|
161
|
-
|
153
|
+
sprockets-rails (2.0.0)
|
154
|
+
actionpack (>= 3.0)
|
155
|
+
activesupport (>= 3.0)
|
156
|
+
sprockets (~> 2.8)
|
157
|
+
sqlite3 (1.3.7)
|
162
158
|
thor (0.18.1)
|
159
|
+
thread_safe (0.1.2)
|
160
|
+
atomic
|
163
161
|
tilt (1.4.1)
|
164
|
-
timecop (0.6.
|
162
|
+
timecop (0.6.2.2)
|
165
163
|
treetop (1.4.14)
|
166
164
|
polyglot
|
167
165
|
polyglot (>= 0.3.1)
|
data/NEWS.md
CHANGED
data/README.md
CHANGED
@@ -23,7 +23,7 @@ It works with Rails 4 and Ruby 2.
|
|
23
23
|
Include the gem in your Gemfile:
|
24
24
|
|
25
25
|
```ruby
|
26
|
-
gem 'clearance', '1.0.0
|
26
|
+
gem 'clearance', '1.0.0'
|
27
27
|
```
|
28
28
|
|
29
29
|
Bundle:
|
@@ -57,11 +57,11 @@ Override any of these defaults in `config/initializers/clearance.rb`:
|
|
57
57
|
Clearance.configure do |config|
|
58
58
|
config.cookie_expiration = lambda { 1.year.from_now.utc }
|
59
59
|
config.httponly = false
|
60
|
-
config.secure_cookie = false
|
61
60
|
config.mailer_sender = 'reply@example.com'
|
62
61
|
config.password_strategy = Clearance::PasswordStrategies::BCrypt
|
63
|
-
config.user_model = User
|
64
62
|
config.redirect_url = '/'
|
63
|
+
config.secure_cookie = false
|
64
|
+
config.user_model = User
|
65
65
|
end
|
66
66
|
```
|
67
67
|
|
@@ -330,6 +330,30 @@ Clearance.configure do |config|
|
|
330
330
|
end
|
331
331
|
```
|
332
332
|
|
333
|
+
Deliver password reset email in a background job
|
334
|
+
------------------------------------------------
|
335
|
+
|
336
|
+
Clearance has one mailer. It is used to reset the user's password.
|
337
|
+
|
338
|
+
To deliver it in a background job using a queue system like [Delayed
|
339
|
+
Job](https://github.com/collectiveidea/delayed_job), subclass
|
340
|
+
`Clearance::PasswordsController` and define the behavior you need in its
|
341
|
+
`deliver_email` method:
|
342
|
+
|
343
|
+
```ruby
|
344
|
+
class PasswordsController < Clearance::PasswordsController
|
345
|
+
def deliver_email(user)
|
346
|
+
ClearanceMailer.delay.change_password(user)
|
347
|
+
end
|
348
|
+
end
|
349
|
+
```
|
350
|
+
|
351
|
+
Then, override the route:
|
352
|
+
|
353
|
+
```ruby
|
354
|
+
resources :passwords, only: [:create]
|
355
|
+
```
|
356
|
+
|
333
357
|
Optional feature specs
|
334
358
|
----------------------
|
335
359
|
|
data/clearance.gemspec
CHANGED
@@ -3,8 +3,9 @@ require 'clearance/version'
|
|
3
3
|
require 'date'
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
|
-
s.
|
7
|
-
s.
|
6
|
+
s.add_dependency 'bcrypt-ruby'
|
7
|
+
s.add_dependency 'email_validator', '~> 1.4'
|
8
|
+
s.add_dependency 'rails', '>= 3.1'
|
8
9
|
s.authors = [
|
9
10
|
'Dan Croak',
|
10
11
|
'Eugene Bolshakov',
|
@@ -25,20 +26,17 @@ Gem::Specification.new do |s|
|
|
25
26
|
'Galen Frechette',
|
26
27
|
'Josh Steiner'
|
27
28
|
]
|
28
|
-
s.
|
29
|
-
s.
|
30
|
-
s.summary = %q{Rails authentication & authorization with email & password.}
|
31
|
-
s.description = %q{Rails authentication & authorization with email & password.}
|
32
|
-
|
33
|
-
s.files = `git ls-files`.split("\n")
|
34
|
-
s.test_files = `git ls-files -- {features,spec}/*`.split("\n")
|
29
|
+
s.description = 'Rails authentication & authorization with email & password.'
|
30
|
+
s.email = 'support@thoughtbot.com'
|
35
31
|
s.extra_rdoc_files = %w(LICENSE README.md)
|
32
|
+
s.files = `git ls-files`.split("\n")
|
33
|
+
s.homepage = 'http://github.com/thoughtbot/clearance'
|
34
|
+
s.license = 'MIT'
|
35
|
+
s.name = %q{clearance}
|
36
36
|
s.rdoc_options = ['--charset=UTF-8']
|
37
37
|
s.require_paths = ['lib']
|
38
|
-
|
39
38
|
s.required_ruby_version = Gem::Requirement.new('>= 1.9.2')
|
40
|
-
|
41
|
-
s.
|
42
|
-
s.
|
43
|
-
s.add_dependency 'rails', '>= 3.1'
|
39
|
+
s.summary = 'Rails authentication & authorization with email & password.'
|
40
|
+
s.test_files = `git ls-files -- {features,spec}/*`.split("\n")
|
41
|
+
s.version = Clearance::VERSION
|
44
42
|
end
|
data/lib/clearance/version.rb
CHANGED
@@ -21,7 +21,11 @@ module Clearance
|
|
21
21
|
|
22
22
|
def create_or_inject_clearance_into_user_model
|
23
23
|
if File.exists? 'app/models/user.rb'
|
24
|
-
|
24
|
+
inject_into_file(
|
25
|
+
'app/models/user.rb',
|
26
|
+
"include Clearance::User\n\n",
|
27
|
+
after: "class User < ActiveRecord::Base\n"
|
28
|
+
)
|
25
29
|
else
|
26
30
|
copy_file 'user.rb', 'app/models/user.rb'
|
27
31
|
end
|
@@ -54,9 +54,9 @@ describe Clearance::PasswordStrategies::BCryptMigrationFromSHA1 do
|
|
54
54
|
end
|
55
55
|
|
56
56
|
it 'does not raise a BCrypt error for invalid passwords' do
|
57
|
-
|
57
|
+
expect {
|
58
58
|
subject.authenticated? 'bad' + password
|
59
|
-
}.
|
59
|
+
}.not_to raise_error
|
60
60
|
end
|
61
61
|
|
62
62
|
it 'saves the subject to database' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clearance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Croak
|
@@ -25,7 +25,7 @@ authors:
|
|
25
25
|
autorequire:
|
26
26
|
bindir: bin
|
27
27
|
cert_chain: []
|
28
|
-
date: 2013-
|
28
|
+
date: 2013-08-01 00:00:00.000000000 Z
|
29
29
|
dependencies:
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: bcrypt-ruby
|
@@ -189,7 +189,8 @@ files:
|
|
189
189
|
- spec/support/fake_model_with_password_strategy.rb
|
190
190
|
- spec/support/request_with_remember_token.rb
|
191
191
|
homepage: http://github.com/thoughtbot/clearance
|
192
|
-
licenses:
|
192
|
+
licenses:
|
193
|
+
- MIT
|
193
194
|
metadata: {}
|
194
195
|
post_install_message:
|
195
196
|
rdoc_options:
|
@@ -203,9 +204,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
203
204
|
version: 1.9.2
|
204
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
206
|
requirements:
|
206
|
-
- - '
|
207
|
+
- - '>='
|
207
208
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
209
|
+
version: '0'
|
209
210
|
requirements: []
|
210
211
|
rubyforge_project:
|
211
212
|
rubygems_version: 2.0.5
|