panda_pal 5.0.0.beta.2 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +204 -107
  3. data/app/controllers/panda_pal/lti_controller.rb +0 -18
  4. data/app/controllers/panda_pal/lti_v1_p0_controller.rb +34 -0
  5. data/app/controllers/panda_pal/lti_v1_p3_controller.rb +98 -0
  6. data/app/lib/lti_xml/base_platform.rb +4 -4
  7. data/app/lib/panda_pal/launch_url_helpers.rb +69 -0
  8. data/app/lib/panda_pal/lti_jwt_validator.rb +88 -0
  9. data/app/lib/panda_pal/misc_helper.rb +11 -0
  10. data/app/models/panda_pal/organization.rb +21 -47
  11. data/app/models/panda_pal/organization_concerns/settings_validation.rb +127 -0
  12. data/app/models/panda_pal/organization_concerns/task_scheduling.rb +204 -0
  13. data/app/models/panda_pal/platform.rb +40 -0
  14. data/app/views/panda_pal/lti_v1_p3/login.html.erb +1 -0
  15. data/app/views/panda_pal/partials/_auto_submit_form.html.erb +9 -0
  16. data/config/dev_lti_key.key +27 -0
  17. data/config/routes.rb +12 -2
  18. data/db/migrate/20160412205931_create_panda_pal_organizations.rb +1 -1
  19. data/db/migrate/20160413135653_create_panda_pal_sessions.rb +1 -1
  20. data/db/migrate/20160425130344_add_panda_pal_organization_to_session.rb +1 -1
  21. data/db/migrate/20170106165533_add_salesforce_id_to_organizations.rb +1 -1
  22. data/db/migrate/20171205183457_encrypt_organization_settings.rb +1 -1
  23. data/db/migrate/20171205194657_remove_old_organization_settings.rb +8 -3
  24. data/lib/panda_pal.rb +28 -15
  25. data/lib/panda_pal/engine.rb +8 -39
  26. data/lib/panda_pal/helpers.rb +1 -0
  27. data/lib/panda_pal/helpers/controller_helper.rb +137 -90
  28. data/lib/panda_pal/helpers/route_helper.rb +8 -8
  29. data/lib/panda_pal/helpers/secure_headers.rb +79 -0
  30. data/lib/panda_pal/version.rb +1 -1
  31. data/panda_pal.gemspec +6 -2
  32. data/spec/dummy/config/application.rb +7 -1
  33. data/spec/dummy/config/environments/development.rb +0 -14
  34. data/spec/dummy/config/environments/production.rb +0 -11
  35. data/spec/models/panda_pal/organization/settings_validation_spec.rb +175 -0
  36. data/spec/models/panda_pal/organization/task_scheduling_spec.rb +144 -0
  37. data/spec/models/panda_pal/organization_spec.rb +0 -89
  38. data/spec/spec_helper.rb +4 -0
  39. metadata +66 -12
  40. data/app/views/panda_pal/lti/iframe_cookie_authorize.html.erb +0 -19
  41. data/app/views/panda_pal/lti/iframe_cookie_fix.html.erb +0 -12
  42. data/spec/dummy/config/initializers/assets.rb +0 -11
@@ -1,4 +1,8 @@
1
1
  ENV["RAILS_ENV"] ||= 'test'
2
+
3
+ require 'sidekiq/testing'
4
+ require 'sidekiq-scheduler'
5
+
2
6
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
3
7
  require 'rspec/rails'
4
8
  require 'rspec/autorun'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda_pal
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.beta.2
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure ProServe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-21 00:00:00.000000000 Z
11
+ date: 2020-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.1.0
19
+ version: '4.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 5.1.0
26
+ version: '4.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pg
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -106,14 +106,56 @@ dependencies:
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: 6.1.2
109
+ version: '6.1'
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: 6.1.2
116
+ version: '6.1'
117
+ - !ruby/object:Gem::Dependency
118
+ name: json-jwt
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ type: :runtime
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ - !ruby/object:Gem::Dependency
132
+ name: sidekiq
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ - !ruby/object:Gem::Dependency
146
+ name: sidekiq-scheduler
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
117
159
  - !ruby/object:Gem::Dependency
118
160
  name: rspec-rails
119
161
  requirement: !ruby/object:Gem::Requirement
@@ -158,16 +200,25 @@ files:
158
200
  - app/assets/stylesheets/panda_pal/lti.css
159
201
  - app/controllers/panda_pal/application_controller.rb
160
202
  - app/controllers/panda_pal/lti_controller.rb
203
+ - app/controllers/panda_pal/lti_v1_p0_controller.rb
204
+ - app/controllers/panda_pal/lti_v1_p3_controller.rb
161
205
  - app/helpers/panda_pal/application_helper.rb
162
206
  - app/lib/lti_xml/base_platform.rb
163
207
  - app/lib/lti_xml/bridge_platform.rb
164
208
  - app/lib/lti_xml/canvas_platform.rb
209
+ - app/lib/panda_pal/launch_url_helpers.rb
210
+ - app/lib/panda_pal/lti_jwt_validator.rb
211
+ - app/lib/panda_pal/misc_helper.rb
165
212
  - app/models/panda_pal/organization.rb
213
+ - app/models/panda_pal/organization_concerns/settings_validation.rb
214
+ - app/models/panda_pal/organization_concerns/task_scheduling.rb
215
+ - app/models/panda_pal/platform.rb
166
216
  - app/models/panda_pal/session.rb
167
217
  - app/views/layouts/panda_pal/application.html.erb
168
- - app/views/panda_pal/lti/iframe_cookie_authorize.html.erb
169
- - app/views/panda_pal/lti/iframe_cookie_fix.html.erb
170
218
  - app/views/panda_pal/lti/launch.html.erb
219
+ - app/views/panda_pal/lti_v1_p3/login.html.erb
220
+ - app/views/panda_pal/partials/_auto_submit_form.html.erb
221
+ - config/dev_lti_key.key
171
222
  - config/initializers/apartment.rb
172
223
  - config/routes.rb
173
224
  - db/618eef7c0380ba654ad16f867a919e72.sqlite3
@@ -185,6 +236,7 @@ files:
185
236
  - lib/panda_pal/helpers.rb
186
237
  - lib/panda_pal/helpers/controller_helper.rb
187
238
  - lib/panda_pal/helpers/route_helper.rb
239
+ - lib/panda_pal/helpers/secure_headers.rb
188
240
  - lib/panda_pal/plugins.rb
189
241
  - lib/panda_pal/version.rb
190
242
  - lib/tasks/panda_pal_tasks.rake
@@ -208,7 +260,6 @@ files:
208
260
  - spec/dummy/config/environments/development.rb
209
261
  - spec/dummy/config/environments/production.rb
210
262
  - spec/dummy/config/environments/test.rb
211
- - spec/dummy/config/initializers/assets.rb
212
263
  - spec/dummy/config/initializers/backtrace_silencers.rb
213
264
  - spec/dummy/config/initializers/cookies_serializer.rb
214
265
  - spec/dummy/config/initializers/filter_parameter_logging.rb
@@ -230,6 +281,8 @@ files:
230
281
  - spec/dummy/public/favicon.ico
231
282
  - spec/factories/panda_pal_organizations.rb
232
283
  - spec/factories/panda_pal_sessions.rb
284
+ - spec/models/panda_pal/organization/settings_validation_spec.rb
285
+ - spec/models/panda_pal/organization/task_scheduling_spec.rb
233
286
  - spec/models/panda_pal/organization_spec.rb
234
287
  - spec/models/panda_pal/session_spec.rb
235
288
  - spec/rails_helper.rb
@@ -249,9 +302,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
249
302
  version: '0'
250
303
  required_rubygems_version: !ruby/object:Gem::Requirement
251
304
  requirements:
252
- - - ">"
305
+ - - ">="
253
306
  - !ruby/object:Gem::Version
254
- version: 1.3.1
307
+ version: '0'
255
308
  requirements: []
256
309
  rubygems_version: 3.1.2
257
310
  signing_key:
@@ -283,7 +336,6 @@ test_files:
283
336
  - spec/dummy/config/initializers/filter_parameter_logging.rb
284
337
  - spec/dummy/config/initializers/session_store.rb
285
338
  - spec/dummy/config/initializers/wrap_parameters.rb
286
- - spec/dummy/config/initializers/assets.rb
287
339
  - spec/dummy/config/initializers/cookies_serializer.rb
288
340
  - spec/dummy/config/initializers/inflections.rb
289
341
  - spec/dummy/config.ru
@@ -298,6 +350,8 @@ test_files:
298
350
  - spec/dummy/log/test.log
299
351
  - spec/dummy/log/development.log
300
352
  - spec/dummy/README.rdoc
353
+ - spec/models/panda_pal/organization/settings_validation_spec.rb
354
+ - spec/models/panda_pal/organization/task_scheduling_spec.rb
301
355
  - spec/models/panda_pal/session_spec.rb
302
356
  - spec/models/panda_pal/organization_spec.rb
303
357
  - spec/factories/panda_pal_sessions.rb
@@ -1,19 +0,0 @@
1
- <html>
2
- <p>Safari requires your consent to access session information when applications are hosted inside of Canvas. Please consent by clicking the following button.</p>
3
- <button id="myButton">Authorize application to use browser session</button>
4
- <script nonce=<%= content_security_policy_script_nonce %>>
5
- function makeRequestWithUserGesture() {
6
- var promise = document.requestStorageAccess();
7
- promise.then(
8
- function () {
9
- var referrer = document.referrer;
10
- window.location='?safari_cookie_authorized=true&return_to='.concat(encodeURI(window.location));
11
- },
12
- function () {
13
- // If the user doesn't consent, then do nothing.
14
- }
15
- );
16
- }
17
- document.getElementById("myButton").addEventListener("click", makeRequestWithUserGesture);
18
- </script>
19
- </html>
@@ -1,12 +0,0 @@
1
- <script nonce=<%= content_security_policy_script_nonce %>>
2
- const mainWindow = window.parent;
3
- var url = window.location.href;
4
- // Until PLAT-4836 is resolved, we need to make sure our url has a "?" in it.
5
- if (!(url.indexOf("?") > -1)) {
6
- url = url + "?dummy_param=1"
7
- }
8
- mainWindow.postMessage({
9
- messageType: "requestFullWindowLaunch",
10
- data: url
11
- }, '*');
12
- </script>
@@ -1,11 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Version of your assets, change this if you want to expire all your assets.
4
- Rails.application.config.assets.version = '1.0'
5
-
6
- # Add additional assets to the asset load path
7
- # Rails.application.config.assets.paths << Emoji.images_path
8
-
9
- # Precompile additional assets.
10
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
- # Rails.application.config.assets.precompile += %w( search.js )