lti_skydrive 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +20 -0
  4. data/app/assets/fonts/skydrive/font/FontAwesome.otf +0 -0
  5. data/app/assets/fonts/skydrive/font/fontawesome-webfont.eot +0 -0
  6. data/app/assets/fonts/skydrive/font/fontawesome-webfont.svg +399 -0
  7. data/app/assets/fonts/skydrive/font/fontawesome-webfont.ttf +0 -0
  8. data/app/assets/fonts/skydrive/font/fontawesome-webfont.woff +0 -0
  9. data/app/assets/images/skydrive/banner.png +0 -0
  10. data/app/assets/images/skydrive/icon-file.png +0 -0
  11. data/app/assets/images/skydrive/icon-folder-back.png +0 -0
  12. data/app/assets/images/skydrive/icon-folder.png +0 -0
  13. data/app/assets/images/skydrive/icon-jpg.png +0 -0
  14. data/app/assets/images/skydrive/icon-pdf.png +0 -0
  15. data/app/assets/images/skydrive/icon-png.png +0 -0
  16. data/app/assets/images/skydrive/icon-word.png +0 -0
  17. data/app/assets/images/skydrive/logo.png +0 -0
  18. data/app/assets/images/skydrive/office_365.jpg +0 -0
  19. data/app/assets/images/skydrive/skydrive_icon.png +0 -0
  20. data/app/assets/javascripts/skydrive/application.js +16 -0
  21. data/app/assets/javascripts/skydrive/vendor/ember.js +23 -0
  22. data/app/assets/javascripts/skydrive/vendor/handlebars.js +362 -0
  23. data/app/assets/javascripts/skydrive/vendor/jquery.js +9597 -0
  24. data/app/assets/stylesheets/skydrive/app.css +5617 -0
  25. data/app/assets/stylesheets/skydrive/font-awesome/font-awesome.min.css +403 -0
  26. data/app/assets/stylesheets/skydrive/normalize.css +405 -0
  27. data/app/assets/stylesheets/skydrive/style.css +27 -0
  28. data/app/controllers/skydrive/api_keys_controller.rb +13 -0
  29. data/app/controllers/skydrive/application_controller.rb +40 -0
  30. data/app/controllers/skydrive/ember_controller.rb +23 -0
  31. data/app/controllers/skydrive/files_controller.rb +62 -0
  32. data/app/controllers/skydrive/launch_controller.rb +152 -0
  33. data/app/controllers/skydrive/session_controller.rb +12 -0
  34. data/app/controllers/skydrive/users_controller.rb +34 -0
  35. data/app/helpers/skydrive/application_helper.rb +4 -0
  36. data/app/helpers/skydrive/ember_helper.rb +4 -0
  37. data/app/models/skydrive/api_key.rb +47 -0
  38. data/app/models/skydrive/lti_key.rb +10 -0
  39. data/app/models/skydrive/token.rb +14 -0
  40. data/app/models/skydrive/user.rb +28 -0
  41. data/app/serializers/api_key_serializer.rb +5 -0
  42. data/app/serializers/user_serializer.rb +5 -0
  43. data/app/views/layouts/skydrive/application.html.erb +21 -0
  44. data/app/views/skydrive/ember/index.html.erb +20 -0
  45. data/config/initializers/sharepoint.rb +1 -0
  46. data/config/routes.rb +24 -0
  47. data/config/sharepoint.yml.example +17 -0
  48. data/db/migrate/20130710195807_create_users.rb +11 -0
  49. data/db/migrate/20130710195819_create_api_keys.rb +15 -0
  50. data/db/migrate/20130722173006_add_skydrive_token_storage.rb +15 -0
  51. data/db/migrate/20130725183724_add_client_domain_to_skydrive_tokens.rb +5 -0
  52. data/db/migrate/20130726170108_add_personal_url_to_skydrive_token.rb +5 -0
  53. data/db/migrate/20130730164700_add_init_params_to_api_key.rb +5 -0
  54. data/db/migrate/20130801181008_create_lti_keys.rb +9 -0
  55. data/db/migrate/20130802231147_change_skydrive_token_length.rb +6 -0
  56. data/db/migrate/20140103221052_skydrive_namespace.rb +13 -0
  57. data/lib/skydrive/client.rb +161 -0
  58. data/lib/skydrive/engine.rb +16 -0
  59. data/lib/skydrive/file.rb +49 -0
  60. data/lib/skydrive/folder.rb +13 -0
  61. data/lib/skydrive/version.rb +3 -0
  62. data/lib/skydrive.rb +4 -0
  63. data/lib/skydrive_proxy.rb +33 -0
  64. data/lib/tasks/ember.rake +48 -0
  65. data/lib/tasks/lti_key.rake +8 -0
  66. data/test/controllers/skydrive/ember_controller_test.rb +11 -0
  67. data/test/dummy/README.rdoc +28 -0
  68. data/test/dummy/Rakefile +6 -0
  69. data/test/dummy/app/assets/javascripts/application.js +13 -0
  70. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  71. data/test/dummy/app/controllers/application_controller.rb +5 -0
  72. data/test/dummy/app/helpers/application_helper.rb +2 -0
  73. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  74. data/test/dummy/bin/bundle +3 -0
  75. data/test/dummy/bin/rails +4 -0
  76. data/test/dummy/bin/rake +4 -0
  77. data/test/dummy/config/application.rb +25 -0
  78. data/test/dummy/config/boot.rb +5 -0
  79. data/test/dummy/config/database.yml +25 -0
  80. data/test/dummy/config/environment.rb +5 -0
  81. data/test/dummy/config/environments/development.rb +29 -0
  82. data/test/dummy/config/environments/production.rb +80 -0
  83. data/test/dummy/config/environments/test.rb +36 -0
  84. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  85. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  86. data/test/dummy/config/initializers/inflections.rb +16 -0
  87. data/test/dummy/config/initializers/mime_types.rb +5 -0
  88. data/test/dummy/config/initializers/secret_token.rb +12 -0
  89. data/test/dummy/config/initializers/session_store.rb +3 -0
  90. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  91. data/test/dummy/config/locales/en.yml +23 -0
  92. data/test/dummy/config/routes.rb +3 -0
  93. data/test/dummy/config/sharepoint.yml +15 -0
  94. data/test/dummy/config.ru +4 -0
  95. data/test/dummy/db/development.sqlite3 +0 -0
  96. data/test/dummy/db/schema.rb +60 -0
  97. data/test/dummy/db/test.sqlite3 +0 -0
  98. data/test/dummy/log/development.log +6484 -0
  99. data/test/dummy/log/test.log +2958 -0
  100. data/test/dummy/public/404.html +58 -0
  101. data/test/dummy/public/422.html +58 -0
  102. data/test/dummy/public/500.html +57 -0
  103. data/test/dummy/public/favicon.ico +0 -0
  104. data/test/dummy/tmp/cache/assets/development/sprockets/00546f7f6da41f471084ed2589ca4442 +0 -0
  105. data/test/dummy/tmp/cache/assets/development/sprockets/049dac97744466d4435aa8de57cc6099 +0 -0
  106. data/test/dummy/tmp/cache/assets/development/sprockets/0c92f67702b0dbd50edf7e6be63359ca +0 -0
  107. data/test/dummy/tmp/cache/assets/development/sprockets/0d26053221de21901f734bd6ba75bb28 +0 -0
  108. data/test/dummy/tmp/cache/assets/development/sprockets/0e383306a92ebd12d003a9e49ef6d508 +0 -0
  109. data/test/dummy/tmp/cache/assets/development/sprockets/16fa9bed5ef4abda841d3ef00e727580 +0 -0
  110. data/test/dummy/tmp/cache/assets/development/sprockets/17588b92c903e02837946f638eca86db +0 -0
  111. data/test/dummy/tmp/cache/assets/development/sprockets/21900b90dba7acf710178f3cd9dad43b +0 -0
  112. data/test/dummy/tmp/cache/assets/development/sprockets/25efc08f115a66b9c241a48e80a207ca +0 -0
  113. data/test/dummy/tmp/cache/assets/development/sprockets/3064fc29e24c9e97f7aad24f7e899cf6 +0 -0
  114. data/test/dummy/tmp/cache/assets/development/sprockets/311d9a5a43eb3fee9bba76971680620f +0 -0
  115. data/test/dummy/tmp/cache/assets/development/sprockets/35a147c1af5b608250e82ccb2f569d4b +0 -0
  116. data/test/dummy/tmp/cache/assets/development/sprockets/3dd0eb5a85d766c8d9fe5b29014edee4 +0 -0
  117. data/test/dummy/tmp/cache/assets/development/sprockets/63616bfc6c3f0267d5951cbbc83308cd +0 -0
  118. data/test/dummy/tmp/cache/assets/development/sprockets/65aa42ce50eac6f72e31861670f94518 +0 -0
  119. data/test/dummy/tmp/cache/assets/development/sprockets/66a8e9d3d86505dece06e6dd0edd18e1 +0 -0
  120. data/test/dummy/tmp/cache/assets/development/sprockets/78c4cbc0498be843f50ebdd02e2ead2f +0 -0
  121. data/test/dummy/tmp/cache/assets/development/sprockets/7caeca69c3c375c50a3c8cad8584be79 +0 -0
  122. data/test/dummy/tmp/cache/assets/development/sprockets/7d2b5e5332f464f65bf745d12ed9cbaa +0 -0
  123. data/test/dummy/tmp/cache/assets/development/sprockets/7e229ef6d57ba0e9f562cc129a3e4dfc +0 -0
  124. data/test/dummy/tmp/cache/assets/development/sprockets/87149d8992d83d7a95023dbfa4b53907 +0 -0
  125. data/test/dummy/tmp/cache/assets/development/sprockets/8bf6a6b96f5c827206f1fd42babe6c5e +0 -0
  126. data/test/dummy/tmp/cache/assets/development/sprockets/8c2066f7cc911ab8803cab8fea4e8bd6 +0 -0
  127. data/test/dummy/tmp/cache/assets/development/sprockets/9157ff048f219d7abc8b0f0fda771c92 +0 -0
  128. data/test/dummy/tmp/cache/assets/development/sprockets/a17c28776c4a2887f0fff4893854ef1d +0 -0
  129. data/test/dummy/tmp/cache/assets/development/sprockets/a29fed21bbc3985a31325c84a77e5f26 +0 -0
  130. data/test/dummy/tmp/cache/assets/development/sprockets/a3119da5b51c1a0a3c5cb7414ec920f5 +0 -0
  131. data/test/dummy/tmp/cache/assets/development/sprockets/a674526f54bc8458ebe36912ef85f003 +0 -0
  132. data/test/dummy/tmp/cache/assets/development/sprockets/aa904c0cc06f37bb0df493db59f18d70 +0 -0
  133. data/test/dummy/tmp/cache/assets/development/sprockets/adfa454123f4741a4b3919023b570d82 +0 -0
  134. data/test/dummy/tmp/cache/assets/development/sprockets/af6eedeceb4b732776dca83f456b2b93 +0 -0
  135. data/test/dummy/tmp/cache/assets/development/sprockets/b40cb2ddb88705f771e77d872feacf6a +0 -0
  136. data/test/dummy/tmp/cache/assets/development/sprockets/bf64c92410e28e00afb6139c5d4c61b9 +0 -0
  137. data/test/dummy/tmp/cache/assets/development/sprockets/dc6268ee4fa18069ce7c21888ea1932e +0 -0
  138. data/test/dummy/tmp/cache/assets/development/sprockets/df9900b8557146382d16cc592306b17f +0 -0
  139. data/test/dummy/tmp/cache/assets/development/sprockets/e3caec07cb46343e49b4f060e2d3392a +0 -0
  140. data/test/dummy/tmp/cache/assets/development/sprockets/e6ebfb0e93a47d0164d0fc4637054c38 +0 -0
  141. data/test/dummy/tmp/cache/assets/development/sprockets/ecb48e7374f399434aedbf30716e489a +0 -0
  142. data/test/dummy/tmp/cache/assets/development/sprockets/eeb495bc326785d2a6a14cf6d97024e4 +0 -0
  143. data/test/dummy/tmp/cache/assets/development/sprockets/ef91e47e51f204a8373f160f13a05a30 +0 -0
  144. data/test/dummy/tmp/cache/assets/development/sprockets/f48290aae486ea863a9f456ba96443e9 +0 -0
  145. data/test/dummy/tmp/cache/assets/development/sprockets/fa078ac6abaaee94445294c5a7c6d793 +0 -0
  146. data/test/helpers/skydrive/ember_helper_test.rb +6 -0
  147. data/test/integration/navigation_test.rb +10 -0
  148. data/test/skydrive_test.rb +7 -0
  149. data/test/test_helper.rb +15 -0
  150. metadata +375 -0
@@ -0,0 +1,36 @@
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
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = "public, max-age=3600"
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Print deprecation notices to the stderr.
35
+ config.active_support.deprecation = :stderr
36
+ 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,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure your secret_key_base is kept private
11
+ # if you're sharing your code publicly.
12
+ Dummy::Application.config.secret_key_base = 'e5b3ea908abce0f8f00e313de72ff94345b074e30b4120a06bba04bcb0d48029db73ca838c7bddacb8c6a1f2fc2048f5fc50ab3d4c4c71c7cc50a5d369bf5d73'
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
@@ -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] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ mount Skydrive::Engine => "/skydrive"
3
+ end
@@ -0,0 +1,15 @@
1
+ defaults: &defaults
2
+ guid: 00000003-0000-0ff1-ce00-000000000000
3
+
4
+ development:
5
+ <<: *defaults
6
+ client_id: 85a3090e-e825-421d-8ac2-3b59225993b2
7
+ client_secret: 3t61a9B3K3kv2jaULkd3/rmUxtWZL7ieQcQc6+9eHXE=
8
+
9
+ test:
10
+ <<: *defaults
11
+ client_id: 85a3090e-e825-421d-8ac2-3b59225993b2
12
+ client_secret: 3t61a9B3K3kv2jaULkd3/rmUxtWZL7ieQcQc6+9eHXE=
13
+
14
+ production:
15
+ <<: *defaults
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
Binary file
@@ -0,0 +1,60 @@
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 that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20140103221052) do
15
+
16
+ create_table "skydrive_api_keys", force: true do |t|
17
+ t.integer "user_id"
18
+ t.string "access_token"
19
+ t.string "scope"
20
+ t.string "oauth_code"
21
+ t.datetime "expired_at"
22
+ t.datetime "created_at"
23
+ t.text "init_params"
24
+ end
25
+
26
+ add_index "skydrive_api_keys", ["access_token"], name: "index_skydrive_api_keys_on_access_token"
27
+ add_index "skydrive_api_keys", ["oauth_code"], name: "index_skydrive_api_keys_on_oauth_code"
28
+ add_index "skydrive_api_keys", ["user_id"], name: "index_skydrive_api_keys_on_user_id"
29
+
30
+ create_table "skydrive_lti_keys", force: true do |t|
31
+ t.string "key"
32
+ t.string "secret"
33
+ end
34
+
35
+ add_index "skydrive_lti_keys", ["key"], name: "index_skydrive_lti_keys_on_key"
36
+
37
+ create_table "skydrive_tokens", force: true do |t|
38
+ t.integer "user_id"
39
+ t.string "token_type"
40
+ t.text "access_token", limit: 255
41
+ t.integer "expires_in"
42
+ t.text "refresh_token", limit: 255
43
+ t.datetime "not_before"
44
+ t.datetime "expires_on"
45
+ t.string "resource"
46
+ t.string "client_domain"
47
+ t.string "personal_url"
48
+ end
49
+
50
+ add_index "skydrive_tokens", ["user_id"], name: "index_skydrive_tokens_on_user_id"
51
+
52
+ create_table "skydrive_users", force: true do |t|
53
+ t.string "name"
54
+ t.string "username"
55
+ t.string "email"
56
+ t.datetime "created_at"
57
+ t.datetime "updated_at"
58
+ end
59
+
60
+ end
Binary file