lti_core 0.0.4 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d7b5e0bfe0abe041af70b805722445bd4a2b6696dd273cd8f5d056e46ac8217
4
- data.tar.gz: 41e0272f8627bf63e600e34081c5150f785af31e08b72b4a0cd6bb714af70841
3
+ metadata.gz: fb26452e3534969b461e4fe328535e0bfb4cc52b2e87732b5b029811714a451c
4
+ data.tar.gz: 54ab80b33778e77fd6896706be90d0850aabfb79cd73647a55905fb7ce4e3e6c
5
5
  SHA512:
6
- metadata.gz: f6f176376a1a3855a843206b9ff8c3d4e4362894e4ca8afa8e6b12b900555c04efdfa7e80700808580eafd3dc12f539573cd504c0411a2ed34e488d6dcf35de2
7
- data.tar.gz: 13b753467b51927f412089f685e76374390fc17dd0de399759cea3b064539e5894d493293dd96f04c97efac6abc6d25700e21ff495dfb9c9e2e2a5976dc1c340
6
+ metadata.gz: b213acaed305a03517b1c623d4306512b897fef2870b7faa26927128645fdb219ce2f7ab69e7746b59694c6210ab88b8e3b8bf88a672536c5f9879cdd1778d85
7
+ data.tar.gz: 4512a863dc517abea0c769f2da3e58a781e20a473c2f0f470ecac27c3221098ec3e61689b7278bcff05293e1cf3e9a472ce1ccd89910e6b09aebd742360a49fb
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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LtiCore
4
- VERSION = "0.0.4"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/lti_core.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "lti_core/version"
4
-
4
+ require_relative "lti_core/lti_resource_link_request"
5
5
  module LtiCore
6
6
  class Error < StandardError; end
7
7
  # Your code goes here...
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
4
+ version: 0.1.1
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-24 00:00:00.000000000 Z
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
@@ -211,14 +246,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
211
246
  requirements:
212
247
  - - ">="
213
248
  - !ruby/object:Gem::Version
214
- version: 2.7.0
249
+ version: 3.0.0
215
250
  required_rubygems_version: !ruby/object:Gem::Requirement
216
251
  requirements:
217
252
  - - ">="
218
253
  - !ruby/object:Gem::Version
219
254
  version: '0'
220
255
  requirements: []
221
- rubygems_version: 3.5.6
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.