From 70aee6e9dfece2760fc6d616e7151f41cc7625bf Mon Sep 17 00:00:00 2001 From: mguetlein Date: Wed, 2 Feb 2011 17:11:24 +0100 Subject: resclient wrapper: headers <-> payload, error report from rdf --- lib/authorization.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/authorization.rb') diff --git a/lib/authorization.rb b/lib/authorization.rb index b4c1ee5..dd7dc12 100644 --- a/lib/authorization.rb +++ b/lib/authorization.rb @@ -195,7 +195,7 @@ module OpenTox # resource = RestClient::Resource.new("#{AA_SERVER}/Pol/opensso-pol") LOGGER.debug "OpenTox::Authorization.create_policy policy: #{policy[168,43]} with token:" + subjectid.to_s + " length: " + subjectid.length.to_s # return true if resource.post(policy, :subjectid => subjectid, :content_type => "application/xml") - return true if RestClientWrapper.post("#{AA_SERVER}/pol", {:subjectid => subjectid, :content_type => "application/xml"}, policy) + return true if RestClientWrapper.post("#{AA_SERVER}/pol", policy, {:subjectid => subjectid, :content_type => "application/xml"}) rescue return false end @@ -381,4 +381,9 @@ module OpenTox end end +# PENDING delete as soon as new free uri handling is merged +# this allows GET access to all URIS that do NOT end with / or // +OpenTox::Authorization.whitelist( /\/[0-9]+(\/?)$/, "GET", true ) +OpenTox::Authorization.whitelist( /\/[0-9]+(\/?)$/, "POST", true ) + -- cgit v1.2.3