ims-lti 1.1.13 → 1.2.1
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/Changelog +3 -0
- data/README.md +1 -1
- data/lib/ims/lti/deprecated_role_checks.rb +1 -1
- data/lib/ims/lti/launch_params.rb +1 -1
- data/lib/ims/lti/outcome_response.rb +7 -3
- data/lib/ims/lti/role_checks.rb +2 -2
- data/lib/ims/lti.rb +6 -2
- metadata +5 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bae74c449b90078e101b9b2d15eb641f961f26e6
|
|
4
|
+
data.tar.gz: a72392b97c222c839346f69fc484ebb8941e633f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2e4914ab5dfb6eda81e268585246bb28b2b22e3a64700243dec593fce577260a303e0381645dbf345c6e062e6ea0eb4617cfbfbe2dd22f6773587134bef56604
|
|
7
|
+
data.tar.gz: d60ceb79b2fc41ad121afabd28b88d013ef033a1f8b25dd1c7c6f4068ee91b7f999ca670adcb237ab0d1ccb2a7742454255ff59c8d994354d61b7c8638659e93
|
data/Changelog
CHANGED
data/README.md
CHANGED
|
@@ -52,7 +52,7 @@ and it will be signed with OAuth using a key/secret that both the TP and TC shar
|
|
|
52
52
|
This is covered in the [LTI security model](http://www.imsglobal.org/LTI/v1p1/ltiIMGv1p1.html#_Toc319560466)
|
|
53
53
|
|
|
54
54
|
Here is an example of a simple TP Sinatra app using this gem:
|
|
55
|
-
[LTI Tool Provider](https://github.com/instructure/
|
|
55
|
+
[LTI Tool Provider](https://github.com/instructure/lti1_tool_provider_example)
|
|
56
56
|
|
|
57
57
|
Once you find the `oauth_consumer_secret` based on the `oauth_consumer_key` in
|
|
58
58
|
the request, you can initialize a `ToolProvider` object with them and the post parameters:
|
|
@@ -6,7 +6,7 @@ module DeprecatedRoleChecks
|
|
|
6
6
|
# Check whether the Launch Parameters have a role
|
|
7
7
|
def has_role?(role)
|
|
8
8
|
role = role.downcase
|
|
9
|
-
@roles && @roles.any?{|r| r.index(role)}
|
|
9
|
+
@roles && @roles.any?{|r| r.downcase.index(role)}
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
# Convenience method for checking if the user has 'learner' or 'student' role
|
|
@@ -46,7 +46,7 @@ module IMS::LTI
|
|
|
46
46
|
#
|
|
47
47
|
class OutcomeResponse
|
|
48
48
|
include IMS::LTI::Extensions::Base
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
attr_accessor :request_type, :score, :message_identifier, :response_code,
|
|
51
51
|
:post_response, :code_major, :severity, :description, :operation,
|
|
52
52
|
:message_ref_identifier
|
|
@@ -70,7 +70,7 @@ module IMS::LTI
|
|
|
70
70
|
response = OutcomeResponse.new
|
|
71
71
|
response.process_post_response(post_response)
|
|
72
72
|
end
|
|
73
|
-
|
|
73
|
+
|
|
74
74
|
def process_post_response(post_response)
|
|
75
75
|
self.post_response = post_response
|
|
76
76
|
self.response_code = post_response.code
|
|
@@ -105,7 +105,11 @@ module IMS::LTI
|
|
|
105
105
|
|
|
106
106
|
# Parse Outcome Response data from XML
|
|
107
107
|
def process_xml(xml)
|
|
108
|
-
|
|
108
|
+
begin
|
|
109
|
+
doc = REXML::Document.new xml
|
|
110
|
+
rescue => e
|
|
111
|
+
raise IMS::LTI::XMLParseError, "#{e}\nOriginal xml: '#{xml}'"
|
|
112
|
+
end
|
|
109
113
|
@message_identifier = doc.text("//imsx_statusInfo/imsx_messageIdentifier").to_s
|
|
110
114
|
@code_major = doc.text("//imsx_statusInfo/imsx_codeMajor")
|
|
111
115
|
@code_major.downcase! if @code_major
|
data/lib/ims/lti/role_checks.rb
CHANGED
|
@@ -16,7 +16,7 @@ module IMS::LTI
|
|
|
16
16
|
# Check whether the Launch Parameters have a given role
|
|
17
17
|
def has_exact_role?(role)
|
|
18
18
|
role = role.downcase
|
|
19
|
-
@roles && @roles.any? { |r| r == role }
|
|
19
|
+
@roles && @roles.any? { |r| r.downcase == role }
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# Check whether the Launch Parameters have a given role ignoring
|
|
@@ -25,7 +25,7 @@ module IMS::LTI
|
|
|
25
25
|
# will return true if the role is `urn:lti:role:ims/lis/Instructor/GuestInstructor`
|
|
26
26
|
def has_base_role?(role)
|
|
27
27
|
role = role.downcase
|
|
28
|
-
@roles && @roles.any? { |r| r.start_with?(role) }
|
|
28
|
+
@roles && @roles.any? { |r| r.downcase.start_with?(role) }
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
# Convenience method for checking if the user is the system administrator of the TC
|
data/lib/ims/lti.rb
CHANGED
|
@@ -2,6 +2,7 @@ require 'oauth'
|
|
|
2
2
|
require 'builder'
|
|
3
3
|
require "rexml/document"
|
|
4
4
|
require 'cgi'
|
|
5
|
+
require 'securerandom'
|
|
5
6
|
|
|
6
7
|
module IMS # :nodoc:
|
|
7
8
|
|
|
@@ -25,13 +26,16 @@ module IMS # :nodoc:
|
|
|
25
26
|
#
|
|
26
27
|
# require 'ims/lti'
|
|
27
28
|
module LTI
|
|
28
|
-
|
|
29
|
+
|
|
29
30
|
# The versions of LTI this library supports
|
|
30
31
|
VERSIONS = %w{1.0 1.1}
|
|
31
|
-
|
|
32
|
+
|
|
32
33
|
class InvalidLTIConfigError < StandardError
|
|
33
34
|
end
|
|
34
35
|
|
|
36
|
+
class XMLParseError < StandardError
|
|
37
|
+
end
|
|
38
|
+
|
|
35
39
|
# POST a signed oauth request with the given key/secret/data
|
|
36
40
|
def self.post_service_request(key, secret, url, content_type, body)
|
|
37
41
|
raise IMS::LTI::InvalidLTIConfigError, "" unless key && secret
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ims-lti
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Instructure
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-04-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: builder
|
|
@@ -28,22 +28,16 @@ dependencies:
|
|
|
28
28
|
name: oauth
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - '='
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: 0.4.5
|
|
34
|
-
- - "<"
|
|
35
|
-
- !ruby/object:Gem::Version
|
|
36
|
-
version: '0.6'
|
|
37
34
|
type: :runtime
|
|
38
35
|
prerelease: false
|
|
39
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
40
37
|
requirements:
|
|
41
|
-
- -
|
|
38
|
+
- - '='
|
|
42
39
|
- !ruby/object:Gem::Version
|
|
43
40
|
version: 0.4.5
|
|
44
|
-
- - "<"
|
|
45
|
-
- !ruby/object:Gem::Version
|
|
46
|
-
version: '0.6'
|
|
47
41
|
- !ruby/object:Gem::Dependency
|
|
48
42
|
name: rspec
|
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -104,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
104
98
|
version: '0'
|
|
105
99
|
requirements: []
|
|
106
100
|
rubyforge_project:
|
|
107
|
-
rubygems_version: 2.
|
|
101
|
+
rubygems_version: 2.6.11
|
|
108
102
|
signing_key:
|
|
109
103
|
specification_version: 4
|
|
110
104
|
summary: Ruby library for creating IMS LTI tool providers and consumers
|