devise_ssl_session_verifiable 3.0.1 → 3.0.2
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.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/devise_ssl_session_verifiable.gemspec +2 -1
- data/lib/devise/controllers/ssl_session_verifiable.rb +2 -2
- data/lib/devise_ssl_session_verifiable/version.rb +1 -1
- data/test/integration/ssl_session_verifiable_test.rb +10 -9
- data/test/rails_app/app/models/admin.rb +1 -1
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19e4814f4a515e2abc7c7ad4fd7330328521c865
|
4
|
+
data.tar.gz: 549185f30b45e1a2514194ee5b20bca87f7b8286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 347d143898a1b36a55a0339c6db16c61a70e0560ea137f31e9076ed40af5efdda5fdcb51ca04d3fcd6e9b6b8cd95b709185a3e6db7c9c60860f8c7513b5b495d
|
7
|
+
data.tar.gz: 05a7d56aba003f1c4579f9979f999532377047227de72c87e128a3503687f6ca080be89ec54106faf26d63b1408d6907487f39a3a9d5d3b41295b7ee2f6aefde
|
data/Gemfile
CHANGED
@@ -19,12 +19,12 @@ module Devise
|
|
19
19
|
|
20
20
|
def secure_ssl_session?(resource)
|
21
21
|
scope = Devise::Mapping.find_scope!(resource)
|
22
|
-
cookies.
|
22
|
+
cookies.signed_or_encrypted[ssl_session_verification_key(scope)] == resource.id
|
23
23
|
end
|
24
24
|
|
25
25
|
def set_ssl_session_verification_cookie(resource)
|
26
26
|
scope = Devise::Mapping.find_scope!(resource)
|
27
|
-
cookies.
|
27
|
+
cookies.signed_or_encrypted[ssl_session_verification_key(scope)] = ssl_session_verification_cookie_values(resource)
|
28
28
|
end
|
29
29
|
|
30
30
|
def remove_ssl_session_verification_cookie(resource)
|
@@ -24,15 +24,6 @@ class SslSessionVerifiableIntegrationTest < ActionDispatch::IntegrationTest
|
|
24
24
|
assert_authenticated_and_verified(:admin, admin)
|
25
25
|
end
|
26
26
|
|
27
|
-
test 'generate verify cookie after token sign in' do
|
28
|
-
admin = create_admin
|
29
|
-
admin.reset_authentication_token!
|
30
|
-
assert admin.authentication_token
|
31
|
-
visit admin_root_url(admin, :auth_token => admin.authentication_token, :protocol => "https")
|
32
|
-
assert_response :success
|
33
|
-
assert_authenticated_and_verified(:admin, admin)
|
34
|
-
end
|
35
|
-
|
36
27
|
test 'generate remember token after sign in setting cookie options' do
|
37
28
|
# We test this by asserting the cookie is not sent after the redirect
|
38
29
|
# since we changed the domain. This is the only difference with the
|
@@ -51,6 +42,16 @@ class SslSessionVerifiableIntegrationTest < ActionDispatch::IntegrationTest
|
|
51
42
|
assert_contain 'Private!'
|
52
43
|
end
|
53
44
|
|
45
|
+
test 'access SSL with signed cookie' do
|
46
|
+
admin = sign_in_as_admin_via_ssl
|
47
|
+
cookies.delete('admin_verify')
|
48
|
+
cookies['admin_verify'] = ActiveSupport::MessageVerifier.new(Rails.application.config.secret_token).generate(admin.id)
|
49
|
+
visit private_url(:protocol => "https")
|
50
|
+
assert_response :success
|
51
|
+
assert_template 'home/private'
|
52
|
+
assert_contain 'Private!'
|
53
|
+
end
|
54
|
+
|
54
55
|
test 'access SSL page but no verify cookie' do
|
55
56
|
sign_in_as_admin_via_ssl
|
56
57
|
drop_verification_cookie
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_ssl_session_verifiable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Reinsch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: devise
|
@@ -16,14 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>'
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '>'
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: railties
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 4.0.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 4.0.0
|
27
41
|
description: Secure access to SSL based pages while sharing a common session between
|
28
42
|
HTTP and HTTPS
|
29
43
|
email: info@mobalean.co,
|
@@ -96,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
110
|
version: '0'
|
97
111
|
requirements: []
|
98
112
|
rubyforge_project: devise_ssl_session_verifiable
|
99
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.2.2
|
100
114
|
signing_key:
|
101
115
|
specification_version: 4
|
102
116
|
summary: Secure access to SSL based pages while sharing a common session between HTTP
|