lti_box_engine 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/lti_box_engine/box_oauth_controller.rb +4 -0
- data/app/models/lti_box_engine/lti_launch.rb +5 -0
- data/app/models/lti_box_engine/user.rb +22 -0
- data/config/initializers/box.rb +3 -0
- data/db/migrate/20140402222507_create_user.rb +9 -0
- data/lib/lti_box_engine/engine.rb +8 -0
- data/lib/lti_box_engine/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5b156050f3d43dd07b1a3b0991bb9e9bc3893cc
|
4
|
+
data.tar.gz: 675d50f7462549991286013a64171b5b03e78ece
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56a803d732a6dc991300059185eb080780c97dfe98fc61fa21ab2b46adadf169f093de9391feec4a4aff81f85228fc5efedfa838092be54458909453c53cde73
|
7
|
+
data.tar.gz: f8dd5f8e3dbe34982d08ab2a6dfe99cfdd0b621409d627b6ff391edca366e45ed7664dbb08abde353840b083ff9ada52392228c8117a4a9944b7cc5d2fb1226b
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module LtiBoxEngine
|
2
|
+
class User < ActiveRecord::Base
|
3
|
+
def box_oauth_authorize_url
|
4
|
+
self.update_attributes(box_oauth_state: SecureRandom.uuid)
|
5
|
+
URI::HTTPS.build(
|
6
|
+
host: 'www.box.com',
|
7
|
+
path: '/api/oauth2/authorize',
|
8
|
+
query: {
|
9
|
+
response_type: 'code',
|
10
|
+
client_id: BOX_CONFIG[:client_id],
|
11
|
+
redirect_uri: BOX_CONFIG[:redirect_uri],
|
12
|
+
state: self.box_oauth_state
|
13
|
+
}.to_query
|
14
|
+
).to_s
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.get_user_for_lti_launch(tp)
|
18
|
+
User.where(lti_id: tp.user_id, tool_consumer_instance_guid: tp.tool_consumer_instance_guid)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -5,5 +5,13 @@ module LtiBoxEngine
|
|
5
5
|
config.generators do |g|
|
6
6
|
g.test_framework :rspec
|
7
7
|
end
|
8
|
+
|
9
|
+
initializer :append_migrations do |app|
|
10
|
+
unless app.root.to_s == root.to_s
|
11
|
+
config.paths["db/migrate"].expanded.each do |expanded_path|
|
12
|
+
app.config.paths["db/migrate"] << expanded_path
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
8
16
|
end
|
9
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lti_box_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brad Humphrey
|
@@ -140,19 +140,23 @@ files:
|
|
140
140
|
- app/assets/javascripts/lti_box_engine/test.js
|
141
141
|
- app/assets/stylesheets/lti_box_engine/application.scss
|
142
142
|
- app/controllers/lti_box_engine/application_controller.rb
|
143
|
+
- app/controllers/lti_box_engine/box_oauth_controller.rb
|
143
144
|
- app/controllers/lti_box_engine/lti_controller.rb
|
144
145
|
- app/controllers/lti_box_engine/test_controller.rb
|
145
146
|
- app/helpers/lti_box_engine/application_helper.rb
|
146
147
|
- app/helpers/lti_box_engine/lti_helper.rb
|
147
148
|
- app/helpers/lti_box_engine/test_helper.rb
|
148
149
|
- app/models/lti_box_engine/lti_launch.rb
|
150
|
+
- app/models/lti_box_engine/user.rb
|
149
151
|
- app/views/layouts/lti_box_engine/application.html.erb
|
150
152
|
- app/views/lti_box_engine/lti/embed.html.erb
|
151
153
|
- app/views/lti_box_engine/lti/error.html.erb
|
152
154
|
- app/views/lti_box_engine/lti/index.html.erb
|
153
155
|
- app/views/lti_box_engine/test/backdoor.html.erb
|
156
|
+
- config/initializers/box.rb
|
154
157
|
- config/routes.rb
|
155
158
|
- db/migrate/20140401155717_create_lti_box_engine_lti_launches.rb
|
159
|
+
- db/migrate/20140402222507_create_user.rb
|
156
160
|
- lib/lti_box_engine.rb
|
157
161
|
- lib/lti_box_engine/client.rb
|
158
162
|
- lib/lti_box_engine/engine.rb
|
@@ -183,4 +187,3 @@ signing_key:
|
|
183
187
|
specification_version: 4
|
184
188
|
summary: Box.net LTI Application
|
185
189
|
test_files: []
|
186
|
-
has_rdoc:
|