Browse files

remove doorkeeper stuff

  • Loading branch information...
1 parent 9a14490 commit 47a4866df84fe158e8cdf6f69e49f0c1659e9edc @cjstewart88 committed Jan 18, 2013
View
1 Gemfile
@@ -4,7 +4,6 @@ gem 'rails', '3.2'
gem 'activesupport'
gem 'pg'
gem 'devise'
-gem 'doorkeeper', '~> 0.6.7'
gem 'activerecord-import'
gem 'acts-as-taggable-on'
gem 'acts_as_follower'
View
3 Gemfile.lock
@@ -50,8 +50,6 @@ GEM
railties (~> 3.1)
warden (~> 1.2.1)
diff-lcs (1.1.3)
- doorkeeper (0.6.7)
- railties (~> 3.1)
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
@@ -141,7 +139,6 @@ DEPENDENCIES
acts_as_follower
compass-rails
devise
- doorkeeper (~> 0.6.7)
jquery-rails (= 1.0.12)
pg
rails (= 3.2)
View
2 app/controllers/api_controller.rb
@@ -1,6 +1,4 @@
class ApiController < ApplicationController
- doorkeeper_for :user_info
-
before_filter :validate_user_id, :except => :library
def library
View
3 app/controllers/application_controller.rb
@@ -44,6 +44,7 @@ def ensure_domain
end
def check_current_user
- current_user = User.find(doorkeeper_token.resource_owner_id) if doorkeeper_token
+ # set
+ # current_user = User.find() if params[:auth_token]
end
end
View
2 app/controllers/events_controller.rb
@@ -39,8 +39,6 @@
# }
class EventsController < ApplicationController
- doorkeeper_for :create, :if => lambda { !user_signed_in? }
-
before_filter :validate_current_user
def create
View
8 app/controllers/playlists_controller.rb
@@ -1,6 +1,4 @@
class PlaylistsController < ApplicationController
- doorkeeper_for :create, :delete_video, :destroy, :update, :if => lambda { !user_signed_in? }
-
def listen
@user = User.where(:username => params[:username]).first
@username = params[:username]
@@ -114,10 +112,4 @@ def get
render :json => response
end
-
- private
-
- def verify_user
- user_signed_in?
- end
end
View
22 app/views/devise/registrations/new.html.erb
@@ -1,40 +1,40 @@
<section class="remove-when-searching">
- <h2>Register</h2>
-
+ <h2>Sign Up</h2>
+
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :autocomplete => :off }) do |f| %>
<div id="left-col">
<div>
<%= f.label :username %>
<%= "<span class='error'>#{resource.errors[:username][0]}</span>".html_safe if resource.errors[:username][0] %><br />
- <%= f.text_field :username %>
-
+ <%= f.text_field :username %>
+
</div>
-
+
<div>
<%= f.label :email %>
<%= "<span class='error'>#{resource.errors[:email][0]}</span>".html_safe if resource.errors[:email][0] %><br />
- <%= f.email_field :email %>
+ <%= f.email_field :email %>
</div>
<div>
<%= f.label :password %>
<%= "<span class='error'>#{resource.errors[:password][0]}</span>".html_safe if resource.errors[:password][0] %><br />
- <%= f.password_field :password %>
+ <%= f.password_field :password %>
</div>
<div>
<%= f.label :password_confirmation %>
<%= "<span class='error'>#{resource.errors[:password_confirmation][0]}</span>".html_safe if resource.errors[:password_confirmation][0] %><br />
- <%= f.password_field :password_confirmation %>
+ <%= f.password_field :password_confirmation %>
</div>
-
+
<div><%= f.submit "Sign up" %></div>
</div>
<div id="right-col">
<div class="why-register">
- <h3>Wondering why you should register?</h3>
-
+ <h3>Wondering why you should sign up?</h3>
+
<ol>
<li>Create custom playlists, much like Spotify or other music apps.</li>
<li>Ban annoying videos from ever playing again!</li>
View
64 config/initializers/doorkeeper.rb
@@ -1,64 +0,0 @@
-Doorkeeper.configure do
- # Change the ORM that doorkeeper will use.
- # Currently supported options are :active_record, :mongoid2, :mongoid3, :mongo_mapper
- orm :active_record
-
- # This block will be called to check whether the resource owner is authenticated or not.
- resource_owner_authenticator do
- current_user || warden.authenticate!(:scope => :user)
- end
-
- # If you want to restrict access to the web interface for adding oauth authorized applications, you need to declare the block below.
- admin_authenticator do
- # Put your admin authentication logic here.
- # Example implementation:
- user_signed_in? && current_user.id == 1
- end
-
- # Authorization Code expiration time (default 10 minutes).
- # authorization_code_expires_in 10.minutes
-
- # Access token expiration time (default 2 hours).
- # If you want to disable expiration, set this to nil.
- # access_token_expires_in 2.hours
-
- # Issue access tokens with refresh token (disabled by default)
- # use_refresh_token
-
- # Provide support for an owner to be assigned to each registered application (disabled by default)
- # Optional parameter :confirmation => true (default false) if you want to enforce ownership of
- # a registered application
- # Note: you must also run the rails g doorkeeper:application_owner generator to provide the necessary support
- # enable_application_owner :confirmation => false
-
- # Define access token scopes for your provider
- # For more information go to https://github.com/applicake/doorkeeper/wiki/Using-Scopes
- # default_scopes :public
- # optional_scopes :write, :update
-
- # Change the way client credentials are retrieved from the request object.
- # By default it retrieves first from the `HTTP_AUTHORIZATION` header, then
- # falls back to the `:client_id` and `:client_secret` params from the `params` object.
- # Check out the wiki for more information on customization
- # client_credentials :from_basic, :from_params
-
- # Change the way access token is authenticated from the request object.
- # By default it retrieves first from the `HTTP_AUTHORIZATION` header, then
- # falls back to the `:access_token` or `:bearer_token` params from the `params` object.
- # Check out the wiki for mor information on customization
- # access_token_methods :from_bearer_authorization, :from_access_token_param, :from_bearer_param
-
- # Change the test redirect uri for client apps
- # When clients register with the following redirect uri, they won't be redirected to any server and the authorization code will be displayed within the provider
- # The value can be any string. Use nil to disable this feature. When disabled, clients must provide a valid URL
- # (Similar behaviour: https://developers.google.com/accounts/docs/OAuth2InstalledApp#choosingredirecturi)
- #
- # test_redirect_uri 'urn:ietf:wg:oauth:2.0:oob'
-
- # Under some circumstances you might want to have applications auto-approved,
- # so that the user skips the authorization step.
- # For example if dealing with trusted a application.
- # skip_authorization do |resource_owner, client|
- # client.superapp? or resource_owner.admin?
- # end
-end
View
68 config/locales/doorkeeper.en.yml
@@ -1,68 +0,0 @@
-en:
- activerecord:
- errors:
- models:
- application:
- attributes:
- redirect_uri:
- fragment_present: 'cannot contain a fragment.'
- has_query_parameter: 'cannot contain a query parameter.'
- invalid_uri: 'must be a valid URI.'
- relative_uri: 'must be an absolute URI.'
- mongoid:
- errors:
- models:
- application:
- attributes:
- redirect_uri:
- fragment_present: 'cannot contain a fragment.'
- has_query_parameter: 'cannot contain a query parameter.'
- invalid_uri: 'must be a valid URI.'
- relative_uri: 'must be an absolute URI.'
- mongo_mapper:
- errors:
- models:
- application:
- attributes:
- redirect_uri:
- fragment_present: 'cannot contain a fragment.'
- has_query_parameter: 'cannot contain a query parameter.'
- invalid_uri: 'must be a valid URI.'
- relative_uri: 'must be an absolute URI.'
- doorkeeper:
- errors:
- messages:
- # Common error messages
- invalid_request: 'The request is missing a required parameter, includes an unsupported parameter value, or is otherwise malformed.'
- invalid_redirect_uri: 'The redirect uri included is not valid.'
- unauthorized_client: 'The client is not authorized to perform this request using this method.'
- access_denied: 'The resource owner or authorization server denied the request.'
- invalid_scope: 'The requested scope is invalid, unknown, or malformed.'
- server_error: 'The authorization server encountered an unexpected condition which prevented it from fulfilling the request.'
- temporarily_unavailable: 'The authorization server is currently unable to handle the request due to a temporary overloading or maintenance of the server.'
-
- #configuration error messages
- credential_flow_not_configured: 'Resource Owner Password Credentials flow failed due to Doorkeeper.configure.resource_owner_from_credentials being unconfigured.'
- resource_owner_authenticator_not_configured: 'Resource Owner find failed due to Doorkeeper.configure.resource_owner_authenticator being unconfiged.'
-
- # Access grant errors
- unsupported_response_type: 'The authorization server does not support this response type.'
-
- # Access token errors
- invalid_client: 'Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.'
- invalid_grant: 'The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.'
- unsupported_grant_type: 'The authorization grant type is not supported by the authorization server.'
-
- # Password Access token errors
- invalid_resource_owner: 'The provided resource owner credentials are not valid, or resource owner cannot be found'
- flash:
- applications:
- create:
- notice: 'Application created.'
- destroy:
- notice: 'Application deleted.'
- update:
- notice: 'Application updated.'
- authorized_applications:
- destroy:
- notice: 'Application revoked.'
View
2 config/routes.rb
@@ -1,6 +1,4 @@
Tubalr::Application.routes.draw do
- use_doorkeeper
-
devise_for :users, :controllers => { :registrations => "registrations" }
devise_scope :user do
get "/users/sign_out" => "devise/sessions#destroy"
View
42 db/migrate/20130118005633_create_doorkeeper_tables.rb
@@ -1,42 +0,0 @@
-class CreateDoorkeeperTables < ActiveRecord::Migration
- def change
- create_table :oauth_applications do |t|
- t.string :name, :null => false
- t.string :uid, :null => false
- t.string :secret, :null => false
- t.string :redirect_uri, :null => false
- t.timestamps
- end
-
- add_index :oauth_applications, :uid, :unique => true
-
- create_table :oauth_access_grants do |t|
- t.integer :resource_owner_id, :null => false
- t.integer :application_id, :null => false
- t.string :token, :null => false
- t.integer :expires_in, :null => false
- t.string :redirect_uri, :null => false
- t.datetime :created_at, :null => false
- t.datetime :revoked_at
- t.string :scopes
- end
-
- add_index :oauth_access_grants, :token, :unique => true
-
- create_table :oauth_access_tokens do |t|
- t.integer :resource_owner_id
- t.integer :application_id, :null => false
- t.string :token, :null => false
- t.string :refresh_token
- t.integer :expires_in
- t.datetime :revoked_at
- t.datetime :created_at, :null => false
- t.string :scopes
- end
-
- add_index :oauth_access_tokens, :token, :unique => true
- add_index :oauth_access_tokens, :resource_owner_id
- add_index :oauth_access_tokens, :refresh_token, :unique => true
-
- end
-end
View
41 db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20130118005633) do
+ActiveRecord::Schema.define(:version => 20130108043259) do
create_table "banned_videos", :force => true do |t|
t.integer "user_id"
@@ -45,45 +45,6 @@
add_index "follows", ["followable_id", "followable_type"], :name => "fk_followables"
add_index "follows", ["follower_id", "follower_type"], :name => "fk_follows"
- create_table "oauth_access_grants", :force => true do |t|
- t.integer "resource_owner_id", :null => false
- t.integer "application_id", :null => false
- t.string "token", :null => false
- t.integer "expires_in", :null => false
- t.string "redirect_uri", :null => false
- t.datetime "created_at", :null => false
- t.datetime "revoked_at"
- t.string "scopes"
- end
-
- add_index "oauth_access_grants", ["token"], :name => "index_oauth_access_grants_on_token", :unique => true
-
- create_table "oauth_access_tokens", :force => true do |t|
- t.integer "resource_owner_id"
- t.integer "application_id", :null => false
- t.string "token", :null => false
- t.string "refresh_token"
- t.integer "expires_in"
- t.datetime "revoked_at"
- t.datetime "created_at", :null => false
- t.string "scopes"
- end
-
- add_index "oauth_access_tokens", ["refresh_token"], :name => "index_oauth_access_tokens_on_refresh_token", :unique => true
- add_index "oauth_access_tokens", ["resource_owner_id"], :name => "index_oauth_access_tokens_on_resource_owner_id"
- add_index "oauth_access_tokens", ["token"], :name => "index_oauth_access_tokens_on_token", :unique => true
-
- create_table "oauth_applications", :force => true do |t|
- t.string "name", :null => false
- t.string "uid", :null => false
- t.string "secret", :null => false
- t.string "redirect_uri", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "oauth_applications", ["uid"], :name => "index_oauth_applications_on_uid", :unique => true
-
create_table "playlists", :force => true do |t|
t.string "playlist_name"
t.integer "user_id"

0 comments on commit 47a4866

Please sign in to comment.