coalescing_panda 4.1.12 → 4.1.13
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 +4 -4
- data/lib/coalescing_panda/controller_helpers.rb +12 -9
- data/lib/coalescing_panda/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a57e9fac9340339b324a52145f20eb73ba28c663
|
|
4
|
+
data.tar.gz: 4bf093296076e9e62f387f5055abca2e2798a7b1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9ca621611fdd63a2966a436295ead5cae020bc84491d2beef4df995b4c3891b00dfd2b9731dfc3ca4db4101cd50b6a314e728423a0e3bb2df7689b79c80ebbdf
|
|
7
|
+
data.tar.gz: 2ef1f4235da353d15c3e7917f64d5a7627df979099f4f39979167da8608d08d00f06bf2211b02872603307bf5e28d73a5353810529c0ca8ef7b6e0e662732158
|
|
@@ -7,13 +7,9 @@ module CoalescingPanda
|
|
|
7
7
|
if lti_authorize!(*roles)
|
|
8
8
|
user_id = params['user_id']
|
|
9
9
|
launch_presentation_return_url = @lti_account.settings[:launch_presentation_return_url] || params['launch_presentation_return_url']
|
|
10
|
+
launch_presentation_return_url = [BearcatUri.new(request.env["HTTP_REFERER"]).prefix, launch_presentation_return_url].join unless launch_presentation_return_url.include?('http')
|
|
10
11
|
uri = BearcatUri.new(launch_presentation_return_url)
|
|
11
|
-
|
|
12
|
-
session['user_id'] = user_id
|
|
13
|
-
session['uri'] = launch_presentation_return_url
|
|
14
|
-
session['lis_person_sourcedid'] = params['lis_person_sourcedid']
|
|
15
|
-
session['oauth_consumer_key'] = params['oauth_consumer_key']
|
|
16
|
-
session['custom_canvas_account_id'] = params['custom_canvas_account_id']
|
|
12
|
+
set_session(launch_presentation_return_url)
|
|
17
13
|
|
|
18
14
|
if token = CanvasApiAuth.where('user_id = ? and api_domain = ?', user_id, uri.api_domain).pluck(:api_token).first
|
|
19
15
|
@client = Bearcat::Client.new(token: token, prefix: uri.prefix)
|
|
@@ -25,6 +21,7 @@ module CoalescingPanda
|
|
|
25
21
|
@canvas_url = client.auth_redirect_url(client_id, redirect_url)
|
|
26
22
|
|
|
27
23
|
#delete the added params so the original oauth sig still works
|
|
24
|
+
@lti_params = params.to_hash
|
|
28
25
|
@lti_params.delete('action')
|
|
29
26
|
@lti_params.delete('controller')
|
|
30
27
|
render 'coalescing_panda/oauth2/oauth2', layout: 'coalescing_panda/application'
|
|
@@ -32,6 +29,14 @@ module CoalescingPanda
|
|
|
32
29
|
end
|
|
33
30
|
end
|
|
34
31
|
|
|
32
|
+
def set_session(launch_presentation_return_url)
|
|
33
|
+
session['user_id'] = params['user_id']
|
|
34
|
+
session['uri'] = launch_presentation_return_url
|
|
35
|
+
session['lis_person_sourcedid'] = params['lis_person_sourcedid']
|
|
36
|
+
session['oauth_consumer_key'] = params['oauth_consumer_key']
|
|
37
|
+
session['custom_canvas_account_id'] = params['custom_canvas_account_id']
|
|
38
|
+
end
|
|
39
|
+
|
|
35
40
|
def have_session?
|
|
36
41
|
if params['tool_consumer_instance_guid'] && session['user_id'] != params['user_id']
|
|
37
42
|
reset_session
|
|
@@ -61,9 +66,7 @@ module CoalescingPanda
|
|
|
61
66
|
logger.info 'not authorized on roles' if !authorized
|
|
62
67
|
authorized = authorized && @lti_account.validate_nonce(params['oauth_nonce'], DateTime.strptime(params['oauth_timestamp'], '%s'))
|
|
63
68
|
logger.info 'not authorized on nonce' if !authorized
|
|
64
|
-
|
|
65
|
-
render :text => 'Invalid Credentials, please contact your Administrator.', :status => :unauthorized
|
|
66
|
-
end
|
|
69
|
+
render :text => 'Invalid Credentials, please contact your Administrator.', :status => :unauthorized unless authorized
|
|
67
70
|
authorized
|
|
68
71
|
end
|
|
69
72
|
|
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: 4.1.
|
|
4
|
+
version: 4.1.13
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nathan Mills
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2015-06-
|
|
13
|
+
date: 2015-06-25 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rails
|