clearance 1.8.0 → 1.13.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/.gitignore +2 -0
- data/.travis.yml +24 -6
- data/.yardopts +6 -0
- data/Appraisals +12 -4
- data/CONTRIBUTING.md +4 -1
- data/Gemfile +2 -2
- data/Gemfile.lock +87 -85
- data/NEWS.md +672 -311
- data/README.md +185 -330
- data/app/controllers/clearance/passwords_controller.rb +25 -19
- data/app/controllers/clearance/sessions_controller.rb +17 -4
- data/app/controllers/clearance/users_controller.rb +10 -4
- data/app/mailers/clearance_mailer.rb +2 -3
- data/app/views/clearance_mailer/change_password.html.erb +6 -3
- data/app/views/clearance_mailer/change_password.text.erb +5 -0
- data/app/views/layouts/application.html.erb +2 -2
- data/app/views/passwords/create.html.erb +1 -1
- data/app/views/passwords/edit.html.erb +2 -2
- data/app/views/passwords/new.html.erb +2 -2
- data/app/views/sessions/_form.html.erb +2 -2
- data/app/views/sessions/new.html.erb +1 -1
- data/app/views/users/new.html.erb +2 -2
- data/bin/setup +6 -2
- data/config/locales/clearance.en.yml +6 -0
- data/db/migrate/20110111224543_create_clearance_users.rb +1 -1
- data/gemfiles/{rails3.2.gemfile → rails32.gemfile} +1 -1
- data/gemfiles/{rails4.0.gemfile → rails40.gemfile} +2 -2
- data/gemfiles/{rails4.1.gemfile → rails41.gemfile} +2 -2
- data/gemfiles/{rails4.2.gemfile → rails42.gemfile} +2 -2
- data/gemfiles/rails50.gemfile +19 -0
- data/lib/clearance/authentication.rb +52 -1
- data/lib/clearance/authorization.rb +47 -4
- data/lib/clearance/back_door.rb +1 -0
- data/lib/clearance/configuration.rb +127 -15
- data/lib/clearance/constraints/signed_in.rb +21 -0
- data/lib/clearance/constraints/signed_out.rb +12 -0
- data/lib/clearance/constraints.rb +12 -0
- data/lib/clearance/controller.rb +13 -0
- data/lib/clearance/default_sign_in_guard.rb +17 -0
- data/lib/clearance/engine.rb +24 -4
- data/lib/clearance/password_strategies/bcrypt.rb +9 -2
- data/lib/clearance/password_strategies/bcrypt_migration_from_sha1.rb +19 -0
- data/lib/clearance/password_strategies/blowfish.rb +17 -0
- data/lib/clearance/password_strategies/sha1.rb +17 -0
- data/lib/clearance/password_strategies.rb +13 -0
- data/lib/clearance/rack_session.rb +13 -0
- data/lib/clearance/rspec.rb +15 -4
- data/lib/clearance/session.rb +46 -1
- data/lib/clearance/session_status.rb +7 -0
- data/lib/clearance/sign_in_guard.rb +65 -0
- data/lib/clearance/test_unit.rb +3 -3
- data/lib/clearance/testing/controller_helpers.rb +44 -0
- data/lib/clearance/testing/deny_access_matcher.rb +35 -1
- data/lib/clearance/testing/helpers.rb +9 -25
- data/lib/clearance/testing/view_helpers.rb +32 -0
- data/lib/clearance/token.rb +7 -0
- data/lib/clearance/user.rb +159 -0
- data/lib/clearance/version.rb +1 -1
- data/lib/clearance.rb +2 -0
- data/lib/generators/clearance/install/install_generator.rb +13 -3
- data/lib/generators/clearance/install/templates/db/migrate/add_clearance_to_users.rb +3 -3
- data/lib/generators/clearance/install/templates/db/migrate/create_users.rb +2 -2
- data/lib/generators/clearance/routes/routes_generator.rb +23 -0
- data/lib/generators/clearance/routes/templates/routes.rb +7 -7
- data/lib/generators/clearance/specs/templates/features/clearance/user_signs_out_spec.rb.tt +1 -1
- data/lib/generators/clearance/specs/templates/features/clearance/visitor_resets_password_spec.rb.tt +12 -2
- data/lib/generators/clearance/specs/templates/features/clearance/visitor_signs_in_spec.rb.tt +1 -1
- data/lib/generators/clearance/specs/templates/features/clearance/visitor_signs_up_spec.rb.tt +1 -1
- data/lib/generators/clearance/specs/templates/features/clearance/visitor_updates_password_spec.rb.tt +1 -1
- data/spec/acceptance/clearance_installation_spec.rb +4 -1
- data/spec/app_templates/config/initializers/clearance.rb +2 -0
- data/spec/app_templates/testapp/app/controllers/home_controller.rb +5 -1
- data/spec/app_templates/testapp/config/initializers/action_mailer.rb +1 -3
- data/spec/clearance/controller_spec.rb +11 -0
- data/spec/clearance/rack_session_spec.rb +5 -5
- data/spec/clearance/testing/{helpers_spec.rb → controller_helpers_spec.rb} +12 -12
- data/spec/clearance/testing/view_helpers_spec.rb +37 -0
- data/spec/configuration_spec.rb +24 -0
- data/spec/controllers/apis_controller_spec.rb +6 -2
- data/spec/controllers/forgeries_controller_spec.rb +6 -1
- data/spec/controllers/passwords_controller_spec.rb +1 -11
- data/spec/controllers/permissions_controller_spec.rb +13 -3
- data/spec/controllers/sessions_controller_spec.rb +4 -4
- data/spec/dummy/app/controllers/application_controller.rb +5 -1
- data/spec/dummy/application.rb +4 -0
- data/spec/generators/clearance/install/install_generator_spec.rb +15 -3
- data/spec/generators/clearance/routes/routes_generator_spec.rb +5 -1
- data/spec/generators/clearance/views/views_generator_spec.rb +11 -10
- data/spec/helpers/helper_helpers_spec.rb +10 -0
- data/spec/mailers/clearance_mailer_spec.rb +13 -19
- data/spec/password_strategies/bcrypt_migration_from_sha1_spec.rb +6 -0
- data/spec/password_strategies/blowfish_spec.rb +6 -0
- data/spec/password_strategies/sha1_spec.rb +6 -0
- data/spec/spec_helper.rb +7 -0
- data/spec/support/generator_spec_helpers.rb +4 -0
- data/spec/support/http_method_shim.rb +23 -0
- data/spec/user_spec.rb +9 -0
- data/spec/views/view_helpers_spec.rb +10 -0
- metadata +19 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0472155cf20becdae95b0449996f13422cf8fd9f
|
4
|
+
data.tar.gz: 593e5208e89806394b03e9c0bac1c69f6836434b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c855e609161a0adc70754a033596de44ffc49ded096b0f1e61bb541c670e1d75e82f518e73f5a0ed53d00d25b4763e12d2f9b494a23802c3428154304665097d
|
7
|
+
data.tar.gz: b243f157204f0256c3405e62c8e24219c5101e7852c3818d21e057c0405c36d02aa59dbfe4a3d7f27260eb802b2d1f9d5ff306135fbce1f78d6dcefb39d52cbb
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -6,14 +6,32 @@ language:
|
|
6
6
|
rvm:
|
7
7
|
- 1.9.3
|
8
8
|
- 2.0.0
|
9
|
-
- 2.1.
|
10
|
-
- 2.2.
|
9
|
+
- 2.1.8
|
10
|
+
- 2.2.4
|
11
|
+
- 2.3.0
|
11
12
|
|
12
|
-
|
13
|
-
-
|
13
|
+
gemfile:
|
14
|
+
- gemfiles/rails32.gemfile
|
15
|
+
- gemfiles/rails40.gemfile
|
16
|
+
- gemfiles/rails41.gemfile
|
17
|
+
- gemfiles/rails42.gemfile
|
18
|
+
- gemfiles/rails50.gemfile
|
19
|
+
|
20
|
+
matrix:
|
21
|
+
exclude:
|
22
|
+
- rvm: 1.9.3
|
23
|
+
gemfile: gemfiles/rails50.gemfile
|
24
|
+
- rvm: 2.0.0
|
25
|
+
gemfile: gemfiles/rails50.gemfile
|
26
|
+
- rvm: 2.1.8
|
27
|
+
gemfile: gemfiles/rails50.gemfile
|
28
|
+
- rvm: 2.2.4
|
29
|
+
gemfile: gemfiles/rails32.gemfile
|
30
|
+
- rvm: 2.3.0
|
31
|
+
gemfile: gemfiles/rails32.gemfile
|
14
32
|
|
15
|
-
|
16
|
-
- "
|
33
|
+
install:
|
34
|
+
- "bin/setup"
|
17
35
|
|
18
36
|
branches:
|
19
37
|
only:
|
data/.yardopts
ADDED
data/Appraisals
CHANGED
@@ -1,18 +1,26 @@
|
|
1
1
|
if RUBY_VERSION < "2.2.0"
|
2
|
-
appraise '
|
2
|
+
appraise 'rails32' do
|
3
3
|
gem 'rails', '~> 3.2.21'
|
4
4
|
end
|
5
5
|
end
|
6
6
|
|
7
|
-
appraise '
|
7
|
+
appraise 'rails40' do
|
8
8
|
gem 'rails', '~> 4.0.13'
|
9
9
|
gem 'test-unit'
|
10
10
|
end
|
11
11
|
|
12
|
-
appraise '
|
12
|
+
appraise 'rails41' do
|
13
13
|
gem 'rails', '~> 4.1.9'
|
14
14
|
end
|
15
15
|
|
16
|
-
appraise '
|
16
|
+
appraise 'rails42' do
|
17
17
|
gem 'rails', '~> 4.2.0'
|
18
18
|
end
|
19
|
+
|
20
|
+
if RUBY_VERSION >= "2.2.0"
|
21
|
+
appraise "rails50" do
|
22
|
+
gem "rails", "~> 5.0.0.beta3"
|
23
|
+
gem "rails-controller-testing"
|
24
|
+
gem "rspec-rails", "~> 3.5.0.beta1"
|
25
|
+
end
|
26
|
+
end
|
data/CONTRIBUTING.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
We love pull requests.
|
1
|
+
We love pull requests from everyone. By participating in this project, you agree
|
2
|
+
to abide by the thoughtbot [code of conduct].
|
3
|
+
|
4
|
+
[code of conduct]: https://thoughtbot.com/open-source-code-of-conduct
|
2
5
|
|
3
6
|
1. Fork the repo.
|
4
7
|
|
data/Gemfile
CHANGED
@@ -5,11 +5,11 @@ gemspec
|
|
5
5
|
gem 'appraisal', '~> 1.0'
|
6
6
|
gem 'ammeter'
|
7
7
|
gem 'bundler', '~> 1.3'
|
8
|
-
gem 'capybara', '>= 2.
|
8
|
+
gem 'capybara', '>= 2.6.2'
|
9
9
|
gem 'database_cleaner', '~> 1.0'
|
10
10
|
gem 'factory_girl_rails', '~> 4.2'
|
11
11
|
gem 'rspec-rails', '~> 3.1'
|
12
|
-
gem 'shoulda-matchers', '~> 2.
|
12
|
+
gem 'shoulda-matchers', '~> 2.8'
|
13
13
|
gem 'sqlite3', '~> 1.3'
|
14
14
|
gem 'timecop', '~> 0.6'
|
15
15
|
gem 'pry', require: false
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
clearance (1.
|
4
|
+
clearance (1.13.0)
|
5
5
|
bcrypt
|
6
6
|
email_validator (~> 1.4)
|
7
7
|
rails (>= 3.1)
|
@@ -9,62 +9,65 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actionmailer (4.2.
|
13
|
-
actionpack (= 4.2.
|
14
|
-
actionview (= 4.2.
|
15
|
-
activejob (= 4.2.
|
12
|
+
actionmailer (4.2.5)
|
13
|
+
actionpack (= 4.2.5)
|
14
|
+
actionview (= 4.2.5)
|
15
|
+
activejob (= 4.2.5)
|
16
16
|
mail (~> 2.5, >= 2.5.4)
|
17
17
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
18
|
-
actionpack (4.2.
|
19
|
-
actionview (= 4.2.
|
20
|
-
activesupport (= 4.2.
|
21
|
-
rack (~> 1.6
|
18
|
+
actionpack (4.2.5)
|
19
|
+
actionview (= 4.2.5)
|
20
|
+
activesupport (= 4.2.5)
|
21
|
+
rack (~> 1.6)
|
22
22
|
rack-test (~> 0.6.2)
|
23
23
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
24
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
25
|
-
actionview (4.2.
|
26
|
-
activesupport (= 4.2.
|
24
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
25
|
+
actionview (4.2.5)
|
26
|
+
activesupport (= 4.2.5)
|
27
27
|
builder (~> 3.1)
|
28
28
|
erubis (~> 2.7.0)
|
29
29
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
30
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
31
|
-
activejob (4.2.
|
32
|
-
activesupport (= 4.2.
|
30
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
31
|
+
activejob (4.2.5)
|
32
|
+
activesupport (= 4.2.5)
|
33
33
|
globalid (>= 0.3.0)
|
34
|
-
activemodel (4.2.
|
35
|
-
activesupport (= 4.2.
|
34
|
+
activemodel (4.2.5)
|
35
|
+
activesupport (= 4.2.5)
|
36
36
|
builder (~> 3.1)
|
37
|
-
activerecord (4.2.
|
38
|
-
activemodel (= 4.2.
|
39
|
-
activesupport (= 4.2.
|
37
|
+
activerecord (4.2.5)
|
38
|
+
activemodel (= 4.2.5)
|
39
|
+
activesupport (= 4.2.5)
|
40
40
|
arel (~> 6.0)
|
41
|
-
activesupport (4.2.
|
41
|
+
activesupport (4.2.5)
|
42
42
|
i18n (~> 0.7)
|
43
43
|
json (~> 1.7, >= 1.7.7)
|
44
44
|
minitest (~> 5.1)
|
45
45
|
thread_safe (~> 0.3, >= 0.3.4)
|
46
46
|
tzinfo (~> 1.1)
|
47
|
-
|
47
|
+
addressable (2.4.0)
|
48
|
+
ammeter (1.1.3)
|
48
49
|
activesupport (>= 3.0)
|
49
50
|
railties (>= 3.0)
|
50
51
|
rspec-rails (>= 2.2)
|
51
|
-
appraisal (1.0.
|
52
|
+
appraisal (1.0.3)
|
52
53
|
bundler
|
53
54
|
rake
|
54
55
|
thor (>= 0.14.0)
|
55
|
-
arel (6.0.
|
56
|
-
bcrypt (3.1.
|
56
|
+
arel (6.0.3)
|
57
|
+
bcrypt (3.1.10)
|
57
58
|
builder (3.2.2)
|
58
|
-
capybara (2.
|
59
|
+
capybara (2.6.2)
|
60
|
+
addressable
|
59
61
|
mime-types (>= 1.16)
|
60
62
|
nokogiri (>= 1.3.3)
|
61
63
|
rack (>= 1.0.0)
|
62
64
|
rack-test (>= 0.5.4)
|
63
65
|
xpath (~> 2.0)
|
64
66
|
coderay (1.1.0)
|
65
|
-
|
67
|
+
concurrent-ruby (1.0.1)
|
68
|
+
database_cleaner (1.5.1)
|
66
69
|
diff-lcs (1.2.5)
|
67
|
-
email_validator (1.
|
70
|
+
email_validator (1.6.0)
|
68
71
|
activemodel
|
69
72
|
erubis (2.7.0)
|
70
73
|
factory_girl (4.5.0)
|
@@ -72,87 +75,83 @@ GEM
|
|
72
75
|
factory_girl_rails (4.5.0)
|
73
76
|
factory_girl (~> 4.5.0)
|
74
77
|
railties (>= 3.0.0)
|
75
|
-
globalid (0.3.
|
78
|
+
globalid (0.3.6)
|
76
79
|
activesupport (>= 4.1.0)
|
77
|
-
hike (1.2.3)
|
78
80
|
i18n (0.7.0)
|
79
|
-
json (1.8.
|
80
|
-
loofah (2.0.
|
81
|
+
json (1.8.3)
|
82
|
+
loofah (2.0.3)
|
81
83
|
nokogiri (>= 1.5.9)
|
82
84
|
mail (2.6.3)
|
83
85
|
mime-types (>= 1.16, < 3)
|
84
86
|
method_source (0.8.2)
|
85
|
-
mime-types (2.
|
86
|
-
|
87
|
-
minitest (5.
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
pry (0.10.1)
|
87
|
+
mime-types (2.99)
|
88
|
+
mini_portile2 (2.0.0)
|
89
|
+
minitest (5.8.3)
|
90
|
+
nokogiri (1.6.7.1)
|
91
|
+
mini_portile2 (~> 2.0.0.rc2)
|
92
|
+
pry (0.10.3)
|
92
93
|
coderay (~> 1.1.0)
|
93
94
|
method_source (~> 0.8.1)
|
94
95
|
slop (~> 3.4)
|
95
|
-
rack (1.6.
|
96
|
+
rack (1.6.4)
|
96
97
|
rack-test (0.6.3)
|
97
98
|
rack (>= 1.0)
|
98
|
-
rails (4.2.
|
99
|
-
actionmailer (= 4.2.
|
100
|
-
actionpack (= 4.2.
|
101
|
-
actionview (= 4.2.
|
102
|
-
activejob (= 4.2.
|
103
|
-
activemodel (= 4.2.
|
104
|
-
activerecord (= 4.2.
|
105
|
-
activesupport (= 4.2.
|
99
|
+
rails (4.2.5)
|
100
|
+
actionmailer (= 4.2.5)
|
101
|
+
actionpack (= 4.2.5)
|
102
|
+
actionview (= 4.2.5)
|
103
|
+
activejob (= 4.2.5)
|
104
|
+
activemodel (= 4.2.5)
|
105
|
+
activerecord (= 4.2.5)
|
106
|
+
activesupport (= 4.2.5)
|
106
107
|
bundler (>= 1.3.0, < 2.0)
|
107
|
-
railties (= 4.2.
|
108
|
+
railties (= 4.2.5)
|
108
109
|
sprockets-rails
|
109
110
|
rails-deprecated_sanitizer (1.0.3)
|
110
111
|
activesupport (>= 4.2.0.alpha)
|
111
|
-
rails-dom-testing (1.0.
|
112
|
+
rails-dom-testing (1.0.7)
|
112
113
|
activesupport (>= 4.2.0.beta, < 5.0)
|
113
114
|
nokogiri (~> 1.6.0)
|
114
115
|
rails-deprecated_sanitizer (>= 1.0.1)
|
115
|
-
rails-html-sanitizer (1.0.
|
116
|
+
rails-html-sanitizer (1.0.2)
|
116
117
|
loofah (~> 2.0)
|
117
|
-
railties (4.2.
|
118
|
-
actionpack (= 4.2.
|
119
|
-
activesupport (= 4.2.
|
118
|
+
railties (4.2.5)
|
119
|
+
actionpack (= 4.2.5)
|
120
|
+
activesupport (= 4.2.5)
|
120
121
|
rake (>= 0.8.7)
|
121
122
|
thor (>= 0.18.1, < 2.0)
|
122
123
|
rake (10.4.2)
|
123
|
-
rspec-core (3.1
|
124
|
-
rspec-support (~> 3.
|
125
|
-
rspec-expectations (3.
|
124
|
+
rspec-core (3.4.1)
|
125
|
+
rspec-support (~> 3.4.0)
|
126
|
+
rspec-expectations (3.4.0)
|
126
127
|
diff-lcs (>= 1.2.0, < 2.0)
|
127
|
-
rspec-support (~> 3.
|
128
|
-
rspec-mocks (3.
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
rspec-
|
136
|
-
rspec-
|
137
|
-
rspec-
|
138
|
-
|
139
|
-
|
128
|
+
rspec-support (~> 3.4.0)
|
129
|
+
rspec-mocks (3.4.0)
|
130
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
131
|
+
rspec-support (~> 3.4.0)
|
132
|
+
rspec-rails (3.4.0)
|
133
|
+
actionpack (>= 3.0, < 4.3)
|
134
|
+
activesupport (>= 3.0, < 4.3)
|
135
|
+
railties (>= 3.0, < 4.3)
|
136
|
+
rspec-core (~> 3.4.0)
|
137
|
+
rspec-expectations (~> 3.4.0)
|
138
|
+
rspec-mocks (~> 3.4.0)
|
139
|
+
rspec-support (~> 3.4.0)
|
140
|
+
rspec-support (3.4.1)
|
141
|
+
shoulda-matchers (2.8.0)
|
140
142
|
activesupport (>= 3.0.0)
|
141
143
|
slop (3.6.0)
|
142
|
-
sprockets (
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
sprockets (>= 2.8, < 4.0)
|
151
|
-
sqlite3 (1.3.10)
|
144
|
+
sprockets (3.5.2)
|
145
|
+
concurrent-ruby (~> 1.0)
|
146
|
+
rack (> 1, < 3)
|
147
|
+
sprockets-rails (3.0.4)
|
148
|
+
actionpack (>= 4.0)
|
149
|
+
activesupport (>= 4.0)
|
150
|
+
sprockets (>= 3.0.0)
|
151
|
+
sqlite3 (1.3.11)
|
152
152
|
thor (0.19.1)
|
153
|
-
thread_safe (0.3.
|
154
|
-
|
155
|
-
timecop (0.7.1)
|
153
|
+
thread_safe (0.3.5)
|
154
|
+
timecop (0.8.0)
|
156
155
|
tzinfo (1.2.2)
|
157
156
|
thread_safe (~> 0.1)
|
158
157
|
xpath (2.0.0)
|
@@ -165,12 +164,15 @@ DEPENDENCIES
|
|
165
164
|
ammeter
|
166
165
|
appraisal (~> 1.0)
|
167
166
|
bundler (~> 1.3)
|
168
|
-
capybara (>= 2.
|
167
|
+
capybara (>= 2.6.2)
|
169
168
|
clearance!
|
170
169
|
database_cleaner (~> 1.0)
|
171
170
|
factory_girl_rails (~> 4.2)
|
172
171
|
pry
|
173
172
|
rspec-rails (~> 3.1)
|
174
|
-
shoulda-matchers (~> 2.
|
173
|
+
shoulda-matchers (~> 2.8)
|
175
174
|
sqlite3 (~> 1.3)
|
176
175
|
timecop (~> 0.6)
|
176
|
+
|
177
|
+
BUNDLED WITH
|
178
|
+
1.10.6
|