lti_core 0.0.3 → 0.1.0

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: 9dcc68384cff39014335714a4e81824dd4fc4c93a65599253539f4e5ae8ce6bb
4
- data.tar.gz: 85b31c7cba9060c471bc348f46a933f48a33b32659733e05d3101a4e6cac3d8c
3
+ metadata.gz: d8c32487c6d1b1d79cf9ef5494f7ffec57d85e3890cf0c0705724510be7ec3a3
4
+ data.tar.gz: a9c416791a98a030f853dc18c747e19d2cbc63d349c8178a081679c405445e5c
5
5
  SHA512:
6
- metadata.gz: 4f835fbff1f3dc88131f8e40f1a22c204073e44ec2c1c6e42f866119d38ce811089bd67571eb822bab8a473d72c3807e98fa537444bd0d5a76e73fbeabc35d51
7
- data.tar.gz: 4a37e0b02a289690a597c01a8e60c2d918000868f0f8880415ccf84cc0fa7eba8e82eeaa47feae834949c13f22e89f9ab06dabb4b9dc1184c76a7f753e280806
6
+ metadata.gz: e1479809a6e7e9afe3a8477040e0634f72f865daf98429688798936cff1c20777b8e2e0bf9bc46f31c5690a5191d541771894d16c01b47d85b3d42c1bcf81ae9
7
+ data.tar.gz: 8e852f8f16c242050d749cdb90a8b5abea448259d3f5b7452801311793e62e8254a1d87424805917eb2874a21166cea2af7815515b46fd8f4994afc28f6b1836
data/.overcommit.yml ADDED
@@ -0,0 +1,53 @@
1
+ # Use this file to configure the Overcommit hooks you wish to use. This will
2
+ # extend the default configuration defined in:
3
+ # https://github.com/sds/overcommit/blob/master/config/default.yml
4
+ #
5
+ # At the topmost level of this YAML file is a key representing type of hook
6
+ # being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
7
+ # customize each hook, such as whether to only run it on certain files (via
8
+ # `include`), whether to only display output if it fails (via `quiet`), etc.
9
+ #
10
+ # For a complete list of hooks, see:
11
+ # https://github.com/sds/overcommit/tree/master/lib/overcommit/hook
12
+ #
13
+ # For a complete list of options that you can use to customize hooks, see:
14
+ # https://github.com/sds/overcommit#configuration
15
+ #
16
+ # Uncomment the following lines to make the configuration take effect.
17
+
18
+ #PreCommit:
19
+ # RuboCop:
20
+ # enabled: true
21
+ # on_warn: fail # Treat all warnings as failures
22
+ #
23
+ # TrailingWhitespace:
24
+ # enabled: true
25
+ # exclude:
26
+ # - '**/db/structure.sql' # Ignore trailing whitespace in generated files
27
+ #
28
+ #PostCheckout:
29
+ # ALL: # Special hook name that customizes all hooks of this type
30
+ # quiet: true # Change all post-checkout hooks to only display output on failure
31
+ #
32
+ # IndexTags:
33
+ # enabled: true # Generate a tags file with `ctags` each time HEAD changes
34
+
35
+ PreCommit:
36
+ BundleAudit:
37
+ enabled: true
38
+
39
+ Fasterer:
40
+ enabled: true
41
+
42
+ Flay:
43
+ enabled: true
44
+
45
+ Reek:
46
+ enabled: true
47
+
48
+ RuboCop:
49
+ enabled: true
50
+
51
+ PrePush:
52
+ RSpec:
53
+ enabled: true
data/.reek.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ detectors:
3
+ IrresponsibleModule:
4
+ enabled: false
data/.rubocop.yml CHANGED
@@ -1,5 +1,22 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rake
4
+ - rubocop-rspec
5
+
1
6
  AllCops:
2
- TargetRubyVersion: 3.0
7
+ NewCops: enable
8
+
9
+ Gemspec/DevelopmentDependencies:
10
+ Enabled: false
11
+
12
+ Metrics/BlockLength:
13
+ Enabled: false
14
+
15
+ RSpec/MultipleMemoizedHelpers:
16
+ Enabled: false
17
+
18
+ Style/Documentation:
19
+ Enabled: false
3
20
 
4
21
  Style/StringLiterals:
5
22
  Enabled: true
@@ -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.3"
4
+ VERSION = "0.1.0"
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,57 +1,211 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lti_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
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-23 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'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundle-audit
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: fasterer
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: flay
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: overcommit
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
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'
13
97
  - !ruby/object:Gem::Dependency
14
98
  name: rake
15
99
  requirement: !ruby/object:Gem::Requirement
16
100
  requirements:
17
- - - "~>"
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: reek
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
18
116
  - !ruby/object:Gem::Version
19
- version: '13.0'
117
+ version: '0'
20
118
  type: :development
21
119
  prerelease: false
22
120
  version_requirements: !ruby/object:Gem::Requirement
23
121
  requirements:
24
- - - "~>"
122
+ - - ">="
25
123
  - !ruby/object:Gem::Version
26
- version: '13.0'
124
+ version: '0'
27
125
  - !ruby/object:Gem::Dependency
28
126
  name: rspec
29
127
  requirement: !ruby/object:Gem::Requirement
30
128
  requirements:
31
- - - "~>"
129
+ - - ">="
32
130
  - !ruby/object:Gem::Version
33
- version: '3.0'
131
+ version: '0'
34
132
  type: :development
35
133
  prerelease: false
36
134
  version_requirements: !ruby/object:Gem::Requirement
37
135
  requirements:
38
- - - "~>"
136
+ - - ">="
39
137
  - !ruby/object:Gem::Version
40
- version: '3.0'
138
+ version: '0'
41
139
  - !ruby/object:Gem::Dependency
42
140
  name: rubocop
43
141
  requirement: !ruby/object:Gem::Requirement
44
142
  requirements:
45
- - - "~>"
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop-performance
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop-rake
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubocop-rspec
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: simplecov
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
46
200
  - !ruby/object:Gem::Version
47
- version: '1.21'
201
+ version: '0'
48
202
  type: :development
49
203
  prerelease: false
50
204
  version_requirements: !ruby/object:Gem::Requirement
51
205
  requirements:
52
- - - "~>"
206
+ - - ">="
53
207
  - !ruby/object:Gem::Version
54
- version: '1.21'
208
+ version: '0'
55
209
  description:
56
210
  email:
57
211
  - afstanton@gmail.com
@@ -59,12 +213,21 @@ executables: []
59
213
  extensions: []
60
214
  extra_rdoc_files: []
61
215
  files:
216
+ - ".overcommit.yml"
217
+ - ".reek.yml"
62
218
  - ".rspec"
63
219
  - ".rubocop.yml"
64
220
  - LICENSE.txt
65
221
  - README.md
66
222
  - Rakefile
67
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
68
231
  - lib/lti_core/version.rb
69
232
  - sig/lti_core.rbs
70
233
  homepage: https://github.com/afstanton/lti_core
@@ -74,6 +237,7 @@ metadata:
74
237
  allowed_push_host: https://rubygems.org
75
238
  homepage_uri: https://github.com/afstanton/lti_core
76
239
  source_code_uri: https://github.com/afstanton/lti_core
240
+ rubygems_mfa_required: 'true'
77
241
  post_install_message:
78
242
  rdoc_options: []
79
243
  require_paths:
@@ -82,14 +246,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
246
  requirements:
83
247
  - - ">="
84
248
  - !ruby/object:Gem::Version
85
- version: 2.6.0
249
+ version: 2.7.0
86
250
  required_rubygems_version: !ruby/object:Gem::Requirement
87
251
  requirements:
88
252
  - - ">="
89
253
  - !ruby/object:Gem::Version
90
254
  version: '0'
91
255
  requirements: []
92
- rubygems_version: 3.5.6
256
+ rubygems_version: 3.5.7
93
257
  signing_key:
94
258
  specification_version: 4
95
259
  summary: Implmentation of the LTI Core standard for Ruby.