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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0943e97f6d2613ad998906f27e159dcc604171d8
4
- data.tar.gz: b7b5e43868381971bb4977435a029306d5352db1
3
+ metadata.gz: 93969389a33a1c7eabee7af327fd8f3b38df303e
4
+ data.tar.gz: 9a042ba6f70ac543103a9c66087829f6db3cf672
5
5
  SHA512:
6
- metadata.gz: f811c1fd2ddebd80675ee7f57dae0207363e8ec4e3c3d979e4496ad60dc403f9abb265025ff3f18d2e4e9049aca11e1a71c4afcc714991b46025ffff1c1a72d3
7
- data.tar.gz: de233030855e214740d63d92b742802156d9821685bb92aeadc0ff3d5c36cea3592d818d86dafbf7cb91ff364b56402d32242b9bc730db9644063d240e1cb6be
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
 
@@ -28,7 +28,7 @@ module DceLti
28
28
  end
29
29
 
30
30
  def redirect_after_successful_auth
31
- Engine.config.redirect_after_successful_auth.call
31
+ Engine.config.redirect_after_successful_auth.call(self)
32
32
  end
33
33
 
34
34
  def tool_provider
@@ -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 = ->(*) {}
@@ -1,3 +1,3 @@
1
1
  module DceLti
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -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
- after_auth_url = ->{ url }
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
   (0.2ms) SELECT version FROM "schema_migrations"
2929
2929
   (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20141008172001')
2930
2930
   (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20141003180140')
2931
+  (111.0ms) DROP DATABASE IF EXISTS "dce_lti_dummy_test"
2932
+  (243.2ms) CREATE DATABASE "dce_lti_dummy_test" ENCODING = 'utf8'
2933
+ SQL (0.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2934
+  (16.4ms) CREATE TABLE "dce_lti_nonces" ("id" serial primary key, "nonce" character varying(255), "created_at" timestamp, "updated_at" timestamp)
2935
+  (7.6ms) CREATE UNIQUE INDEX "index_dce_lti_nonces_on_nonce" ON "dce_lti_nonces" USING btree ("nonce")
2936
+  (13.0ms) 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
+  (1.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
2938
+  (3.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2939
+  (0.4ms) SELECT version FROM "schema_migrations"
2940
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20141008172001')
2941
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20141003180140')
2942
+  (109.1ms) DROP DATABASE IF EXISTS "dce_lti_dummy_test"
2943
+  (238.0ms) CREATE DATABASE "dce_lti_dummy_test" ENCODING = 'utf8'
2944
+ SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2945
+  (10.0ms) CREATE TABLE "dce_lti_nonces" ("id" serial primary key, "nonce" character varying(255), "created_at" timestamp, "updated_at" timestamp)
2946
+  (4.1ms) CREATE UNIQUE INDEX "index_dce_lti_nonces_on_nonce" ON "dce_lti_nonces" USING btree ("nonce")
2947
+  (9.3ms) 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
+  (1.7ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
2949
+  (3.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2950
+  (0.4ms) SELECT version FROM "schema_migrations"
2951
+  (2.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20141008172001')
2952
+  (2.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20141003180140')
2953
+  (105.9ms) DROP DATABASE IF EXISTS "dce_lti_dummy_test"
2954
+  (228.5ms) CREATE DATABASE "dce_lti_dummy_test" ENCODING = 'utf8'
2955
+ SQL (0.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2956
+  (8.0ms) CREATE TABLE "dce_lti_nonces" ("id" serial primary key, "nonce" character varying(255), "created_at" timestamp, "updated_at" timestamp)
2957
+  (7.2ms) CREATE UNIQUE INDEX "index_dce_lti_nonces_on_nonce" ON "dce_lti_nonces" USING btree ("nonce")
2958
+  (13.3ms) 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
+  (2.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
2960
+  (7.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2961
+  (0.3ms) SELECT version FROM "schema_migrations"
2962
+  (2.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20141008172001')
2963
+  (2.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20141003180140')
2964
+  (104.7ms) DROP DATABASE IF EXISTS "dce_lti_dummy_test"
2965
+  (235.8ms) CREATE DATABASE "dce_lti_dummy_test" ENCODING = 'utf8'
2966
+ SQL (0.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2967
+  (9.8ms) CREATE TABLE "dce_lti_nonces" ("id" serial primary key, "nonce" character varying(255), "created_at" timestamp, "updated_at" timestamp)
2968
+  (7.3ms) CREATE UNIQUE INDEX "index_dce_lti_nonces_on_nonce" ON "dce_lti_nonces" USING btree ("nonce")
2969
+  (7.0ms) 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
+  (1.5ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
2971
+  (3.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2972
+  (0.2ms) SELECT version FROM "schema_migrations"
2973
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20141008172001')
2974
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20141003180140')
2975
+  (106.0ms) DROP DATABASE IF EXISTS "dce_lti_dummy_test"
2976
+  (234.0ms) CREATE DATABASE "dce_lti_dummy_test" ENCODING = 'utf8'
2977
+ SQL (0.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2978
+  (15.9ms) CREATE TABLE "dce_lti_nonces" ("id" serial primary key, "nonce" character varying(255), "created_at" timestamp, "updated_at" timestamp)
2979
+  (7.0ms) CREATE UNIQUE INDEX "index_dce_lti_nonces_on_nonce" ON "dce_lti_nonces" USING btree ("nonce")
2980
+  (13.1ms) 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
+  (2.6ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
2982
+  (7.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2983
+  (0.2ms) SELECT version FROM "schema_migrations"
2984
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20141008172001')
2985
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20141003180140')