authlogic 6.3.0 → 6.4.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa943f509bfe67c9cd576f8201f0fce5f0dd8c417458a629185590257a34f0af
|
4
|
+
data.tar.gz: 01bb91b140d913dc7c75c1c78d70b70ae23ea3254c01c8165a2c29e785a00a9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efb0ecbdb2a535817297ccbb3d687b25387353a02aaa7ee5d0d05a1cc629adc5e52d81edb7a166ef74f071cf9e584bd4a3f994690f4a82e60c7f54fc9a1df880
|
7
|
+
data.tar.gz: 85de14bc97e1e3eecb6f77b346d7953e1f64504c9e91373167555dbb9e352b59cc61a85933135d6b358b049a0b482268f630e9ea6aed1fb341554dd6b7ab6feb
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module Authlogic
|
4
4
|
module TestCase
|
5
5
|
# A mock of `ActionDispatch::Cookies::CookieJar`.
|
6
|
+
# See action_dispatch/middleware/cookies.rb
|
6
7
|
class MockCookieJar < Hash # :nodoc:
|
7
8
|
attr_accessor :set_cookies
|
8
9
|
|
@@ -11,9 +12,12 @@ module Authlogic
|
|
11
12
|
hash && hash[:value]
|
12
13
|
end
|
13
14
|
|
15
|
+
# @param options - "the cookie's value [usually a string] or a hash of
|
16
|
+
# options as documented above [in action_dispatch/middleware/cookies.rb]"
|
14
17
|
def []=(key, options)
|
15
|
-
|
16
|
-
|
18
|
+
opt = cookie_options_to_hash(options)
|
19
|
+
(@set_cookies ||= {})[key.to_s] = opt
|
20
|
+
super(key, opt)
|
17
21
|
end
|
18
22
|
|
19
23
|
def delete(key, _options = {})
|
@@ -27,6 +31,17 @@ module Authlogic
|
|
27
31
|
def encrypted
|
28
32
|
@encrypted ||= MockEncryptedCookieJar.new(self)
|
29
33
|
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
# @api private
|
38
|
+
def cookie_options_to_hash(options)
|
39
|
+
if options.is_a?(Hash)
|
40
|
+
options
|
41
|
+
else
|
42
|
+
{ value: options }
|
43
|
+
end
|
44
|
+
end
|
30
45
|
end
|
31
46
|
|
32
47
|
# A mock of `ActionDispatch::Cookies::SignedKeyRotatingCookieJar`
|
@@ -52,8 +67,9 @@ module Authlogic
|
|
52
67
|
end
|
53
68
|
|
54
69
|
def []=(key, options)
|
55
|
-
|
56
|
-
|
70
|
+
opt = cookie_options_to_hash(options)
|
71
|
+
opt[:value] = "#{opt[:value]}--#{Digest::SHA1.hexdigest opt[:value]}"
|
72
|
+
@parent_jar[key] = opt
|
57
73
|
end
|
58
74
|
end
|
59
75
|
|
@@ -75,8 +91,9 @@ module Authlogic
|
|
75
91
|
end
|
76
92
|
|
77
93
|
def []=(key, options)
|
78
|
-
|
79
|
-
|
94
|
+
opt = cookie_options_to_hash(options)
|
95
|
+
opt[:value] = self.class.encrypt(opt[:value])
|
96
|
+
@parent_jar[key] = opt
|
80
97
|
end
|
81
98
|
|
82
99
|
# simple caesar cipher for testing
|
@@ -12,7 +12,7 @@ module Authlogic
|
|
12
12
|
def cookies
|
13
13
|
new_cookies = MockCookieJar.new
|
14
14
|
super.each do |key, value|
|
15
|
-
new_cookies[key] = value
|
15
|
+
new_cookies[key] = cookie_value(value)
|
16
16
|
end
|
17
17
|
new_cookies
|
18
18
|
end
|
@@ -28,6 +28,12 @@ module Authlogic
|
|
28
28
|
def request_content_type
|
29
29
|
request.format.to_s
|
30
30
|
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def cookie_value(value)
|
35
|
+
value.is_a?(Hash) ? value[:value] : value
|
36
|
+
end
|
31
37
|
end
|
32
38
|
end
|
33
39
|
end
|
data/lib/authlogic/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authlogic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Johnson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-12-
|
13
|
+
date: 2020-12-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activemodel
|
@@ -170,6 +170,20 @@ dependencies:
|
|
170
170
|
- - "~>"
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: 1.1.4
|
173
|
+
- !ruby/object:Gem::Dependency
|
174
|
+
name: rake
|
175
|
+
requirement: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - "~>"
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '13.0'
|
180
|
+
type: :development
|
181
|
+
prerelease: false
|
182
|
+
version_requirements: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - "~>"
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '13.0'
|
173
187
|
- !ruby/object:Gem::Dependency
|
174
188
|
name: rubocop
|
175
189
|
requirement: !ruby/object:Gem::Requirement
|