coalescing_panda 5.1.3 → 5.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/coalescing_panda/session_replacement.rb +9 -2
- data/lib/coalescing_panda/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcdc3ee528ad33450c36b9bacd2935ddc508b021
|
4
|
+
data.tar.gz: faa4fe4cdba14da7d260ceff84fe45fbd26dbdd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a0a02279da82108e5c7ed472932e6e59948b0d64845c35ef7bfa02dd85b0efc33288c24aa02cf3b952f9915c2f9801c1fef833e9a9e72fe62739e19b72b6756
|
7
|
+
data.tar.gz: d48d2df6835e58324d4b750cb34c46000a3739faba5e465845ee935b354e183d2a0e0c2922cde1f705dc9b481e6c9fbbb7954e87db10f5994852b834d266f872
|
@@ -20,6 +20,10 @@ module CoalescingPanda
|
|
20
20
|
@link_nonce_type = value
|
21
21
|
end
|
22
22
|
end
|
23
|
+
|
24
|
+
def session_expiration_period_minutes
|
25
|
+
superclass.try(:session_expiration_period_minutes) || 15
|
26
|
+
end
|
23
27
|
end
|
24
28
|
|
25
29
|
def save_session
|
@@ -32,13 +36,12 @@ module CoalescingPanda
|
|
32
36
|
if params[:session_token]
|
33
37
|
payload = JSON.parse(session_cryptor.decrypt_and_verify(params[:session_token])).with_indifferent_access
|
34
38
|
matched_session = find_or_create_session(key: payload[:session_key])
|
35
|
-
session_expiration_period_minutes = superclass.try(:session_expiration_period_minutes) || 15
|
36
39
|
if matched_session.present?
|
37
40
|
if payload[:token_type] == 'nonce' && matched_session.data[:link_nonce] == payload[:nonce]
|
38
41
|
@current_session = matched_session
|
39
42
|
@current_session.data[:link_nonce] = nil
|
40
43
|
elsif payload[:token_type] == 'fixed_ip' && matched_session.data[:remote_ip] == request.remote_ip &&
|
41
|
-
DateTime.parse(matched_session.data[:last_ip_token_requested]) >
|
44
|
+
DateTime.parse(matched_session.data[:last_ip_token_requested]) > 15.minutes.ago
|
42
45
|
@current_session = matched_session
|
43
46
|
elsif payload[:token_type] == 'expiring' && DateTime.parse(matched_session.data[:last_token_requested]) > session_expiration_period_minutes.minutes.ago
|
44
47
|
@current_session = matched_session
|
@@ -127,6 +130,10 @@ module CoalescingPanda
|
|
127
130
|
self.class.link_nonce_type
|
128
131
|
end
|
129
132
|
|
133
|
+
def session_expiration_period_minutes
|
134
|
+
self.session_expiration_period_minutes
|
135
|
+
end
|
136
|
+
|
130
137
|
private
|
131
138
|
|
132
139
|
def session_cryptor
|