Permalink
Browse files

Initial implementation

  • Loading branch information...
yury committed Jun 26, 2012
0 parents commit 5fa2838a956b3686a82cc134bd8172f10fa369b8
Showing with 2,760 additions and 0 deletions.
  1. +7 −0 .gitignore
  2. +2 −0 .rspec
  3. +17 −0 Gemfile
  4. +136 −0 Gemfile.lock
  5. +20 −0 MIT-LICENSE
  6. +3 −0 README.md
  7. +24 −0 Rakefile
  8. +183 −0 app/controllers/oauth/access_tokens_controller.rb
  9. +7 −0 app/controllers/oauth/accesses_controller.rb
  10. +84 −0 app/controllers/oauth/authorizations_controller.rb
  11. +24 −0 app/controllers/oauth/clients_controller.rb
  12. +24 −0 app/helpers/devise/oauth/helpers.rb
  13. +19 −0 app/models/oauth/access.rb
  14. +61 −0 app/models/oauth/access_token.rb
  15. +58 −0 app/models/oauth/authorization.rb
  16. +49 −0 app/models/oauth/client.rb
  17. +34 −0 app/views/devise/oauth/authorizations/show.html.erb
  18. +14 −0 config/routes.rb
  19. +76 −0 db/migrate/20120622164619_devise_create_oauth.rb
  20. +24 −0 devise_oauth.gemspec
  21. +9 −0 lib/devise/models/access_token_authenticatable.rb
  22. +14 −0 lib/devise/models/client_ownable.rb
  23. +36 −0 lib/devise/models/resource_ownable.rb
  24. +27 −0 lib/devise/oauth/blockable.rb
  25. +18 −0 lib/devise/oauth/engine.rb
  26. +43 −0 lib/devise/oauth/scopable.rb
  27. +5 −0 lib/devise/oauth/version.rb
  28. +67 −0 lib/devise/strategies/access_token_authenticatable.rb
  29. +52 −0 lib/devise_oauth.rb
  30. +4 −0 lib/tasks/devise_oauth_tasks.rake
  31. +8 −0 script/rails
  32. +208 −0 spec/controllers/access_tokens_controller_spec.rb
  33. +53 −0 spec/controllers/authorizations_controller_spec.rb
  34. +69 −0 spec/controllers/protected_resources_controller_spec.rb
  35. +261 −0 spec/dummy/README.rdoc
  36. +7 −0 spec/dummy/Rakefile
  37. +15 −0 spec/dummy/app/assets/javascripts/application.js
  38. +13 −0 spec/dummy/app/assets/stylesheets/application.css
  39. +7 −0 spec/dummy/app/controllers/application_controller.rb
  40. +14 −0 spec/dummy/app/controllers/protected_resources_controller.rb
  41. +2 −0 spec/dummy/app/helpers/application_helper.rb
  42. 0 spec/dummy/app/mailers/.gitkeep
  43. 0 spec/dummy/app/models/.gitkeep
  44. +15 −0 spec/dummy/app/models/ability.rb
  45. +13 −0 spec/dummy/app/models/user.rb
  46. +14 −0 spec/dummy/app/views/layouts/application.html.erb
  47. +4 −0 spec/dummy/config.ru
  48. +67 −0 spec/dummy/config/application.rb
  49. +10 −0 spec/dummy/config/boot.rb
  50. +25 −0 spec/dummy/config/database.yml
  51. +5 −0 spec/dummy/config/environment.rb
  52. +37 −0 spec/dummy/config/environments/development.rb
  53. +67 −0 spec/dummy/config/environments/production.rb
  54. +37 −0 spec/dummy/config/environments/test.rb
  55. +7 −0 spec/dummy/config/initializers/backtrace_silencers.rb
  56. +216 −0 spec/dummy/config/initializers/devise.rb
  57. +15 −0 spec/dummy/config/initializers/inflections.rb
  58. +5 −0 spec/dummy/config/initializers/mime_types.rb
  59. +7 −0 spec/dummy/config/initializers/secret_token.rb
  60. +8 −0 spec/dummy/config/initializers/session_store.rb
  61. +14 −0 spec/dummy/config/initializers/wrap_parameters.rb
  62. +57 −0 spec/dummy/config/locales/devise.en.yml
  63. +5 −0 spec/dummy/config/locales/en.yml
  64. +7 −0 spec/dummy/config/routes.rb
  65. +46 −0 spec/dummy/db/migrate/20120622183848_devise_create_users.rb
  66. +34 −0 spec/dummy/db/schema.rb
  67. 0 spec/dummy/lib/assets/.gitkeep
  68. 0 spec/dummy/log/.gitkeep
  69. +26 −0 spec/dummy/public/404.html
  70. +26 −0 spec/dummy/public/422.html
  71. +25 −0 spec/dummy/public/500.html
  72. 0 spec/dummy/public/favicon.ico
  73. +6 −0 spec/dummy/script/rails
  74. +34 −0 spec/factories.rb
  75. +25 −0 spec/models/oauth/access_token_spec.rb
  76. +19 −0 spec/models/oauth/authorization_spec.rb
  77. +31 −0 spec/models/oauth/client_spec.rb
  78. +10 −0 spec/models/user_spec.rb
  79. +39 −0 spec/spec_helper.rb
  80. +6 −0 spec/support/match_json.rb
@@ -0,0 +1,7 @@
+.bundle/
+log/*.log
+pkg/
+spec/dummy/db/*.sqlite3
+spec/dummy/log/*.log
+spec/dummy/tmp/
+spec/dummy/.sass-cache
2 .rspec
@@ -0,0 +1,2 @@
+--color
+--format progress
17 Gemfile
@@ -0,0 +1,17 @@
+source 'http://rubygems.org'
+
+# Declare your gem's dependencies in devise_oauth.gemspec.
+# Bundler will treat runtime dependencies like base dependencies, and
+# development dependencies will be added by default to the :development group.
+gemspec
+
+# jquery-rails is used by the dummy application
+gem 'jquery-rails'
+gem 'devise'
+
+gem 'database_cleaner'
+gem 'factory_girl_rails'
+gem 'rspec-rails', '>= 2.0'
+gem 'shoulda-matchers'
+
+gem 'cancan'
@@ -0,0 +1,136 @@
+PATH
+ remote: .
+ specs:
+ devise_oauth (2.0.0)
+ devise (>= 2.1)
+ rails (>= 3.2.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (3.2.6)
+ actionpack (= 3.2.6)
+ mail (~> 2.4.4)
+ actionpack (3.2.6)
+ activemodel (= 3.2.6)
+ activesupport (= 3.2.6)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.1)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.3)
+ activemodel (3.2.6)
+ activesupport (= 3.2.6)
+ builder (~> 3.0.0)
+ activerecord (3.2.6)
+ activemodel (= 3.2.6)
+ activesupport (= 3.2.6)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.6)
+ activemodel (= 3.2.6)
+ activesupport (= 3.2.6)
+ activesupport (3.2.6)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ bcrypt-ruby (3.0.1)
+ builder (3.0.0)
+ cancan (1.6.7)
+ database_cleaner (0.8.0)
+ devise (2.1.0)
+ bcrypt-ruby (~> 3.0)
+ orm_adapter (~> 0.0.7)
+ railties (~> 3.1)
+ warden (~> 1.1.1)
+ diff-lcs (1.1.3)
+ erubis (2.7.0)
+ factory_girl (3.4.0)
+ activesupport (>= 3.0.0)
+ factory_girl_rails (3.4.0)
+ factory_girl (~> 3.4.0)
+ railties (>= 3.0.0)
+ hike (1.2.1)
+ i18n (0.6.0)
+ journey (1.0.4)
+ jquery-rails (2.0.2)
+ railties (>= 3.2.0, < 5.0)
+ thor (~> 0.14)
+ json (1.7.3)
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.19)
+ multi_json (1.3.6)
+ orm_adapter (0.0.7)
+ polyglot (0.3.3)
+ rack (1.4.1)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.2.6)
+ actionmailer (= 3.2.6)
+ actionpack (= 3.2.6)
+ activerecord (= 3.2.6)
+ activeresource (= 3.2.6)
+ activesupport (= 3.2.6)
+ bundler (~> 1.0)
+ railties (= 3.2.6)
+ railties (3.2.6)
+ actionpack (= 3.2.6)
+ activesupport (= 3.2.6)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (>= 0.14.6, < 2.0)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ rspec (2.10.0)
+ rspec-core (~> 2.10.0)
+ rspec-expectations (~> 2.10.0)
+ rspec-mocks (~> 2.10.0)
+ rspec-core (2.10.1)
+ rspec-expectations (2.10.0)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.10.1)
+ rspec-rails (2.10.1)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ railties (>= 3.0)
+ rspec (~> 2.10.0)
+ shoulda-matchers (1.2.0)
+ activesupport (>= 3.0.0)
+ sprockets (2.1.3)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.6)
+ thor (0.15.3)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.33)
+ warden (1.1.1)
+ rack (>= 1.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ cancan
+ database_cleaner
+ devise
+ devise_oauth!
+ factory_girl_rails
+ jquery-rails
+ rspec-rails (>= 2.0)
+ shoulda-matchers
+ sqlite3
@@ -0,0 +1,20 @@
+Copyright 2012 Yury Korolev
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,3 @@
+# Devise::Oauth
+
+This project rocks and uses MIT-LICENSE.
@@ -0,0 +1,24 @@
+#!/usr/bin/env rake
+begin
+ require 'bundler/setup'
+rescue LoadError
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
+end
+begin
+ require 'rdoc/task'
+rescue LoadError
+ require 'rdoc/rdoc'
+ require 'rake/rdoctask'
+ RDoc::Task = Rake::RDocTask
+end
+
+RDoc::Task.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'Devise::Oauth'
+ rdoc.options << '--line-numbers'
+ rdoc.rdoc_files.include('README.rdoc')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
+Bundler::GemHelper.install_tasks
+
Oops, something went wrong.

0 comments on commit 5fa2838

Please sign in to comment.