qalam_lti_provider_engine 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +146 -0
- data/Rakefile +28 -0
- data/app/controllers/lti_provider/application_controller.rb +5 -0
- data/app/controllers/lti_provider/lti_application_controller.rb +5 -0
- data/app/controllers/lti_provider/lti_controller.rb +73 -0
- data/app/models/lti_provider/launch.rb +106 -0
- data/app/views/layouts/lti_provider/application.html.erb +12 -0
- data/app/views/lti_provider/lti/cookie_test.html.erb +4 -0
- data/config/lti.yml.example +13 -0
- data/config/lti_xml.yml.example +22 -0
- data/config/routes.rb +6 -0
- data/db/migrate/20130319050003_create_lti_provider_launches.rb +11 -0
- data/lib/lti_provider/config.rb +3 -0
- data/lib/lti_provider/engine.rb +19 -0
- data/lib/lti_provider/lti_application.rb +60 -0
- data/lib/lti_provider/lti_config.rb +30 -0
- data/lib/lti_provider/lti_xml_config.rb +23 -0
- data/lib/lti_provider/version.rb +3 -0
- data/lib/lti_provider/xml_config.rb +3 -0
- data/lib/lti_provider.rb +20 -0
- data/lib/tasks/lti_provider_tasks.rake +4 -0
- data/spec/controllers/lti_provider/lti_controller_spec.rb +147 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/welcome_controller.rb +5 -0
- data/spec/dummy/config/application.rb +57 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/cucumber.yml +8 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +29 -0
- data/spec/dummy/config/environments/production.rb +65 -0
- data/spec/dummy/config/environments/test.rb +33 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/lti.yml +13 -0
- data/spec/dummy/config/lti_xml.yml +24 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/migrate/20130319050206_create_lti_provider_launches.lti_provider.rb +12 -0
- data/spec/dummy/db/schema.rb +24 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/robots.txt +5 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/models/lti_provider/launch_spec.rb +70 -0
- data/spec/spec_helper.rb +57 -0
- metadata +353 -0
@@ -0,0 +1,147 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe LtiProvider::LtiController do
|
4
|
+
before do
|
5
|
+
@routes = LtiProvider::Engine.routes
|
6
|
+
end
|
7
|
+
|
8
|
+
let(:user_id) { "1" }
|
9
|
+
let(:parameters) {
|
10
|
+
{
|
11
|
+
'launch_url' => "http://#{request.host}/launch",
|
12
|
+
'custom_canvas_user_id' => user_id,
|
13
|
+
'launch_presentation_return_url' => "http://test.canvas",
|
14
|
+
|
15
|
+
'lti_version' => 'LTI-1p0',
|
16
|
+
'lti_message_type' => 'basic-lti-launch-request',
|
17
|
+
'action' => 'launch',
|
18
|
+
'controller' => 'lti_provider/lti'
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
def create_consumer(key, secret)
|
23
|
+
consumer = IMS::LTI::ToolConsumer.new(key, secret, parameters)
|
24
|
+
consumer.resource_link_id = 'abc'
|
25
|
+
consumer
|
26
|
+
end
|
27
|
+
|
28
|
+
def post_lti_request!(key, secret)
|
29
|
+
consumer = create_consumer(key, secret)
|
30
|
+
|
31
|
+
# the oauth rack request proxy doesn't know to strip the 'action' and
|
32
|
+
# 'controller' parameters, so we need to stub them here so the request also
|
33
|
+
# gets signed with them
|
34
|
+
allow(consumer).to receive(:to_params).and_return(parameters)
|
35
|
+
|
36
|
+
data = consumer.generate_launch_data
|
37
|
+
request.env['RAW_POST_DATA'] = data.to_query
|
38
|
+
request.env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'
|
39
|
+
request.env['HTTP_REFERER'] = 'http://test.canvas/external_tools/1'
|
40
|
+
|
41
|
+
post :launch, params: data
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "GET cookie_test" do
|
45
|
+
context "when successful" do
|
46
|
+
it "proceeds to oauth" do
|
47
|
+
controller.session[:cookie_test] = true
|
48
|
+
expect(controller).to receive(:consume_launch)
|
49
|
+
get :cookie_test
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
context "when failed" do
|
54
|
+
it "renders a message" do
|
55
|
+
get :cookie_test
|
56
|
+
expect(response).not_to be_redirect
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe "POST launch" do
|
62
|
+
context "with a valid key" do
|
63
|
+
before do
|
64
|
+
post_lti_request!(LtiProvider::Config.key, LtiProvider::Config.secret)
|
65
|
+
end
|
66
|
+
|
67
|
+
it "performs a cookie test and passes along the nonce" do
|
68
|
+
launch = LtiProvider::Launch.first
|
69
|
+
expect(response.redirect_url).to redirect_to(lti_provider.cookie_test_url(nonce: launch.nonce, host: request.host))
|
70
|
+
end
|
71
|
+
|
72
|
+
it "saves the launch record" do
|
73
|
+
expect(LtiProvider::Launch.first.user_id).to eq user_id
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
context "without a key" do
|
78
|
+
it "renders an error message" do
|
79
|
+
post_lti_request!('', '')
|
80
|
+
expect(response.body).to match "Consumer key not provided."
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
context "with an invalid secret" do
|
85
|
+
it "renders an error message" do
|
86
|
+
post_lti_request!(LtiProvider::Config.key, 'invalid')
|
87
|
+
expect(response.body).to match "The OAuth signature was invalid."
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
describe "consume_launch" do
|
93
|
+
let!(:launch) do
|
94
|
+
LtiProvider::Launch.create!({
|
95
|
+
canvas_url: 'http://canvas',
|
96
|
+
nonce: 'abcd',
|
97
|
+
provider_params: {
|
98
|
+
'custom_canvas_course_id' => 1,
|
99
|
+
'custom_canvas_user_id' => 2,
|
100
|
+
'tool_consumer_instance_guid' => '123abc',
|
101
|
+
'ext_roles' => 'student'
|
102
|
+
}
|
103
|
+
})
|
104
|
+
end
|
105
|
+
|
106
|
+
describe "a successful launch" do
|
107
|
+
it "sets the session params" do
|
108
|
+
get :consume_launch, params: { nonce: 'abcd' }
|
109
|
+
expect(session[:course_id]).to eq 1
|
110
|
+
expect(session[:user_id]).to eq 2
|
111
|
+
expect(session[:canvas_url]).to eq 'http://canvas'
|
112
|
+
expect(session[:tool_consumer_instance_guid]).to eq '123abc'
|
113
|
+
expect(session[:user_roles]).to eq 'student'
|
114
|
+
end
|
115
|
+
|
116
|
+
it "destroys the launch" do
|
117
|
+
get :consume_launch, params: { nonce: 'abcd' }
|
118
|
+
expect(LtiProvider::Launch.count).to eq 0
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
describe "an expired nonce" do
|
123
|
+
before do
|
124
|
+
launch.update_attribute(:created_at, 10.minutes.ago)
|
125
|
+
end
|
126
|
+
|
127
|
+
it "shows an error" do
|
128
|
+
get :consume_launch, params: { nonce: 'abcd' }
|
129
|
+
expect(response.body).to be =~ /not launched successfully/
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
describe "a failed launch" do
|
134
|
+
it "shows an error" do
|
135
|
+
get :consume_launch, params: { nonce: 'invalid' }
|
136
|
+
expect(response.body).to be =~ /not launched successfully/
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
describe "configure.xml" do
|
142
|
+
it "succeeds" do
|
143
|
+
get :configure, format: :xml
|
144
|
+
expect(response).to be_successful
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
3
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
|
+
|
5
|
+
require File.expand_path('../config/application', __FILE__)
|
6
|
+
|
7
|
+
Dummy::Application.load_tasks
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
Bundler.require(:default, Rails.env)
|
6
|
+
require 'lti_provider'
|
7
|
+
|
8
|
+
module Dummy
|
9
|
+
class Application < Rails::Application
|
10
|
+
# Settings in config/environments/* take precedence over those specified here.
|
11
|
+
# Application configuration should go into files in config/initializers
|
12
|
+
# -- all .rb files in that directory are automatically loaded.
|
13
|
+
|
14
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
15
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
16
|
+
|
17
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
18
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
19
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
20
|
+
|
21
|
+
# Activate observers that should always be running.
|
22
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
23
|
+
|
24
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
25
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
26
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
27
|
+
|
28
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
29
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
30
|
+
# config.i18n.default_locale = :de
|
31
|
+
|
32
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
33
|
+
config.encoding = "utf-8"
|
34
|
+
|
35
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
36
|
+
config.filter_parameters += [:password]
|
37
|
+
|
38
|
+
# Enable escaping HTML in JSON.
|
39
|
+
config.active_support.escape_html_entities_in_json = true
|
40
|
+
|
41
|
+
# Use SQL instead of Active Record's schema dumper when creating the database.
|
42
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
43
|
+
# like if you have constraints or database-specific column types
|
44
|
+
# config.active_record.schema_format = :sql
|
45
|
+
|
46
|
+
config.active_record.sqlite3.represent_boolean_as_integer = true
|
47
|
+
|
48
|
+
# Enable the asset pipeline
|
49
|
+
config.assets.enabled = true
|
50
|
+
|
51
|
+
# Version of your assets, change this if you want to expire all your assets
|
52
|
+
config.assets.version = '1.0'
|
53
|
+
|
54
|
+
# true is the default, setting this explicitly to avoid deprecation warnings
|
55
|
+
config.i18n.enforce_available_locales = true
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%
|
2
|
+
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
3
|
+
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
4
|
+
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
|
5
|
+
%>
|
6
|
+
default: <%= std_opts %> features
|
7
|
+
wip: --tags @wip:3 --wip features
|
8
|
+
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
development:
|
7
|
+
adapter: sqlite3
|
8
|
+
database: db/development.sqlite3
|
9
|
+
pool: 5
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
# Warning: The database defined as "test" will be erased and
|
13
|
+
# re-generated from your development database when you run "rake".
|
14
|
+
# Do not set this db to the same as development or production.
|
15
|
+
test:
|
16
|
+
adapter: sqlite3
|
17
|
+
database: db/test.sqlite3
|
18
|
+
pool: 5
|
19
|
+
timeout: 5000
|
20
|
+
|
21
|
+
production:
|
22
|
+
adapter: sqlite3
|
23
|
+
database: db/production.sqlite3
|
24
|
+
pool: 5
|
25
|
+
timeout: 5000
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
config.eager_load = false
|
10
|
+
|
11
|
+
# Show full error reports and disable caching
|
12
|
+
config.consider_all_requests_local = true
|
13
|
+
config.action_controller.perform_caching = false
|
14
|
+
|
15
|
+
# Don't care if the mailer can't send
|
16
|
+
config.action_mailer.raise_delivery_errors = false
|
17
|
+
|
18
|
+
# Print deprecation notices to the Rails logger
|
19
|
+
config.active_support.deprecation = :log
|
20
|
+
|
21
|
+
# Only use best-standards-support built into browsers
|
22
|
+
config.action_dispatch.best_standards_support = :builtin
|
23
|
+
|
24
|
+
# Do not compress assets
|
25
|
+
config.assets.compress = false
|
26
|
+
|
27
|
+
# Expands the lines which load the assets
|
28
|
+
config.assets.debug = true
|
29
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Full error reports are disabled and caching is turned on
|
8
|
+
config.consider_all_requests_local = false
|
9
|
+
config.action_controller.perform_caching = true
|
10
|
+
|
11
|
+
# Disable Rails's static asset server (Apache or nginx will already do this)
|
12
|
+
config.serve_static_assets = false
|
13
|
+
|
14
|
+
# Compress JavaScripts and CSS
|
15
|
+
config.assets.compress = true
|
16
|
+
|
17
|
+
# Don't fallback to assets pipeline if a precompiled asset is missed
|
18
|
+
config.assets.compile = false
|
19
|
+
|
20
|
+
# Generate digests for assets URLs
|
21
|
+
config.assets.digest = true
|
22
|
+
|
23
|
+
# Defaults to nil and saved in location specified by config.assets.prefix
|
24
|
+
# config.assets.manifest = YOUR_PATH
|
25
|
+
|
26
|
+
# Specifies the header that your server uses for sending files
|
27
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
28
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
29
|
+
|
30
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
31
|
+
# config.force_ssl = true
|
32
|
+
|
33
|
+
# See everything in the log (default is :info)
|
34
|
+
# config.log_level = :debug
|
35
|
+
|
36
|
+
# Prepend all log lines with the following tags
|
37
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
38
|
+
|
39
|
+
# Use a different logger for distributed setups
|
40
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
41
|
+
|
42
|
+
# Use a different cache store in production
|
43
|
+
# config.cache_store = :mem_cache_store
|
44
|
+
|
45
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
46
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
47
|
+
|
48
|
+
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
49
|
+
# config.assets.precompile += %w( search.js )
|
50
|
+
|
51
|
+
# Disable delivery errors, bad email addresses will be ignored
|
52
|
+
# config.action_mailer.raise_delivery_errors = false
|
53
|
+
|
54
|
+
# Enable threaded mode
|
55
|
+
# config.threadsafe!
|
56
|
+
|
57
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
58
|
+
# the I18n.default_locale when a translation can not be found)
|
59
|
+
config.i18n.fallbacks = true
|
60
|
+
|
61
|
+
# Send deprecation notices to registered listeners
|
62
|
+
config.active_support.deprecation = :notify
|
63
|
+
|
64
|
+
config.eager_load = true
|
65
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Configure static asset server for tests with Cache-Control for performance
|
11
|
+
config.serve_static_assets = true
|
12
|
+
config.static_cache_control = "public, max-age=3600"
|
13
|
+
|
14
|
+
config.eager_load = false
|
15
|
+
|
16
|
+
# Show full error reports and disable caching
|
17
|
+
config.consider_all_requests_local = true
|
18
|
+
config.action_controller.perform_caching = false
|
19
|
+
|
20
|
+
# Raise exceptions instead of rendering exception templates
|
21
|
+
config.action_dispatch.show_exceptions = false
|
22
|
+
|
23
|
+
# Disable request forgery protection in test environment
|
24
|
+
config.action_controller.allow_forgery_protection = false
|
25
|
+
|
26
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
27
|
+
# The :test delivery method accumulates sent emails in the
|
28
|
+
# ActionMailer::Base.deliveries array.
|
29
|
+
config.action_mailer.delivery_method = :test
|
30
|
+
|
31
|
+
# Print deprecation notices to the stderr
|
32
|
+
config.active_support.deprecation = :stderr
|
33
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
11
|
+
#
|
12
|
+
# These inflection rules are supported but not enabled by default:
|
13
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
14
|
+
# inflect.acronym 'RESTful'
|
15
|
+
# end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
Dummy::Application.config.secret_key_base = '2a505b354d477f5afeb132e5fa73bd13d118cf0a5b0faa3f7f14dc1dcb6c518d5d0a01ad8dd8c9ea3f46052723fc0a7ef04d22e80bd52109986458d64fe372c5'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
|
4
|
+
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
6
|
+
# which shouldn't be used to store highly confidential information
|
7
|
+
# (create the session table with "rails generate session_migration")
|
8
|
+
# Dummy::Application.config.session_store :active_record_store
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
#
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json]
|
9
|
+
end
|
10
|
+
|
11
|
+
# Disable root element in JSON by default.
|
12
|
+
ActiveSupport.on_load(:active_record) do
|
13
|
+
self.include_root_in_json = false
|
14
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
default: &default
|
2
|
+
tool_title: 'Dummy App'
|
3
|
+
tool_description: 'A very handy dummy application for testing LtiProvider engine integration.'
|
4
|
+
tool_id: 'dummy'
|
5
|
+
privacy_level: 'public'
|
6
|
+
account_navigation:
|
7
|
+
text: 'Dummy'
|
8
|
+
visibility: 'admins'
|
9
|
+
course_navigation:
|
10
|
+
text: 'Dummy'
|
11
|
+
visibility: 'admins'
|
12
|
+
url: 'http://override.example.com/launch'
|
13
|
+
environments:
|
14
|
+
test_domain: 'text.example.com'
|
15
|
+
beta_domain: 'beta.example.com'
|
16
|
+
|
17
|
+
development:
|
18
|
+
<<: *default
|
19
|
+
|
20
|
+
test:
|
21
|
+
<<: *default
|
22
|
+
|
23
|
+
cucumber:
|
24
|
+
<<: *default
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from lti_provider (originally 20130319050003)
|
2
|
+
class CreateLtiProviderLaunches < ActiveRecord::Migration[4.2]
|
3
|
+
def change
|
4
|
+
create_table "lti_provider_launches", :force => true do |t|
|
5
|
+
t.string "canvas_url"
|
6
|
+
t.string "nonce"
|
7
|
+
t.text "provider_params"
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended to check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(:version => 20130319050206) do
|
15
|
+
|
16
|
+
create_table "lti_provider_launches", :force => true do |t|
|
17
|
+
t.string "canvas_url"
|
18
|
+
t.string "nonce"
|
19
|
+
t.text "provider_params"
|
20
|
+
t.datetime "created_at", :null => false
|
21
|
+
t.datetime "updated_at", :null => false
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>LTI (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist. - LTI</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>LTI (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected. - LTI</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>LTI (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong. - LTI</h1>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
File without changes
|