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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f422707e8eea054a21834b6eabb5dbd3b05a3377fdb9b92b535930c57c481c0a
4
- data.tar.gz: ccddd35d16e208dc05480aef339f873b7efc62896c517592735d1a999da1516d
3
+ metadata.gz: 854e6578d8f00a338d8a83eb3be76e3bdc8640e89e64a77aad1952af176f2678
4
+ data.tar.gz: 80f4f529115acada7bb63ab400262ec65bb5a704f1d4d926d80002f261beda83
5
5
  SHA512:
6
- metadata.gz: b3a1f0475077b97e231aea878ff9ac6458169dcb2655e12c5833534d5147fe3961ae7832d60f7bef30e65c6005914699426efc437d11c85bcd837abdd0eb110c
7
- data.tar.gz: dba412a31851abbeea17ff776be7b921d8a0b4c08c9f10f23b4aaf8cc7ade9715d61bdb84aa9b8e581e833d0f74752611daaaaa3fad66a3703de617f71ed605e
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
- @controller.write_cookie! cookie_name(key),
10
- spec.merge(
11
- value: value.to_s,
12
- httponly: !!options[:httponly],
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
- @controller.read_cookie cookie_name(key)
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
- @controller.delete_cookie! cookie_name(key), Mumukit::Login.config.mucookie_domain
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
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Login
3
- VERSION = '7.1.1'
3
+ VERSION = '7.2.0'
4
4
  end
5
5
  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.1.1
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-03-17 00:00:00.000000000 Z
11
+ date: 2020-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler