panda_pal 5.4.11 → 5.6.0
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 -0
- 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 +5 -7
- 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 +84 -3
@@ -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.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: 2022-
|
11
|
+
date: 2022-07-29 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
|
@@ -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
|
@@ -295,16 +372,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
295
372
|
- !ruby/object:Gem::Version
|
296
373
|
version: '0'
|
297
374
|
requirements: []
|
298
|
-
rubygems_version: 3.
|
375
|
+
rubygems_version: 3.1.6
|
299
376
|
signing_key:
|
300
377
|
specification_version: 4
|
301
378
|
summary: LTI mountable engine
|
302
379
|
test_files:
|
303
380
|
- spec/rails_helper.rb
|
381
|
+
- spec/models/panda_pal/api_call_spec.rb
|
304
382
|
- spec/models/panda_pal/organization_spec.rb
|
305
383
|
- spec/models/panda_pal/session_spec.rb
|
306
384
|
- spec/models/panda_pal/organization/settings_validation_spec.rb
|
307
385
|
- spec/models/panda_pal/organization/task_scheduling_spec.rb
|
386
|
+
- spec/controllers/panda_pal/api_call_controller_spec.rb
|
308
387
|
- spec/spec_helper.rb
|
309
388
|
- spec/dummy/db/schema.rb
|
310
389
|
- spec/dummy/public/422.html
|
@@ -334,6 +413,8 @@ test_files:
|
|
334
413
|
- spec/dummy/config/routes.rb
|
335
414
|
- spec/dummy/config/environment.rb
|
336
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
419
|
- spec/dummy/config.ru
|
339
420
|
- spec/dummy/bin/bundle
|