warden_cookie_session 0.1.0.18558 → 0.1.0.18794
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/warden/cookie_session.rb +1 -1
- data/lib/warden/cookie_session/encrypted_cookie.rb +8 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc0f2470690a41a10f7b110f882731d50dddec97ae0566627f4e4a45aab57be4
|
4
|
+
data.tar.gz: 5556943e93e496a5b38a3fed0362d7f38e13fe4cce2be8e9bd9498d18415b91a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4feb3341035efdec5b7c4102c910306f7336843e48649ad92605d54c15068fa212276af441bbd8ca76d9768b0c7f854aa1105d543d4ddc427702585a76e8dab
|
7
|
+
data.tar.gz: cb2c1a6e1f154de0acc2607df9469bf966914a4ddc781a2b32e8b93952eca643c3db347e5e3d0d60ccee4e116048b0e49df716cc970f46b4b7346bb3de242d61
|
@@ -28,7 +28,7 @@ module Warden
|
|
28
28
|
|
29
29
|
Warden::Manager.after_set_user do |user, auth, _opts|
|
30
30
|
encrypted_cookie = Warden::CookieSession::Strategy.encrypted_cookie(auth.cookies)
|
31
|
-
encrypted_cookie.put(config.serialize_record(user))
|
31
|
+
encrypted_cookie.put(config.serialize_record(user), domain: auth.request.domain)
|
32
32
|
end
|
33
33
|
|
34
34
|
Warden::Manager.before_logout do |_user, auth, _opts|
|
@@ -6,6 +6,7 @@ class Warden::CookieSession::EncryptedCookie
|
|
6
6
|
@store = store
|
7
7
|
@cookie = cookie
|
8
8
|
@secret = secret
|
9
|
+
raise ArgumentError.new('secret must be 32 bytes') if @secret.length != 32
|
9
10
|
|
10
11
|
@encryptor ||= ActiveSupport::MessageEncryptor.new(secret)
|
11
12
|
end
|
@@ -17,8 +18,13 @@ class Warden::CookieSession::EncryptedCookie
|
|
17
18
|
JSON(encryptor.decrypt_and_verify(value))
|
18
19
|
end
|
19
20
|
|
20
|
-
def put(data)
|
21
|
-
|
21
|
+
def put(data, domain: nil)
|
22
|
+
c = {
|
23
|
+
value: encryptor.encrypt_and_sign(data.to_json)
|
24
|
+
}
|
25
|
+
c[:domain] = domain if domain
|
26
|
+
|
27
|
+
store[cookie] = c
|
22
28
|
end
|
23
29
|
|
24
30
|
def clear
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warden_cookie_session
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.18794
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samoilenko Yuri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|