You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by GitBox <gi...@apache.org> on 2019/08/27 08:21:41 UTC

[GitHub] [jclouds] roded commented on a change in pull request #43: JCLOUDS-1511: allow configuration of S3 to use V4 signatures

roded commented on a change in pull request #43: JCLOUDS-1511: allow configuration of S3 to use V4 signatures
URL: https://github.com/apache/jclouds/pull/43#discussion_r317951950
 
 

 ##########
 File path: apis/s3/src/main/java/org/jclouds/s3/config/S3HttpApiModule.java
 ##########
 @@ -183,8 +183,16 @@ protected void bindErrorHandlers() {
       bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(ParseS3ErrorFromXmlContent.class);
    }
 
-   protected void bindRequestSigner() {
-      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV2.class).in(Scopes.SINGLETON);
+   @Provides
+   @Singleton
+   protected void bindRequestSigner(@Named(Constants.PROPERTY_V4_REQUEST_SIGNATURES) boolean v4Signatures) {
+      Class<? extends RequestAuthorizeSignature> clazz;
+      if (v4Signatures) {
+         clazz = RequestAuthorizeSignatureV4.class;
+      } else {
+         clazz = RequestAuthorizeSignatureV2.class;
+      }
+      bind(RequestAuthorizeSignature.class).to(clazz).in(Scopes.SINGLETON);
 
 Review comment:
   Thanks for the review @nacx . You're right about the `bind` in a provider method - I have not run this yet. Will do so in a unit test.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services