coalescing_panda 5.1.2 → 5.1.3.beta.1

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: 10a09324435306113beac47c8dd609b16e4ebebc
4
+ data.tar.gz: 02ac6211e0eee50fe9447d0f2bd38df991c1fe90
5
5
  SHA512:
6
- metadata.gz: d05f38b6ab1f690c9b581c59da23814f6b2b505be56bf2ab057b3099dd15497d98de974ce9f43f779e6b59e863e825fb690d146121915da348484af391798518
7
- data.tar.gz: 3663adb9a48a839fed284a7132083335578074ce210b382cbac8e6cb4a0a98aa59d0033ad4cc6b8116205143b13a787d5ed56fa65ca7eef0f7e38b9ec23e551c
6
+ metadata.gz: 206827a41c33c311d4b38a8bf4c1ce6d44bd85b79b4565e46fa7163c491ab93fe395e2fd0b5f23edf55c0d92a3f039980594ee6ee6faae14a640530d783dbca8
7
+ data.tar.gz: c4c6edff8dcebfd76f7af24efa6478b39b58fe8c67f73db6481fb97a2bc9fe70d2e03dbb52586c85e2e4eacbfdebb19d6d4182f89611cea5ddb36cd92ef2f237
@@ -32,13 +32,19 @@ 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 = CoalescingPanda.lti_options[:session_expiration_period_minutes] || 15
36
+ session_expiration_period_minutes = session_expiration_period_minutes.to_i
37
+ puts "XXXXX"
38
+ puts session_expiration_period_minutes
39
+ puts session_expiration_period_minutes.minutes.ago
36
40
  if matched_session.present?
37
41
  if payload[:token_type] == 'nonce' && matched_session.data[:link_nonce] == payload[:nonce]
38
42
  @current_session = matched_session
39
43
  @current_session.data[:link_nonce] = nil
40
44
  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
45
+ DateTime.parse(matched_session.data[:last_ip_token_requested]) > session_expiration_period_minutes.minutes.ago
46
+ @current_session = matched_session
47
+ elsif payload[:token_type] == 'expiring' && DateTime.parse(matched_session.data[:last_token_requested]) > session_expiration_period_minutes.minutes.ago
42
48
  @current_session = matched_session
43
49
  end
44
50
  end
@@ -111,6 +117,8 @@ module CoalescingPanda
111
117
  elsif type == 'fixed_ip'
112
118
  current_session_data[:remote_ip] ||= request.remote_ip
113
119
  current_session_data[:last_ip_token_requested] = DateTime.now.iso8601
120
+ elsif type == 'expiring'
121
+ current_session_data[:last_token_requested] = DateTime.now.iso8601
114
122
  else
115
123
  raise StandardError, "Unsupported link_nonce_type: '#{type}'"
116
124
  end
@@ -1,3 +1,3 @@
1
1
  module CoalescingPanda
2
- VERSION = '5.1.2'
2
+ VERSION = '5.1.3.beta.1'
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.beta.1
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
@@ -574,13 +574,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
574
574
  version: '0'
575
575
  required_rubygems_version: !ruby/object:Gem::Requirement
576
576
  requirements:
577
- - - ">="
577
+ - - ">"
578
578
  - !ruby/object:Gem::Version
579
- version: '0'
579
+ version: 1.3.1
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: