You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Jean-Philippe Steinmetz (JIRA)" <ji...@apache.org> on 2010/03/14 06:33:27 UTC

[jira] Created: (HTTPCLIENT-926) Add Amazon S3 authentication support

Add Amazon S3 authentication support
------------------------------------

                 Key: HTTPCLIENT-926
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-926
             Project: HttpComponents HttpClient
          Issue Type: New Feature
          Components: HttpClient
            Reporter: Jean-Philippe Steinmetz


Add support for the the Amazon S3 authentication scheme as defined by the online document: http://docs.amazonwebservices.com/AmazonS3/latest/index.html?RESTAuthentication.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Resolved: (HTTPCLIENT-926) Add Amazon S3 authentication support

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCLIENT-926.
------------------------------------------

    Resolution: Fixed

Jean-Philippe

I committed the code you contributed to the SVN repository. I made some minor changes to the exception handling code and also had to remove @author tags. Please review.

http://svn.apache.org/viewvc?rev=934160&view=rev

Many thanks for this contribution

Oleg

> Add Amazon S3 authentication support
> ------------------------------------
>
>                 Key: HTTPCLIENT-926
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-926
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: Contrib
>            Reporter: Jean-Philippe Steinmetz
>             Fix For: 4.1 Alpha2
>
>         Attachments: AWSScheme.java, AWSSchemeFactory.java
>
>
> Add support for the the Amazon S3 authentication scheme as defined by the online document: http://docs.amazonwebservices.com/AmazonS3/latest/index.html?RESTAuthentication.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-926) Add Amazon S3 authentication support

Posted by "Jean-Philippe Steinmetz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12857221#action_12857221 ] 

Jean-Philippe Steinmetz commented on HTTPCLIENT-926:
----------------------------------------------------

Hi Asankha

Thanks for the feedback. I've found a similar issues with the code that I had to use some workarounds for. I'm continuing to investigate this and will take your considerations into account. I also discovered an issue with some S3 based servers required the Content-MD5 header to be set. I will be submitting an update to the code that hopefully addresses your issue plus the Content-MD5 issue.

Cheers,
Jean-Philippe

> Add Amazon S3 authentication support
> ------------------------------------
>
>                 Key: HTTPCLIENT-926
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-926
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: Contrib
>            Reporter: Jean-Philippe Steinmetz
>             Fix For: 4.1 Alpha2
>
>         Attachments: AWSScheme.java, AWSSchemeFactory.java
>
>
> Add support for the the Amazon S3 authentication scheme as defined by the online document: http://docs.amazonwebservices.com/AmazonS3/latest/index.html?RESTAuthentication.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-926) Add Amazon S3 authentication support

Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12857200#action_12857200 ] 

Asankha C. Perera commented on HTTPCLIENT-926:
----------------------------------------------

Hi Jean-Philippe

I was testing this and noticed that the Base64.encodeBase64String() inserts a CRLF even when the size is much less than 76 characters.. and thus causes problems (a connection reset from Amazon for a GET request in my test)

// base64-encode the hmac
result = Base64.encodeBase64String(rawHmac);

A simple replace as follows fixes this issue, but as I am not much familiar with the AWS/S3 API want to check this with you if this indeed is a simple oversight or if there could be other cases I am not aware of

// base64-encode the hmac
return Base64.encodeBase64URLSafeString(rawHmac);

cheers
asankha


> Add Amazon S3 authentication support
> ------------------------------------
>
>                 Key: HTTPCLIENT-926
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-926
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: Contrib
>            Reporter: Jean-Philippe Steinmetz
>             Fix For: 4.1 Alpha2
>
>         Attachments: AWSScheme.java, AWSSchemeFactory.java
>
>
> Add support for the the Amazon S3 authentication scheme as defined by the online document: http://docs.amazonwebservices.com/AmazonS3/latest/index.html?RESTAuthentication.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-926) Add Amazon S3 authentication support

Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12857204#action_12857204 ] 

Asankha C. Perera commented on HTTPCLIENT-926:
----------------------------------------------

Seems like my earlier comment was written in a hurry.. I still have issues and will get back with my findings :)

> Add Amazon S3 authentication support
> ------------------------------------
>
>                 Key: HTTPCLIENT-926
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-926
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: Contrib
>            Reporter: Jean-Philippe Steinmetz
>             Fix For: 4.1 Alpha2
>
>         Attachments: AWSScheme.java, AWSSchemeFactory.java
>
>
> Add support for the the Amazon S3 authentication scheme as defined by the online document: http://docs.amazonwebservices.com/AmazonS3/latest/index.html?RESTAuthentication.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Updated: (HTTPCLIENT-926) Add Amazon S3 authentication support

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski updated HTTPCLIENT-926:
-----------------------------------------

      Component/s:     (was: HttpClient)
                   Contrib
    Fix Version/s: 4.1 Alpha2

> Add Amazon S3 authentication support
> ------------------------------------
>
>                 Key: HTTPCLIENT-926
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-926
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: Contrib
>            Reporter: Jean-Philippe Steinmetz
>             Fix For: 4.1 Alpha2
>
>         Attachments: AWSScheme.java, AWSSchemeFactory.java
>
>
> Add support for the the Amazon S3 authentication scheme as defined by the online document: http://docs.amazonwebservices.com/AmazonS3/latest/index.html?RESTAuthentication.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Updated: (HTTPCLIENT-926) Add Amazon S3 authentication support

Posted by "Jean-Philippe Steinmetz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Philippe Steinmetz updated HTTPCLIENT-926:
-----------------------------------------------

    Attachment: AWSSchemeFactory.java
                AWSScheme.java

Implementation of Amazon's spec. Verified working against HttpClient 4.0 and 4.1.alpha1.

> Add Amazon S3 authentication support
> ------------------------------------
>
>                 Key: HTTPCLIENT-926
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-926
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpClient
>            Reporter: Jean-Philippe Steinmetz
>         Attachments: AWSScheme.java, AWSSchemeFactory.java
>
>
> Add support for the the Amazon S3 authentication scheme as defined by the online document: http://docs.amazonwebservices.com/AmazonS3/latest/index.html?RESTAuthentication.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-926) Add Amazon S3 authentication support

Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12857207#action_12857207 ] 

Asankha C. Perera commented on HTTPCLIENT-926:
----------------------------------------------

My earlier suggestion has been reporting a successful response, but with an error that the signature did not match which I did not notice .. 

A working solution is to just remove the trailing \r\n which otherwise can be interpreted as part of another [malformed] request. Since this is only at the end, this should not cause an issue - but if a \r\n indeed does occur within the header value due to some long signature etc, that could still cause problems..

For now, I've checked this into SVN

String headerValue = NAME + " " + credentials.getUserPrincipal().getName() + ":" + signature.trim();

cheers
asankha

> Add Amazon S3 authentication support
> ------------------------------------
>
>                 Key: HTTPCLIENT-926
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-926
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: Contrib
>            Reporter: Jean-Philippe Steinmetz
>             Fix For: 4.1 Alpha2
>
>         Attachments: AWSScheme.java, AWSSchemeFactory.java
>
>
> Add support for the the Amazon S3 authentication scheme as defined by the online document: http://docs.amazonwebservices.com/AmazonS3/latest/index.html?RESTAuthentication.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org