lti_core 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -0
- data/lib/lti_core/context.rb +19 -0
- data/lib/lti_core/custom.rb +10 -0
- data/lib/lti_core/launch_presentation.rb +19 -0
- data/lib/lti_core/lis.rb +16 -0
- data/lib/lti_core/lti_resource_link_request.rb +74 -0
- data/lib/lti_core/resource_link.rb +17 -0
- data/lib/lti_core/tool_platform.rb +25 -0
- data/lib/lti_core/version.rb +1 -1
- data/lib/lti_core.rb +1 -1
- metadata +38 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8c32487c6d1b1d79cf9ef5494f7ffec57d85e3890cf0c0705724510be7ec3a3
|
4
|
+
data.tar.gz: a9c416791a98a030f853dc18c747e19d2cbc63d349c8178a081679c405445e5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1479809a6e7e9afe3a8477040e0634f72f865daf98429688798936cff1c20777b8e2e0bf9bc46f31c5690a5191d541771894d16c01b47d85b3d42c1bcf81ae9
|
7
|
+
data.tar.gz: 8e852f8f16c242050d749cdb90a8b5abea448259d3f5b7452801311793e62e8254a1d87424805917eb2874a21166cea2af7815515b46fd8f4994afc28f6b1836
|
data/.rubocop.yml
CHANGED
@@ -9,6 +9,15 @@ AllCops:
|
|
9
9
|
Gemspec/DevelopmentDependencies:
|
10
10
|
Enabled: false
|
11
11
|
|
12
|
+
Metrics/BlockLength:
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
RSpec/MultipleMemoizedHelpers:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
Style/Documentation:
|
19
|
+
Enabled: false
|
20
|
+
|
12
21
|
Style/StringLiterals:
|
13
22
|
Enabled: true
|
14
23
|
EnforcedStyle: double_quotes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "shale"
|
4
|
+
|
5
|
+
module LtiCore
|
6
|
+
class Context < Shale::Mapper
|
7
|
+
attribute :id, Shale::Type::String
|
8
|
+
attribute :label, Shale::Type::String
|
9
|
+
attribute :title, Shale::Type::String
|
10
|
+
attribute :type, Shale::Type::String, collection: true
|
11
|
+
|
12
|
+
json do
|
13
|
+
map "id", to: :id, schema: { required: true }
|
14
|
+
map "label", to: :label
|
15
|
+
map "title", to: :title
|
16
|
+
map "type", to: :type
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "shale"
|
4
|
+
module LtiCore
|
5
|
+
class Custom < Shale::Mapper
|
6
|
+
# This class can have any attributes you want to extract from the custom field
|
7
|
+
# in the LTI launch request. The attributes should be defined as Shale::Type::String
|
8
|
+
# I need to write code to dynamically extract the custom attributes from the custom field
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "shale"
|
4
|
+
|
5
|
+
module LtiCore
|
6
|
+
class LaunchPresentation < Shale::Mapper
|
7
|
+
attribute :document_target, Shale::Type::String
|
8
|
+
attribute :height, Shale::Type::Integer
|
9
|
+
attribute :width, Shale::Type::Integer
|
10
|
+
attribute :return_url, Shale::Type::String
|
11
|
+
|
12
|
+
json do
|
13
|
+
map "document_target", to: :document_target
|
14
|
+
map "height", to: :height
|
15
|
+
map "width", to: :width
|
16
|
+
map "return_url", to: :return_url
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/lti_core/lis.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "shale"
|
4
|
+
module LtiCore
|
5
|
+
class Lis < Shale::Mapper
|
6
|
+
attribute :person_sourcedid, Shale::Type::String
|
7
|
+
attribute :course_offering_sourcedid, Shale::Type::String
|
8
|
+
attribute :course_section_sourcedid, Shale::Type::String
|
9
|
+
|
10
|
+
json do
|
11
|
+
map "person_sourcedid", to: :person_sourcedid
|
12
|
+
map "course_offering_sourcedid", to: :course_offering_sourcedid
|
13
|
+
map "course_section_sourcedid", to: :course_section_sourcedid
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "shale"
|
4
|
+
|
5
|
+
require_relative "context"
|
6
|
+
require_relative "custom"
|
7
|
+
require_relative "launch_presentation"
|
8
|
+
require_relative "lis"
|
9
|
+
require_relative "resource_link"
|
10
|
+
require_relative "tool_platform"
|
11
|
+
|
12
|
+
module LtiCore
|
13
|
+
class LtiResourceLinkRequest < Shale::Mapper
|
14
|
+
# The link request can also have vendor specific claims. They must have a key
|
15
|
+
# that is a fully resolved URL. The value can be any JSON value.
|
16
|
+
# I need to write code to dynamically extract the vendor specific claims
|
17
|
+
|
18
|
+
attribute :iss, Shale::Type::String
|
19
|
+
attribute :sub, Shale::Type::String
|
20
|
+
attribute :aud, Shale::Type::String, collection: true
|
21
|
+
attribute :exp, Shale::Type::Integer
|
22
|
+
attribute :iat, Shale::Type::Integer
|
23
|
+
attribute :azp, Shale::Type::String
|
24
|
+
attribute :nonce, Shale::Type::String
|
25
|
+
attribute :name, Shale::Type::String
|
26
|
+
attribute :given_name, Shale::Type::String
|
27
|
+
attribute :family_name, Shale::Type::String
|
28
|
+
attribute :middle_name, Shale::Type::String
|
29
|
+
attribute :picture, Shale::Type::String
|
30
|
+
attribute :email, Shale::Type::String
|
31
|
+
attribute :locale, Shale::Type::String
|
32
|
+
attribute :deployment_id, Shale::Type::String
|
33
|
+
attribute :message_type, Shale::Type::String
|
34
|
+
attribute :version, Shale::Type::String
|
35
|
+
attribute :roles, Shale::Type::String, collection: true
|
36
|
+
attribute :role_scope_mentor, Shale::Type::String, collection: true
|
37
|
+
attribute :context, LtiCore::Context
|
38
|
+
attribute :resource_link, LtiCore::ResourceLink
|
39
|
+
attribute :tool_platform, LtiCore::ToolPlatform
|
40
|
+
attribute :target_link_uri, Shale::Type::String
|
41
|
+
attribute :launch_presentation, LtiCore::LaunchPresentation
|
42
|
+
attribute :custom, LtiCore::Custom
|
43
|
+
attribute :lis, LtiCore::Lis
|
44
|
+
|
45
|
+
json do
|
46
|
+
map "iss", to: :iss
|
47
|
+
map "sub", to: :sub
|
48
|
+
map "aud", to: :aud
|
49
|
+
map "exp", to: :exp
|
50
|
+
map "iat", to: :iat
|
51
|
+
map "azp", to: :azp
|
52
|
+
map "nonce", to: :nonce
|
53
|
+
map "name", to: :name
|
54
|
+
map "given_name", to: :given_name
|
55
|
+
map "family_name", to: :family_name
|
56
|
+
map "middle_name", to: :middle_name
|
57
|
+
map "picture", to: :picture
|
58
|
+
map "email", to: :email
|
59
|
+
map "locale", to: :locale
|
60
|
+
map "https://purl.imsglobal.org/spec/lti/claim/deployment_id", to: :deployment_id, schema: { required: true }
|
61
|
+
map "https://purl.imsglobal.org/spec/lti/claim/message_type", to: :message_type, schema: { required: true }
|
62
|
+
map "https://purl.imsglobal.org/spec/lti/claim/version", to: :version, schema: { required: true }
|
63
|
+
map "https://purl.imsglobal.org/spec/lti/claim/roles", to: :roles, schema: { required: true }
|
64
|
+
map "https://purl.imsglobal.org/spec/lti/claim/role_scope_mentor", to: :role_scope_mentor
|
65
|
+
map "https://purl.imsglobal.org/spec/lti/claim/context", to: :context
|
66
|
+
map "https://purl.imsglobal.org/spec/lti/claim/resource_link", to: :resource_link, schema: { required: true }
|
67
|
+
map "https://purl.imsglobal.org/spec/lti/claim/tool_platform", to: :tool_platform
|
68
|
+
map "https://purl.imsglobal.org/spec/lti/claim/target_link_uri", to: :target_link_uri, schema: { required: true }
|
69
|
+
map "https://purl.imsglobal.org/spec/lti/claim/launch_presentation", to: :launch_presentation
|
70
|
+
map "https://purl.imsglobal.org/spec/lti/claim/custom", to: :custom
|
71
|
+
map "https://purl.imsglobal.org/spec/lti/claim/lis", to: :lis
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "shale"
|
4
|
+
|
5
|
+
module LtiCore
|
6
|
+
class ResourceLink < Shale::Mapper
|
7
|
+
attribute :id, Shale::Type::String
|
8
|
+
attribute :description, Shale::Type::String
|
9
|
+
attribute :title, Shale::Type::String
|
10
|
+
|
11
|
+
json do
|
12
|
+
map "id", to: :id, schema: { required: true }
|
13
|
+
map "description", to: :description
|
14
|
+
map "title", to: :title
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "shale"
|
4
|
+
|
5
|
+
module LtiCore
|
6
|
+
class ToolPlatform < Shale::Mapper
|
7
|
+
attribute :guid, Shale::Type::String
|
8
|
+
attribute :contact_email, Shale::Type::String
|
9
|
+
attribute :description, Shale::Type::String
|
10
|
+
attribute :name, Shale::Type::String
|
11
|
+
attribute :url, Shale::Type::String
|
12
|
+
attribute :product_family_code, Shale::Type::String
|
13
|
+
attribute :version, Shale::Type::String
|
14
|
+
|
15
|
+
json do
|
16
|
+
map "guid", to: :guid, schema: { required: true }
|
17
|
+
map "contact_email", to: :contact_email
|
18
|
+
map "description", to: :description
|
19
|
+
map "name", to: :name
|
20
|
+
map "url", to: :url
|
21
|
+
map "product_family_code", to: :product_family_code
|
22
|
+
map "version", to: :version
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/lti_core/version.rb
CHANGED
data/lib/lti_core.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lti_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron F Stanton
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: shale
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundle-audit
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +80,20 @@ dependencies:
|
|
66
80
|
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry-byebug
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: rake
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -193,6 +221,13 @@ files:
|
|
193
221
|
- README.md
|
194
222
|
- Rakefile
|
195
223
|
- lib/lti_core.rb
|
224
|
+
- lib/lti_core/context.rb
|
225
|
+
- lib/lti_core/custom.rb
|
226
|
+
- lib/lti_core/launch_presentation.rb
|
227
|
+
- lib/lti_core/lis.rb
|
228
|
+
- lib/lti_core/lti_resource_link_request.rb
|
229
|
+
- lib/lti_core/resource_link.rb
|
230
|
+
- lib/lti_core/tool_platform.rb
|
196
231
|
- lib/lti_core/version.rb
|
197
232
|
- sig/lti_core.rbs
|
198
233
|
homepage: https://github.com/afstanton/lti_core
|
@@ -218,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
253
|
- !ruby/object:Gem::Version
|
219
254
|
version: '0'
|
220
255
|
requirements: []
|
221
|
-
rubygems_version: 3.5.
|
256
|
+
rubygems_version: 3.5.7
|
222
257
|
signing_key:
|
223
258
|
specification_version: 4
|
224
259
|
summary: Implmentation of the LTI Core standard for Ruby.
|