Permalink
Browse files

remove dependency on as of yet unmerged gemcutter authorization for w…

…ebhook feature: laserlemon/gemcutter@b05382e
  • Loading branch information...
1 parent be3fab4 commit 4429026fa4e08c0768bfb67580ee7dcdf132e93c @maxjustus maxjustus committed Mar 30, 2011
Showing with 2 additions and 10 deletions.
  1. +1 −1 config/application.example.yml
  2. +1 −9 gemwhisperer.rb
@@ -2,4 +2,4 @@ CONSUMER_KEY: YOUR_CONSUMER_KEY
CONSUMER_SECRET: YOUR_CONSUMER_SECRET
REQUEST_TOKEN: YOUR_REQUEST_TOKEN
REQUEST_SECRET: YOUR_REQUEST_SECRET
-RUBYGEMS_API_KEY: YOUR_RUBYGEMS_API_KEY
+SECRET_ENDPOINT_URL: YOUR_SECRET_ENDPOINT_URL
View
@@ -48,21 +48,13 @@ class Whisper < ActiveRecord::Base
erb :index
end
-post '/hook' do
+post "/#{ENV['SECRET_ENDPOINT_URL']}" do
data = request.body.read
Log.info "got webhook: #{data}"
hash = JSON.parse(data)
Log.info "parsed json: #{hash.inspect}"
- authorization = Digest::SHA2.hexdigest(hash['name'] + hash['version'] + ENV['RUBYGEMS_API_KEY'])
- if headers['Authorization'] == authorization
- Log.info "authorized: #{headers['Authorization']}"
- else
- Log.info "unauthorized: #{headers['Authorization']}"
- error 401
- end
-
whisper = Whisper.create(
:name => hash['name'],
:version => hash['version'],

0 comments on commit 4429026

Please sign in to comment.