Restlet already supports AWS authentication from the client perspective.
Check out org.restlet.data.ChallengeResponse and
org.restlet.data.Request.setChallengeResponse to see the mechanisms for
accomplishing this. As for actually manipulating a Request's headers,
they are set by adding calling Request.getAttributes().put() with the
key equal to com.noelios.restlet.http.HttpConstants. ATTRIBUTE_HEADERS
with the value as an instance org.restlet.data.Form containing all of
the headers and their values.

 

________________________________

From: Guy Ernest [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 18, 2007 11:44 AM
To: [email protected]
Subject: Using Restlet to interact with Amazon SQS

 

I noticed that you have excellent examples about using Amazon S3 with
Restlet, I was wondering if SQS can have the same treatment. I would
prefer to use it with the REST interface and not the heavy SOAP/WSDL.

The following instruction are from the REST section of the SQS
documentation of Amazon AWS: 

About the Authorization Header
The authorization header is a string that follows this format:
AWS <AWSAccessKeyId>:<Signature>
Note that there is a space after "AWS".
To calculate the value for <Signature>: 
1. Create a string with the format:
HTTP-METHOD>\n<content-MD5>\n<ContentType>\n<date>\n<path>
For example:
PUT\n\ntext/plain\nThu, 01 Jun 2006 12:12:23 PDT\n/
2. Use your AWS Secret Access Key to create an HMAC-SHA1 hash of the
string and use that as the 
value of <Signature>.

Since I'm newbie in using Restlet, I will appreciate if someone can help
in explaining:
1. how to create such a header
2. how to add this header along side other headers (AWS-Version, for
example) 

Reply via email to