Skip to content

Commit

Permalink
removed redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
Xylakant committed Jul 16, 2011
1 parent 75b4aa5 commit 759d7f2
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions lib/strategies/hmac_strategy.rb
Expand Up @@ -21,6 +21,7 @@ def signature_valid?
hmac.check_url_signature(request.url, secret)
end


def auth_info
params[auth_param] || {}
end
Expand All @@ -36,28 +37,7 @@ def nonce
def request_timestamp
auth_info["date"] || ""
end

def request_method
env['REQUEST_METHOD'].upcase
end

def params
request.GET
end

def headers
pairs = env.select {|k,v| k.start_with? 'HTTP_'}
.collect {|pair| [pair[0].sub(/^HTTP_/, '').gsub(/_/, '-'), pair[1]]}
.sort
headers = Hash[*pairs.flatten]
headers
end

def retrieve_user
true
end



end

Warden::Strategies.add(:hmac, Warden::Strategies::HMAC)

0 comments on commit 759d7f2

Please sign in to comment.