coalescing_panda 5.1.2 → 5.1.3

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: db38b8cdb32e3f3d41eab15a3df4542cb9feeb9b
4
- data.tar.gz: 4cb1f0ec31e628852a3cfe2100b2ca31a91f94cd
3
+ metadata.gz: d0d95162b1397f3f63cefeea2307d14bdb446771
4
+ data.tar.gz: 3c81934197e230702d93700cb4c4706cbcbf78fa
5
5
  SHA512:
6
- metadata.gz: d05f38b6ab1f690c9b581c59da23814f6b2b505be56bf2ab057b3099dd15497d98de974ce9f43f779e6b59e863e825fb690d146121915da348484af391798518
7
- data.tar.gz: 3663adb9a48a839fed284a7132083335578074ce210b382cbac8e6cb4a0a98aa59d0033ad4cc6b8116205143b13a787d5ed56fa65ca7eef0f7e38b9ec23e551c
6
+ metadata.gz: c9321fcd178dd6df1990e91b17676ca9e6d2762e8fe0aa6b27e00b26a7951470518eb1e4f847a9e4b73757ee264968a8a5f2ed55f2f7f6d33f8919269e0e4294
7
+ data.tar.gz: 0f96f9df3de844abc278f249ef0ec239537109762815b91b4c0dcdda72481116580b42e7b142b8e790959acb2e7b6add2642411071b1d29353ec8994a40658db
@@ -32,13 +32,15 @@ module CoalescingPanda
32
32
  if params[:session_token]
33
33
  payload = JSON.parse(session_cryptor.decrypt_and_verify(params[:session_token])).with_indifferent_access
34
34
  matched_session = find_or_create_session(key: payload[:session_key])
35
-
35
+ session_expiration_period_minutes = superclass.try(:session_expiration_period_minutes) || 15
36
36
  if matched_session.present?
37
37
  if payload[:token_type] == 'nonce' && matched_session.data[:link_nonce] == payload[:nonce]
38
38
  @current_session = matched_session
39
39
  @current_session.data[:link_nonce] = nil
40
40
  elsif payload[:token_type] == 'fixed_ip' && matched_session.data[:remote_ip] == request.remote_ip &&
41
- DateTime.parse(matched_session.data[:last_ip_token_requested]) > 15.minutes.ago
41
+ DateTime.parse(matched_session.data[:last_ip_token_requested]) > session_expiration_period_minutes.minutes.ago
42
+ @current_session = matched_session
43
+ elsif payload[:token_type] == 'expiring' && DateTime.parse(matched_session.data[:last_token_requested]) > session_expiration_period_minutes.minutes.ago
42
44
  @current_session = matched_session
43
45
  end
44
46
  end
@@ -111,6 +113,8 @@ module CoalescingPanda
111
113
  elsif type == 'fixed_ip'
112
114
  current_session_data[:remote_ip] ||= request.remote_ip
113
115
  current_session_data[:last_ip_token_requested] = DateTime.now.iso8601
116
+ elsif type == 'expiring'
117
+ current_session_data[:last_token_requested] = DateTime.now.iso8601
114
118
  else
115
119
  raise StandardError, "Unsupported link_nonce_type: '#{type}'"
116
120
  end
@@ -1,3 +1,3 @@
1
1
  module CoalescingPanda
2
- VERSION = '5.1.2'
2
+ VERSION = '5.1.3'
3
3
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coalescing_panda
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.2
4
+ version: 5.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Mills
8
8
  - Cody Tanner
9
9
  - Jake Sorce
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-09-16 00:00:00.000000000 Z
13
+ date: 2020-10-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -396,7 +396,7 @@ dependencies:
396
396
  - - ">="
397
397
  - !ruby/object:Gem::Version
398
398
  version: '0'
399
- description:
399
+ description:
400
400
  email:
401
401
  - nathanm@instructure.com
402
402
  - ctanner@instructure.com
@@ -563,7 +563,7 @@ files:
563
563
  homepage: http://www.instructure.com
564
564
  licenses: []
565
565
  metadata: {}
566
- post_install_message:
566
+ post_install_message:
567
567
  rdoc_options: []
568
568
  require_paths:
569
569
  - lib
@@ -578,9 +578,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
578
578
  - !ruby/object:Gem::Version
579
579
  version: '0'
580
580
  requirements: []
581
- rubyforge_project:
581
+ rubyforge_project:
582
582
  rubygems_version: 2.6.14.4
583
- signing_key:
583
+ signing_key:
584
584
  specification_version: 4
585
585
  summary: Canvas LTI and OAUTH2 mountable engine
586
586
  test_files: