qalam_lti_provider_engine 2.0.6 → 2.0.7
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/app/controllers/lti_provider/lti_controller.rb +29 -9
- data/lib/lti_provider/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c44302d262a552ee530b6f28ee83e7477d2246ed17ef96ab947dd05f9ab8feab
|
4
|
+
data.tar.gz: 44f56ac3fd92498e8d879d144c9cb46b427cf4f34da6b3af45a9d638669cd00d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d11a370ea40641bedfe3b509266b60f8147179e0ef82105d80b44eab4d6f6af877e20e928052614f0b65bafae8a909bd51ed371f08238991eff89859982a32f3
|
7
|
+
data.tar.gz: 5d10c95c500fb6198b99415a82163311272e19ced22b9e63db612d0f9b80fa34bf65eb6363cff0326cecdd35573199683f3a5e04f05c4283a2579d9da7ab7250
|
@@ -4,11 +4,15 @@ require 'colorize'
|
|
4
4
|
module LtiProvider
|
5
5
|
class LtiController < LtiProvider::LtiApplicationController
|
6
6
|
skip_before_action :require_lti_launch
|
7
|
+
# skip_before_action :verify_authenticity_token, only: :launch
|
7
8
|
|
8
9
|
def launch
|
9
10
|
provider = IMS::LTI::ToolProvider.new(params['oauth_consumer_key'], LtiProvider::Config.secret, params)
|
10
11
|
launch = Launch.initialize_from_request(provider, request)
|
11
12
|
|
13
|
+
puts launch.inspect.red
|
14
|
+
puts request.origin.inspect.green
|
15
|
+
puts request.base_url.inspect.yellow
|
12
16
|
if !launch.valid_provider?
|
13
17
|
msg = "#{launch.lti_errormsg} Please be sure you are launching this tool from the link provided in Qalam."
|
14
18
|
return show_error msg
|
@@ -23,26 +27,34 @@ module LtiProvider
|
|
23
27
|
end
|
24
28
|
### END ###
|
25
29
|
else
|
26
|
-
|
30
|
+
if params[:launch_tool] && params[:launch_tool] == 'digital_library'
|
31
|
+
redirect_to main_app.root_path and return
|
32
|
+
else
|
33
|
+
return show_error "Unable to launch #{LtiProvider::XmlConfig.tool_title}. Please check your External Tools configuration and try again."
|
34
|
+
end
|
27
35
|
end
|
28
36
|
end
|
29
37
|
|
30
38
|
def cookie_test
|
39
|
+
@launch = Launch.where("created_at > ?", 5.minutes.ago).find_by_nonce(params[:nonce])
|
40
|
+
|
31
41
|
if session[:cookie_test]
|
32
42
|
# success!!! we've got a session!
|
33
43
|
consume_launch
|
34
44
|
else
|
35
|
-
|
45
|
+
if @launch.launch_tool && @launch.launch_tool == 'digital_library'
|
46
|
+
redirect_to main_app.root_path and return
|
47
|
+
else
|
48
|
+
render and return
|
49
|
+
end
|
36
50
|
end
|
37
51
|
end
|
38
52
|
|
39
53
|
def consume_launch
|
40
|
-
launch
|
41
|
-
|
42
|
-
if launch
|
54
|
+
if @launch
|
43
55
|
[:account_id, :course_name, :course_id, :canvas_url, :tool_consumer_instance_guid,
|
44
56
|
:user_id, :user_name, :user_roles, :user_avatar_url, :launch_tool].each do |attribute|
|
45
|
-
session[attribute] = launch.public_send(attribute)
|
57
|
+
session[attribute] = @launch.public_send(attribute)
|
46
58
|
end
|
47
59
|
|
48
60
|
### QALAM ###
|
@@ -52,11 +64,19 @@ module LtiProvider
|
|
52
64
|
end
|
53
65
|
### END ###
|
54
66
|
|
55
|
-
launch.destroy
|
67
|
+
@launch.destroy
|
56
68
|
|
57
|
-
|
69
|
+
if @launch.launch_tool && @launch.launch_tool == 'digital_library'
|
70
|
+
redirect_to main_app.root_path and return
|
71
|
+
else
|
72
|
+
redirect_to main_app.root_path and return
|
73
|
+
end
|
58
74
|
else
|
59
|
-
|
75
|
+
if @launch.launch_tool && @launch.launch_tool == 'digital_library'
|
76
|
+
redirect_to main_app.root_path and return
|
77
|
+
else
|
78
|
+
return show_error "The tool was not launched successfully. Please try again."
|
79
|
+
end
|
60
80
|
end
|
61
81
|
end
|
62
82
|
|
data/lib/lti_provider/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qalam_lti_provider_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Donahue
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-08-
|
14
|
+
date: 2021-08-08 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -312,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
312
312
|
- !ruby/object:Gem::Version
|
313
313
|
version: '0'
|
314
314
|
requirements: []
|
315
|
-
rubygems_version: 3.2.
|
315
|
+
rubygems_version: 3.2.22
|
316
316
|
signing_key:
|
317
317
|
specification_version: 4
|
318
318
|
summary: LtiProvider is a mountable engine for handling the LTI launch and exposing
|