coalescing_panda 5.1.3 → 5.1.4

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
  SHA1:
3
- metadata.gz: d0d95162b1397f3f63cefeea2307d14bdb446771
4
- data.tar.gz: 3c81934197e230702d93700cb4c4706cbcbf78fa
3
+ metadata.gz: bcdc3ee528ad33450c36b9bacd2935ddc508b021
4
+ data.tar.gz: faa4fe4cdba14da7d260ceff84fe45fbd26dbdd2
5
5
  SHA512:
6
- metadata.gz: c9321fcd178dd6df1990e91b17676ca9e6d2762e8fe0aa6b27e00b26a7951470518eb1e4f847a9e4b73757ee264968a8a5f2ed55f2f7f6d33f8919269e0e4294
7
- data.tar.gz: 0f96f9df3de844abc278f249ef0ec239537109762815b91b4c0dcdda72481116580b42e7b142b8e790959acb2e7b6add2642411071b1d29353ec8994a40658db
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]) > session_expiration_period_minutes.minutes.ago
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
@@ -1,3 +1,3 @@
1
1
  module CoalescingPanda
2
- VERSION = '5.1.3'
2
+ VERSION = '5.1.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coalescing_panda
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.3
4
+ version: 5.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Mills