coalescing_panda 5.1.2 → 5.1.5

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
  SHA1:
3
- metadata.gz: db38b8cdb32e3f3d41eab15a3df4542cb9feeb9b
4
- data.tar.gz: 4cb1f0ec31e628852a3cfe2100b2ca31a91f94cd
3
+ metadata.gz: f317383eecefd1a67bcb72a09bd5630c1f3ecbbc
4
+ data.tar.gz: daa6e6ad5e3c7f93edb15ded3e974d23db9df7f4
5
5
  SHA512:
6
- metadata.gz: d05f38b6ab1f690c9b581c59da23814f6b2b505be56bf2ab057b3099dd15497d98de974ce9f43f779e6b59e863e825fb690d146121915da348484af391798518
7
- data.tar.gz: 3663adb9a48a839fed284a7132083335578074ce210b382cbac8e6cb4a0a98aa59d0033ad4cc6b8116205143b13a787d5ed56fa65ca7eef0f7e38b9ec23e551c
6
+ metadata.gz: 2a4e7e139bb2872b008da9486d5d828b4600793f8a28379720191a0f1d498af8b58ec0c5e6c0058fbe7910b6796fdc2c3c5a31f5c69f24cd9173a830fcd462a5
7
+ data.tar.gz: 555eb486c630dd9434da5c61ac86925cf3a05ad7567b50ef0b657f48010c1d0fb5b217715ff3ca8d9f53d5760539ea8a18a65e5fcb44dc14c5e9d0c06ec1e0fa
@@ -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,14 @@ 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
-
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]) > 15.minutes.ago
44
+ DateTime.parse(matched_session.data[:last_ip_token_requested]) > session_expiration_period_minutes.minutes.ago
45
+ @current_session = matched_session
46
+ elsif payload[:token_type] == 'expiring' && DateTime.parse(matched_session.data[:last_token_requested]) > session_expiration_period_minutes.minutes.ago
42
47
  @current_session = matched_session
43
48
  end
44
49
  end
@@ -111,6 +116,8 @@ module CoalescingPanda
111
116
  elsif type == 'fixed_ip'
112
117
  current_session_data[:remote_ip] ||= request.remote_ip
113
118
  current_session_data[:last_ip_token_requested] = DateTime.now.iso8601
119
+ elsif type == 'expiring'
120
+ current_session_data[:last_token_requested] = DateTime.now.iso8601
114
121
  else
115
122
  raise StandardError, "Unsupported link_nonce_type: '#{type}'"
116
123
  end
@@ -123,6 +130,10 @@ module CoalescingPanda
123
130
  self.class.link_nonce_type
124
131
  end
125
132
 
133
+ def session_expiration_period_minutes
134
+ self.session_expiration_period_minutes
135
+ end
136
+
126
137
  private
127
138
 
128
139
  def session_cryptor
@@ -1,3 +1,3 @@
1
1
  module CoalescingPanda
2
- VERSION = '5.1.2'
2
+ VERSION = '5.1.5'
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.5
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: