Revert "Switch to using oauth-plugin as a gem"

This reverts commit 41a123334b.
This commit is contained in:
Tom Hughes 2010-06-07 16:01:04 +01:00
parent fa11baf5c3
commit 406b46e49b
50 changed files with 2521 additions and 28 deletions

View file

@ -6,16 +6,6 @@ class ClientApplication < ActiveRecord::Base
validates_uniqueness_of :key
before_validation_on_create :generate_keys
def self.find_token(token_key)
token = OauthToken.find_by_token(token_key, :include => :client_application)
if token && token.authorized?
logger.info "Loaded #{token.token} which was authorized by (user_id=#{token.user_id}) on the #{token.authorized_at}"
token
else
nil
end
end
def self.verify_request(request, options = {}, &block)
begin
signature = OAuth::Signature.build(request, options, &block)

View file

@ -5,6 +5,16 @@ class OauthToken < ActiveRecord::Base
validates_presence_of :client_application, :token, :secret
before_validation_on_create :generate_keys
def self.find_token(token_key)
token = OauthToken.find_by_token(token_key, :include => :client_application)
if token && token.authorized?
logger.info "Loaded #{token.token} which was authorized by (user_id=#{token.user_id}) on the #{token.authorized_at}"
token
else
nil
end
end
def invalidated?
invalidated_at != nil
end