panda_pal 5.4.10 → 5.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +39 -0
- data/app/controllers/panda_pal/api_call_controller.rb +36 -0
- data/app/lib/panda_pal/launch_url_helpers.rb +20 -6
- data/app/models/panda_pal/api_call.rb +58 -0
- data/app/models/panda_pal/organization.rb +55 -3
- data/app/models/panda_pal/organization_concerns/task_scheduling.rb +4 -2
- data/app/models/panda_pal/platform.rb +141 -6
- data/config/routes.rb +3 -0
- data/db/migrate/20220721095653_create_panda_pal_api_calls.rb +11 -0
- data/lib/panda_pal/engine.rb +6 -8
- data/lib/panda_pal/helpers/controller_helper.rb +2 -9
- data/lib/panda_pal/version.rb +1 -1
- data/panda_pal.gemspec +12 -2
- data/spec/controllers/panda_pal/api_call_controller_spec.rb +27 -0
- data/spec/dummy/config/database.yml +12 -12
- data/spec/dummy/db/schema.rb +11 -3
- data/spec/dummy/log/development.log +162 -0
- data/spec/dummy/log/test.log +12627 -0
- data/spec/models/panda_pal/api_call_spec.rb +30 -0
- data/spec/models/panda_pal/organization/task_scheduling_spec.rb +1 -0
- metadata +120 -39
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
module PandaPal
|
4
|
+
RSpec.describe ApiCall, type: :model do
|
5
|
+
let!(:subject) { ApiCall.create!(logic: '"#{p[:foo]}_bar"') }
|
6
|
+
let!(:jwt) { subject.jwt_token }
|
7
|
+
|
8
|
+
describe ".from_jwt" do
|
9
|
+
it "finds an ApiCall from a JWT" do
|
10
|
+
expect(ApiCall.from_jwt(jwt)).to eq subject
|
11
|
+
end
|
12
|
+
|
13
|
+
it "fails if the JWT is invalid" do
|
14
|
+
expect{ ApiCall.from_jwt("really.bad.jwt") }.to raise_error(JWT::DecodeError)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "#call" do
|
19
|
+
it "calls the function with parameters" do
|
20
|
+
expect(subject.call(foo: 'FOO')).to eq 'FOO_bar'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe "#call_url" do
|
25
|
+
it "generates a URL with the expected placholders" do
|
26
|
+
expect(subject.call_url).to eq "/panda_pal/call_logic?foo=TODO&token=#{jwt}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
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.
|
4
|
+
version: 5.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Instructure ProServe
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: jwt
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: httparty
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,6 +136,34 @@ dependencies:
|
|
122
136
|
- - ">="
|
123
137
|
- !ruby/object:Gem::Version
|
124
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rails
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '5.2'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '5.2'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pg
|
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'
|
125
167
|
- !ruby/object:Gem::Dependency
|
126
168
|
name: sidekiq
|
127
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,6 +192,34 @@ dependencies:
|
|
150
192
|
- - ">="
|
151
193
|
- !ruby/object:Gem::Version
|
152
194
|
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: ros-apartment
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - "~>"
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '2.11'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - "~>"
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '2.11'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: ros-apartment-sidekiq
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - "~>"
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '1.2'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - "~>"
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '1.2'
|
153
223
|
- !ruby/object:Gem::Dependency
|
154
224
|
name: rspec-rails
|
155
225
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,7 +248,7 @@ dependencies:
|
|
178
248
|
- - ">="
|
179
249
|
- !ruby/object:Gem::Version
|
180
250
|
version: '0'
|
181
|
-
description:
|
251
|
+
description:
|
182
252
|
email:
|
183
253
|
- pseng@instructure.com
|
184
254
|
executables: []
|
@@ -193,6 +263,7 @@ files:
|
|
193
263
|
- app/assets/javascripts/panda_pal/lti.js
|
194
264
|
- app/assets/stylesheets/panda_pal/application.css
|
195
265
|
- app/assets/stylesheets/panda_pal/lti.css
|
266
|
+
- app/controllers/panda_pal/api_call_controller.rb
|
196
267
|
- app/controllers/panda_pal/application_controller.rb
|
197
268
|
- app/controllers/panda_pal/lti_controller.rb
|
198
269
|
- app/controllers/panda_pal/lti_v1_p0_controller.rb
|
@@ -205,6 +276,7 @@ files:
|
|
205
276
|
- app/lib/panda_pal/launch_url_helpers.rb
|
206
277
|
- app/lib/panda_pal/lti_jwt_validator.rb
|
207
278
|
- app/lib/panda_pal/misc_helper.rb
|
279
|
+
- app/models/panda_pal/api_call.rb
|
208
280
|
- app/models/panda_pal/organization.rb
|
209
281
|
- app/models/panda_pal/organization_concerns/settings_validation.rb
|
210
282
|
- app/models/panda_pal/organization_concerns/task_scheduling.rb
|
@@ -223,6 +295,7 @@ files:
|
|
223
295
|
- db/migrate/20170106165533_add_salesforce_id_to_organizations.rb
|
224
296
|
- db/migrate/20171205183457_encrypt_organization_settings.rb
|
225
297
|
- db/migrate/20171205194657_remove_old_organization_settings.rb
|
298
|
+
- db/migrate/20220721095653_create_panda_pal_api_calls.rb
|
226
299
|
- lib/panda_pal.rb
|
227
300
|
- lib/panda_pal/engine.rb
|
228
301
|
- lib/panda_pal/helpers.rb
|
@@ -234,6 +307,7 @@ files:
|
|
234
307
|
- lib/panda_pal/version.rb
|
235
308
|
- lib/tasks/panda_pal_tasks.rake
|
236
309
|
- panda_pal.gemspec
|
310
|
+
- spec/controllers/panda_pal/api_call_controller_spec.rb
|
237
311
|
- spec/dummy/README.rdoc
|
238
312
|
- spec/dummy/Rakefile
|
239
313
|
- spec/dummy/app/assets/javascripts/application.js
|
@@ -264,12 +338,15 @@ files:
|
|
264
338
|
- spec/dummy/config/routes.rb
|
265
339
|
- spec/dummy/config/secrets.yml
|
266
340
|
- spec/dummy/db/schema.rb
|
341
|
+
- spec/dummy/log/development.log
|
342
|
+
- spec/dummy/log/test.log
|
267
343
|
- spec/dummy/public/404.html
|
268
344
|
- spec/dummy/public/422.html
|
269
345
|
- spec/dummy/public/500.html
|
270
346
|
- spec/dummy/public/favicon.ico
|
271
347
|
- spec/factories/panda_pal_organizations.rb
|
272
348
|
- spec/factories/panda_pal_sessions.rb
|
349
|
+
- spec/models/panda_pal/api_call_spec.rb
|
273
350
|
- spec/models/panda_pal/organization/settings_validation_spec.rb
|
274
351
|
- spec/models/panda_pal/organization/task_scheduling_spec.rb
|
275
352
|
- spec/models/panda_pal/organization_spec.rb
|
@@ -280,7 +357,7 @@ homepage: http://instructure.com
|
|
280
357
|
licenses:
|
281
358
|
- MIT
|
282
359
|
metadata: {}
|
283
|
-
post_install_message:
|
360
|
+
post_install_message:
|
284
361
|
rdoc_options: []
|
285
362
|
require_paths:
|
286
363
|
- lib
|
@@ -295,50 +372,54 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
295
372
|
- !ruby/object:Gem::Version
|
296
373
|
version: '0'
|
297
374
|
requirements: []
|
298
|
-
rubygems_version: 3.
|
299
|
-
signing_key:
|
375
|
+
rubygems_version: 3.1.6
|
376
|
+
signing_key:
|
300
377
|
specification_version: 4
|
301
378
|
summary: LTI mountable engine
|
302
379
|
test_files:
|
380
|
+
- spec/rails_helper.rb
|
381
|
+
- spec/models/panda_pal/api_call_spec.rb
|
382
|
+
- spec/models/panda_pal/organization_spec.rb
|
383
|
+
- spec/models/panda_pal/session_spec.rb
|
384
|
+
- spec/models/panda_pal/organization/settings_validation_spec.rb
|
385
|
+
- spec/models/panda_pal/organization/task_scheduling_spec.rb
|
386
|
+
- spec/controllers/panda_pal/api_call_controller_spec.rb
|
303
387
|
- spec/spec_helper.rb
|
304
|
-
- spec/dummy/
|
388
|
+
- spec/dummy/db/schema.rb
|
389
|
+
- spec/dummy/public/422.html
|
390
|
+
- spec/dummy/public/favicon.ico
|
391
|
+
- spec/dummy/public/404.html
|
392
|
+
- spec/dummy/public/500.html
|
393
|
+
- spec/dummy/Rakefile
|
305
394
|
- spec/dummy/app/views/layouts/application.html.erb
|
306
|
-
- spec/dummy/app/
|
307
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
395
|
+
- spec/dummy/app/controllers/application_controller.rb
|
308
396
|
- spec/dummy/app/helpers/application_helper.rb
|
309
|
-
- spec/dummy/
|
310
|
-
- spec/dummy/
|
311
|
-
- spec/dummy/bin/bundle
|
312
|
-
- spec/dummy/bin/rails
|
397
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
398
|
+
- spec/dummy/app/assets/javascripts/application.js
|
313
399
|
- spec/dummy/config/secrets.yml
|
314
|
-
- spec/dummy/config/routes.rb
|
315
|
-
- spec/dummy/config/locales/en.yml
|
316
|
-
- spec/dummy/config/environments/production.rb
|
317
|
-
- spec/dummy/config/environments/development.rb
|
318
|
-
- spec/dummy/config/environments/test.rb
|
319
|
-
- spec/dummy/config/environment.rb
|
320
400
|
- spec/dummy/config/application.rb
|
321
|
-
- spec/dummy/config/database.yml
|
322
|
-
- spec/dummy/config/boot.rb
|
323
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
324
|
-
- spec/dummy/config/initializers/mime_types.rb
|
325
|
-
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
326
401
|
- spec/dummy/config/initializers/session_store.rb
|
327
402
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
328
|
-
- spec/dummy/config/initializers/cookies_serializer.rb
|
329
403
|
- spec/dummy/config/initializers/inflections.rb
|
330
|
-
- spec/dummy/config.
|
331
|
-
- spec/dummy/
|
332
|
-
- spec/dummy/
|
333
|
-
- spec/dummy/
|
334
|
-
- spec/dummy/
|
335
|
-
- spec/dummy/
|
336
|
-
- spec/dummy/
|
404
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
405
|
+
- spec/dummy/config/initializers/mime_types.rb
|
406
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
407
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
408
|
+
- spec/dummy/config/environments/development.rb
|
409
|
+
- spec/dummy/config/environments/test.rb
|
410
|
+
- spec/dummy/config/environments/production.rb
|
411
|
+
- spec/dummy/config/database.yml
|
412
|
+
- spec/dummy/config/boot.rb
|
413
|
+
- spec/dummy/config/routes.rb
|
414
|
+
- spec/dummy/config/environment.rb
|
415
|
+
- spec/dummy/config/locales/en.yml
|
416
|
+
- spec/dummy/log/test.log
|
417
|
+
- spec/dummy/log/development.log
|
337
418
|
- spec/dummy/README.rdoc
|
338
|
-
- spec/
|
339
|
-
- spec/
|
340
|
-
- spec/
|
341
|
-
- spec/
|
342
|
-
- spec/
|
419
|
+
- spec/dummy/config.ru
|
420
|
+
- spec/dummy/bin/bundle
|
421
|
+
- spec/dummy/bin/rake
|
422
|
+
- spec/dummy/bin/setup
|
423
|
+
- spec/dummy/bin/rails
|
343
424
|
- spec/factories/panda_pal_organizations.rb
|
344
|
-
- spec/
|
425
|
+
- spec/factories/panda_pal_sessions.rb
|