dce_lti 0.3.0 → 0.4.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 +2 -1
- data/app/concerns/dce_lti/session_helpers.rb +1 -1
- data/lib/dce_lti/engine.rb +1 -1
- data/lib/dce_lti/version.rb +1 -1
- data/spec/controllers/dce_lti/sessions_controller_spec.rb +6 -1
- data/spec/dummy/config/initializers/dce_lti_config.rb +1 -1
- data/spec/dummy/log/development.log +55 -0
- data/spec/dummy/log/test.log +7063 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93969389a33a1c7eabee7af327fd8f3b38df303e
|
4
|
+
data.tar.gz: 9a042ba6f70ac543103a9c66087829f6db3cf672
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e71bb0b7f2f05bc3f360f194857efa660dbf37a1e06fd14ad2b48198317ed64a0877fd696f6aa7151137a6074f027919c1ee0dcc204539aef550ce0632ecdf94
|
7
|
+
data.tar.gz: e43d735ebe797fde5a6f78b0f5e81c8390bedba4df62c667fb44632e2cd732dd2ad638adc4ef5c6d5ebd58c66ded71bc48d155086f37e9f1a21813ed305f574b
|
data/README.md
CHANGED
@@ -128,7 +128,8 @@ These values come from the LTI values posted by the consumer.
|
|
128
128
|
By default, a successful launch will redirect to your application's
|
129
129
|
`root_path`. This is configured via `redirect_after_successful_auth` which is
|
130
130
|
evaluated in engine controller context. This method should have access to
|
131
|
-
`current_user`, rails route helpers and other controller-specific context
|
131
|
+
`current_user`, rails route helpers and other controller-specific context
|
132
|
+
through the controller instance passed to it.
|
132
133
|
|
133
134
|
### Invalid LTI Sessions
|
134
135
|
|
data/lib/dce_lti/engine.rb
CHANGED
@@ -17,7 +17,7 @@ launch_presentation_return_url
|
|
17
17
|
config.provider_title = (ENV['LTI_PROVIDER_TITLE'] || 'DCE LTI Provider')
|
18
18
|
config.provider_description = (ENV['LTI_PROVIDER_DESCRIPTION'] || 'A description of this')
|
19
19
|
|
20
|
-
config.redirect_after_successful_auth = -> do
|
20
|
+
config.redirect_after_successful_auth = -> (controller) do
|
21
21
|
Rails.application.routes.url_helpers.root_path
|
22
22
|
end
|
23
23
|
config.tool_config_extensions = ->(*) {}
|
data/lib/dce_lti/version.rb
CHANGED
@@ -124,7 +124,11 @@ module DceLti
|
|
124
124
|
context 'valid LTI requests' do
|
125
125
|
it 'redirects to "redirect_after_successful_auth" url when it is a proc' do
|
126
126
|
url = '/sessions/create'
|
127
|
-
|
127
|
+
allow(controller).to receive(:canary_method)
|
128
|
+
after_auth_url = ->(controller) do
|
129
|
+
controller.canary_method
|
130
|
+
url
|
131
|
+
end
|
128
132
|
|
129
133
|
with_overridden_lti_config_of(lti_config.merge(redirect_after_successful_auth: after_auth_url)) do
|
130
134
|
tool_provider = stub_successful_tool_provider
|
@@ -132,6 +136,7 @@ module DceLti
|
|
132
136
|
post_to_create_with_params
|
133
137
|
|
134
138
|
expect(request).to redirect_to(url)
|
139
|
+
expect(controller).to have_received(:canary_method)
|
135
140
|
end
|
136
141
|
end
|
137
142
|
|
@@ -5,7 +5,7 @@ DceLti::Engine.setup do |lti|
|
|
5
5
|
#
|
6
6
|
# lti.provider_title = (ENV['LTI_PROVIDER_TITLE'] || 'DCE LTI Provider')
|
7
7
|
# lti.provider_description = (ENV['LTI_PROVIDER_DESCRIPTION'] || 'A description of this')
|
8
|
-
# lti.redirect_after_successful_auth = ->{ Rails.application.routes.url_helpers.root_path }
|
8
|
+
# lti.redirect_after_successful_auth = ->(controller) { Rails.application.routes.url_helpers.root_path }
|
9
9
|
|
10
10
|
lti.consumer_secret = (ENV['LTI_CONSUMER_SECRET'] || 'consumer_secret')
|
11
11
|
lti.consumer_key = (ENV['LTI_CONSUMER_KEY'] || 'consumer_key')
|
@@ -2928,3 +2928,58 @@ Completed 200 OK in 3ms (Views: 0.4ms | ActiveRecord: 0.6ms)
|
|
2928
2928
|
[1m[36m (0.2ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
2929
2929
|
[1m[35m (1.0ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20141008172001')
|
2930
2930
|
[1m[36m (1.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20141003180140')[0m
|
2931
|
+
[1m[36m (111.0ms)[0m [1mDROP DATABASE IF EXISTS "dce_lti_dummy_test"[0m
|
2932
|
+
[1m[35m (243.2ms)[0m CREATE DATABASE "dce_lti_dummy_test" ENCODING = 'utf8'
|
2933
|
+
[1m[36mSQL (0.4ms)[0m [1mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m
|
2934
|
+
[1m[35m (16.4ms)[0m CREATE TABLE "dce_lti_nonces" ("id" serial primary key, "nonce" character varying(255), "created_at" timestamp, "updated_at" timestamp)
|
2935
|
+
[1m[36m (7.6ms)[0m [1mCREATE UNIQUE INDEX "index_dce_lti_nonces_on_nonce" ON "dce_lti_nonces" USING btree ("nonce")[0m
|
2936
|
+
[1m[35m (13.0ms)[0m CREATE TABLE "dce_lti_users" ("id" serial primary key, "lti_user_id" character varying(255), "lis_person_contact_email_primary" character varying(255), "lis_person_name_family" character varying(255), "lis_person_name_full" character varying(255), "lis_person_name_given" character varying(255), "lis_person_sourcedid" character varying(255), "user_image" character varying(255), "roles" character varying(255)[] DEFAULT '{}', "created_at" timestamp, "updated_at" timestamp)
|
2937
|
+
[1m[36m (1.8ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [0m
|
2938
|
+
[1m[35m (3.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
2939
|
+
[1m[36m (0.4ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
2940
|
+
[1m[35m (1.3ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20141008172001')
|
2941
|
+
[1m[36m (1.2ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20141003180140')[0m
|
2942
|
+
[1m[36m (109.1ms)[0m [1mDROP DATABASE IF EXISTS "dce_lti_dummy_test"[0m
|
2943
|
+
[1m[35m (238.0ms)[0m CREATE DATABASE "dce_lti_dummy_test" ENCODING = 'utf8'
|
2944
|
+
[1m[36mSQL (0.3ms)[0m [1mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m
|
2945
|
+
[1m[35m (10.0ms)[0m CREATE TABLE "dce_lti_nonces" ("id" serial primary key, "nonce" character varying(255), "created_at" timestamp, "updated_at" timestamp)
|
2946
|
+
[1m[36m (4.1ms)[0m [1mCREATE UNIQUE INDEX "index_dce_lti_nonces_on_nonce" ON "dce_lti_nonces" USING btree ("nonce")[0m
|
2947
|
+
[1m[35m (9.3ms)[0m CREATE TABLE "dce_lti_users" ("id" serial primary key, "lti_user_id" character varying(255), "lis_person_contact_email_primary" character varying(255), "lis_person_name_family" character varying(255), "lis_person_name_full" character varying(255), "lis_person_name_given" character varying(255), "lis_person_sourcedid" character varying(255), "user_image" character varying(255), "roles" character varying(255)[] DEFAULT '{}', "created_at" timestamp, "updated_at" timestamp)
|
2948
|
+
[1m[36m (1.7ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [0m
|
2949
|
+
[1m[35m (3.9ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
2950
|
+
[1m[36m (0.4ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
2951
|
+
[1m[35m (2.5ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20141008172001')
|
2952
|
+
[1m[36m (2.5ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20141003180140')[0m
|
2953
|
+
[1m[36m (105.9ms)[0m [1mDROP DATABASE IF EXISTS "dce_lti_dummy_test"[0m
|
2954
|
+
[1m[35m (228.5ms)[0m CREATE DATABASE "dce_lti_dummy_test" ENCODING = 'utf8'
|
2955
|
+
[1m[36mSQL (0.2ms)[0m [1mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m
|
2956
|
+
[1m[35m (8.0ms)[0m CREATE TABLE "dce_lti_nonces" ("id" serial primary key, "nonce" character varying(255), "created_at" timestamp, "updated_at" timestamp)
|
2957
|
+
[1m[36m (7.2ms)[0m [1mCREATE UNIQUE INDEX "index_dce_lti_nonces_on_nonce" ON "dce_lti_nonces" USING btree ("nonce")[0m
|
2958
|
+
[1m[35m (13.3ms)[0m CREATE TABLE "dce_lti_users" ("id" serial primary key, "lti_user_id" character varying(255), "lis_person_contact_email_primary" character varying(255), "lis_person_name_family" character varying(255), "lis_person_name_full" character varying(255), "lis_person_name_given" character varying(255), "lis_person_sourcedid" character varying(255), "user_image" character varying(255), "roles" character varying(255)[] DEFAULT '{}', "created_at" timestamp, "updated_at" timestamp)
|
2959
|
+
[1m[36m (2.8ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [0m
|
2960
|
+
[1m[35m (7.6ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
2961
|
+
[1m[36m (0.3ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
2962
|
+
[1m[35m (2.5ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20141008172001')
|
2963
|
+
[1m[36m (2.5ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20141003180140')[0m
|
2964
|
+
[1m[36m (104.7ms)[0m [1mDROP DATABASE IF EXISTS "dce_lti_dummy_test"[0m
|
2965
|
+
[1m[35m (235.8ms)[0m CREATE DATABASE "dce_lti_dummy_test" ENCODING = 'utf8'
|
2966
|
+
[1m[36mSQL (0.1ms)[0m [1mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m
|
2967
|
+
[1m[35m (9.8ms)[0m CREATE TABLE "dce_lti_nonces" ("id" serial primary key, "nonce" character varying(255), "created_at" timestamp, "updated_at" timestamp)
|
2968
|
+
[1m[36m (7.3ms)[0m [1mCREATE UNIQUE INDEX "index_dce_lti_nonces_on_nonce" ON "dce_lti_nonces" USING btree ("nonce")[0m
|
2969
|
+
[1m[35m (7.0ms)[0m CREATE TABLE "dce_lti_users" ("id" serial primary key, "lti_user_id" character varying(255), "lis_person_contact_email_primary" character varying(255), "lis_person_name_family" character varying(255), "lis_person_name_full" character varying(255), "lis_person_name_given" character varying(255), "lis_person_sourcedid" character varying(255), "user_image" character varying(255), "roles" character varying(255)[] DEFAULT '{}', "created_at" timestamp, "updated_at" timestamp)
|
2970
|
+
[1m[36m (1.5ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [0m
|
2971
|
+
[1m[35m (3.4ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
2972
|
+
[1m[36m (0.2ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
2973
|
+
[1m[35m (1.0ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20141008172001')
|
2974
|
+
[1m[36m (1.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20141003180140')[0m
|
2975
|
+
[1m[36m (106.0ms)[0m [1mDROP DATABASE IF EXISTS "dce_lti_dummy_test"[0m
|
2976
|
+
[1m[35m (234.0ms)[0m CREATE DATABASE "dce_lti_dummy_test" ENCODING = 'utf8'
|
2977
|
+
[1m[36mSQL (0.2ms)[0m [1mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m
|
2978
|
+
[1m[35m (15.9ms)[0m CREATE TABLE "dce_lti_nonces" ("id" serial primary key, "nonce" character varying(255), "created_at" timestamp, "updated_at" timestamp)
|
2979
|
+
[1m[36m (7.0ms)[0m [1mCREATE UNIQUE INDEX "index_dce_lti_nonces_on_nonce" ON "dce_lti_nonces" USING btree ("nonce")[0m
|
2980
|
+
[1m[35m (13.1ms)[0m CREATE TABLE "dce_lti_users" ("id" serial primary key, "lti_user_id" character varying(255), "lis_person_contact_email_primary" character varying(255), "lis_person_name_family" character varying(255), "lis_person_name_full" character varying(255), "lis_person_name_given" character varying(255), "lis_person_sourcedid" character varying(255), "user_image" character varying(255), "roles" character varying(255)[] DEFAULT '{}', "created_at" timestamp, "updated_at" timestamp)
|
2981
|
+
[1m[36m (2.6ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [0m
|
2982
|
+
[1m[35m (7.1ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
2983
|
+
[1m[36m (0.2ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
2984
|
+
[1m[35m (1.2ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20141008172001')
|
2985
|
+
[1m[36m (1.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20141003180140')[0m
|