Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…ebhook feature: laserlemon/gemcutter@b05382e
  • Loading branch information...
commit 4429026fa4e08c0768bfb67580ee7dcdf132e93c 1 parent be3fab4
@maxjustus maxjustus authored
Showing with 2 additions and 10 deletions.
  1. +1 −1  config/application.example.yml
  2. +1 −9 gemwhisperer.rb
View
2  config/application.example.yml
@@ -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
10 gemwhisperer.rb
@@ -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'],
Please sign in to comment.
Something went wrong with that request. Please try again.