Changeset 1748
- Timestamp:
- 08/19/08 13:38:59 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
hive/trunk/data_webapp/lib/worker_bee_authorization.rb
r1747 r1748 15 15 16 16 17 # Used in the :before_filter of the BeeController 18 # Check the request is properly signed 17 19 def verify_signed_request 18 render : text => "Not Allowed", :status => 403 unless @@configuration["activate"]20 render :json => ["Not Allowed"], :status => 403 unless @@configuration["activate"] 19 21 20 22 unless valid_signed_request? 21 render :json => {"Unauthorized","Invalid Signature"}, :status => 40123 render :json => ["Unauthorized"], :status => 401 22 24 end 23 25 end 24 26 27 # Verify the incoming request 25 28 def valid_signed_request? 26 29 auth_headers = request.headers["Authorization"] … … 42 45 end 43 46 47 # Sign the request 44 48 def sign_request(sk,method,path,date,content_type) 45 49 data = [method,path,date,content_type].join("\n")
