Skip to content

Commit

Permalink
Switch to Signature gem for authentication signature generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
benpickles committed May 12, 2010
1 parent f4d07de commit eda77b3
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 321 deletions.
1 change: 1 addition & 0 deletions Rakefile
Expand Up @@ -14,6 +14,7 @@ begin
gem.add_dependency "json"
gem.add_dependency "crack"
gem.add_dependency "ruby-hmac"
gem.add_dependency 'signature'
gem.add_development_dependency "rspec", ">= 1.2.9"
gem.add_development_dependency "webmock"
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
Expand Down
3 changes: 1 addition & 2 deletions lib/pusher.rb
Expand Up @@ -18,7 +18,7 @@ def logger
end

def authentication_token
Authentication::Token.new(@key, @secret)
Signature::Token.new(@key, @secret)
end
end

Expand All @@ -36,4 +36,3 @@ def self.[](channel_name)
end

require 'pusher/channel'
require 'pusher/authentication'
142 changes: 0 additions & 142 deletions lib/pusher/authentication.rb

This file was deleted.

3 changes: 2 additions & 1 deletion lib/pusher/channel.rb
@@ -1,4 +1,5 @@
require 'crack/core_extensions' # Used for Hash#to_params
require 'signature'
require 'digest/md5'

require 'json'
Expand Down Expand Up @@ -99,7 +100,7 @@ def construct_request(event_name, data, socket_id)
end
params[:body_md5] = Digest::MD5.hexdigest(body)

request = Authentication::Request.new('POST', @uri.path, params)
request = Signature::Request.new('POST', @uri.path, params)
auth_hash = request.sign(Pusher.authentication_token)

query_params = params.merge(auth_hash)
Expand Down
176 changes: 0 additions & 176 deletions spec/authentication_spec.rb

This file was deleted.

0 comments on commit eda77b3

Please sign in to comment.