mumukit-login 7.1.1 → 7.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mumukit/login/mucookie.rb +22 -8
- data/lib/mumukit/login/version.rb +1 -1
- 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: 854e6578d8f00a338d8a83eb3be76e3bdc8640e89e64a77aad1952af176f2678
|
4
|
+
data.tar.gz: 80f4f529115acada7bb63ab400262ec65bb5a704f1d4d926d80002f261beda83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6e14eda5004dc72b190246d65f578ef13af64acfa4a84800c4e2f90358d5345dfb786378361f3d542d98a6cb9fb2764f001793cb1ba21e0ce00aea5b78e4594
|
7
|
+
data.tar.gz: eaa995969c522a907507239a7436dfdd6adadbc81ed8fef07d9200b8ca76c2c45736eccc0137c94666cb32234fe437d33a8949b63d80cdd02f350c2bb20f3314
|
@@ -6,11 +6,10 @@ class Mumukit::Login::Mucookie
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def write!(key, value, options={})
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
same_site: self.class.cookie_same_site)
|
9
|
+
do_write! cookie_name(key),
|
10
|
+
spec.merge(
|
11
|
+
value: value.to_s,
|
12
|
+
httponly: !!options[:httponly])
|
14
13
|
end
|
15
14
|
|
16
15
|
def encrypt_and_write!(key, value, options={})
|
@@ -22,7 +21,7 @@ class Mumukit::Login::Mucookie
|
|
22
21
|
end
|
23
22
|
|
24
23
|
def read(key)
|
25
|
-
|
24
|
+
do_read!(cookie_name(key))
|
26
25
|
end
|
27
26
|
|
28
27
|
def decrypt_and_read(key)
|
@@ -34,7 +33,7 @@ class Mumukit::Login::Mucookie
|
|
34
33
|
end
|
35
34
|
|
36
35
|
def delete!(key)
|
37
|
-
|
36
|
+
do_delete! cookie_name(key), Mumukit::Login.config.mucookie_domain
|
38
37
|
end
|
39
38
|
|
40
39
|
def spec
|
@@ -55,6 +54,22 @@ class Mumukit::Login::Mucookie
|
|
55
54
|
|
56
55
|
private
|
57
56
|
|
57
|
+
# Support for legacy browsers
|
58
|
+
# Duplicate write / read / delete cookies without samesite for old browsers that do not allow for SameSite=None attribute
|
59
|
+
def do_write!(cookie_name, spec)
|
60
|
+
@controller.write_cookie! cookie_name, spec.merge(same_site: self.class.cookie_same_site)
|
61
|
+
@controller.write_cookie! "#{cookie_name}_legacy", spec
|
62
|
+
end
|
63
|
+
|
64
|
+
def do_delete!(cookie_name, domain)
|
65
|
+
@controller.delete_cookie! cookie_name, domain
|
66
|
+
@controller.delete_cookie! "#{cookie_name}_legacy", domain
|
67
|
+
end
|
68
|
+
|
69
|
+
def do_read!(cookie_name)
|
70
|
+
@controller.read_cookie(cookie_name) || @controller.read_cookie("#{cookie_name}_legacy")
|
71
|
+
end
|
72
|
+
|
58
73
|
def cookie_name(key)
|
59
74
|
"mucookie_#{key}"
|
60
75
|
end
|
@@ -95,5 +110,4 @@ class Mumukit::Login::Mucookie
|
|
95
110
|
value.try { |it| encryptor.decrypt_and_verify it }
|
96
111
|
end
|
97
112
|
end
|
98
|
-
|
99
113
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumukit-login
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|