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 2021/11/10 07:42:28 UTC

[GitHub] [jclouds] jiffysrc opened a new pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

jiffysrc opened a new pull request #125:
URL: https://github.com/apache/jclouds/pull/125


   https://issues.apache.org/jira/browse/JCLOUDS-1587
   
   Support following features in jclouds s3 blobstore
   
   Configure the bucket for versioning and get the versioning state of a bucket
   Confiure the bucket for encryption and get the encryption state of a bucket
   Confiure the bucket for lifecycle rules and get the lifecycle rules of a bucket
   Fetch an object using specific versionId
   List different versions of an Object


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] jiffysrc commented on a change in pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
jiffysrc commented on a change in pull request #125:
URL: https://github.com/apache/jclouds/pull/125#discussion_r780900083



##########
File path: apis/s3/src/main/java/org/jclouds/s3/config/S3HttpApiModule.java
##########
@@ -184,7 +184,7 @@ protected void bindErrorHandlers() {
    }
 
    protected void bindRequestSigner() {
-      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV2.class).in(Scopes.SINGLETON);
+      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV4.class).in(Scopes.SINGLETON);

Review comment:
       Hi @nacx 
   Could you please provide feedback on above approach,
   
   @gaul 
    Will you be completing the remaining change on this PR/move code around.
   




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] gaul commented on a change in pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
gaul commented on a change in pull request #125:
URL: https://github.com/apache/jclouds/pull/125#discussion_r781234023



##########
File path: apis/s3/src/main/java/org/jclouds/s3/config/S3HttpApiModule.java
##########
@@ -184,7 +184,7 @@ protected void bindErrorHandlers() {
    }
 
    protected void bindRequestSigner() {
-      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV2.class).in(Scopes.SINGLETON);
+      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV4.class).in(Scopes.SINGLETON);

Review comment:
       @nacx Thanks for the hint!
   
   @jiffysrc Please test this -- I only looked at the unit tests.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] jiffysrc commented on a change in pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
jiffysrc commented on a change in pull request #125:
URL: https://github.com/apache/jclouds/pull/125#discussion_r775464079



##########
File path: apis/s3/src/main/java/org/jclouds/s3/S3Client.java
##########
@@ -260,7 +264,7 @@ DeleteResult deleteObjects(@Bucket @EndpointParam(parser = AssignCorrectHostname
     * @return ETag of the content uploaded
     * @throws org.jclouds.http.HttpResponseException
     *            if the conditions requested set are not satisfied by the object on the server.
-    * @see org.jclouds.s3.domain.CannedAccessPolicy#PRIVATE
+    * @see CannedAccessPolicy#PRIVATE

Review comment:
       All the noise changes will be corrected with bucket configuration PR




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] jiffysrc commented on a change in pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
jiffysrc commented on a change in pull request #125:
URL: https://github.com/apache/jclouds/pull/125#discussion_r780900083



##########
File path: apis/s3/src/main/java/org/jclouds/s3/config/S3HttpApiModule.java
##########
@@ -184,7 +184,7 @@ protected void bindErrorHandlers() {
    }
 
    protected void bindRequestSigner() {
-      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV2.class).in(Scopes.SINGLETON);
+      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV4.class).in(Scopes.SINGLETON);

Review comment:
       Hi @nacx 
   Could you please provide feedback on above approach,
   
   @gaul 
    Will you be completing the remaining change on this PR/move code around.
    https://github.com/gaul/jclouds-1/pull/new/s3/signer
   




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] jiffysrc commented on a change in pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
jiffysrc commented on a change in pull request #125:
URL: https://github.com/apache/jclouds/pull/125#discussion_r783075639



##########
File path: apis/s3/src/main/java/org/jclouds/s3/config/S3HttpApiModule.java
##########
@@ -184,7 +184,7 @@ protected void bindErrorHandlers() {
    }
 
    protected void bindRequestSigner() {
-      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV2.class).in(Scopes.SINGLETON);
+      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV4.class).in(Scopes.SINGLETON);

Review comment:
       @gaul 
   Tested, This seems fine.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] jiffysrc commented on a change in pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
jiffysrc commented on a change in pull request #125:
URL: https://github.com/apache/jclouds/pull/125#discussion_r775463338



##########
File path: blobstore/src/main/java/org/jclouds/blobstore/options/ListContainerOptions.java
##########
@@ -231,6 +244,15 @@ public ListContainerOptions delimiter(String delimiterString) {
       return this;
    }
 
+   /**
+    * return a listing of all objects inside the store, recursively.
+    */
+   public ListContainerOptions versions() {
+      // checkArgument(path == null, "path and recursive combination currently not supported");

Review comment:
       Will be removed as part of bucket configuration PR




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] gaul commented on a change in pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
gaul commented on a change in pull request #125:
URL: https://github.com/apache/jclouds/pull/125#discussion_r776981746



##########
File path: apis/s3/src/main/java/org/jclouds/s3/config/S3HttpApiModule.java
##########
@@ -184,7 +184,7 @@ protected void bindErrorHandlers() {
    }
 
    protected void bindRequestSigner() {
-      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV2.class).in(Scopes.SINGLETON);
+      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV4.class).in(Scopes.SINGLETON);

Review comment:
       I think we should do something like this:
   
   https://github.com/gaul/jclouds-1/pull/new/s3/signer
   
   Note that this does not work and needs to move some code around.
   
   @nacx Does this seem like the correct approach?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] jiffysrc commented on pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
jiffysrc commented on pull request #125:
URL: https://github.com/apache/jclouds/pull/125#issuecomment-1011870469


   Raised Separate PR for Bucket Configuration Options, Hence closing this PR


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] jiffysrc closed pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
jiffysrc closed pull request #125:
URL: https://github.com/apache/jclouds/pull/125


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] jiffysrc commented on a change in pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
jiffysrc commented on a change in pull request #125:
URL: https://github.com/apache/jclouds/pull/125#discussion_r775462468



##########
File path: apis/s3/src/main/java/org/jclouds/s3/config/S3HttpApiModule.java
##########
@@ -184,7 +184,7 @@ protected void bindErrorHandlers() {
    }
 
    protected void bindRequestSigner() {
-      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV2.class).in(Scopes.SINGLETON);
+      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV4.class).in(Scopes.SINGLETON);

Review comment:
       Hi @gaul 
   We will be raising this change in separate PR as suggested.
   and could you please elaborate on how to document for older signer.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] gaul commented on a change in pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
gaul commented on a change in pull request #125:
URL: https://github.com/apache/jclouds/pull/125#discussion_r746509476



##########
File path: apis/s3/src/main/java/org/jclouds/s3/domain/internal/ListVersionsResponseImpl.java
##########
@@ -0,0 +1,208 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.s3.domain.internal;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import com.google.common.collect.Iterables;
+
+import org.jclouds.s3.domain.ListVersionsResponse;
+import org.jclouds.s3.domain.ObjectMetadata;
+
+public class ListVersionsResponseImpl extends LinkedHashSet<ObjectMetadata>
+    implements ListVersionsResponse {
+
+    protected final String name;
+    protected final String prefix;
+    protected final int maxKeys;
+    protected final String delimiter;
+    protected final String marker;
+    protected final String nextMarker;
+    protected final Set<String> commonPrefixes;
+    protected final boolean truncated;
+    protected final String nextVersionIdMarker;
+    protected final String versionIdMarker;
+
+    public ListVersionsResponseImpl(String name,
+                                    Iterable<ObjectMetadata> version,
+                                    String prefix, String marker,
+                                    String nextMarker, int maxKeys,
+                                    String delimiter, boolean truncated,
+                                    Set<String> commonPrefixes
+                                    ) {
+        Iterables.addAll(this, version);
+        this.name = name;
+        this.prefix = prefix;
+        this.maxKeys = maxKeys;
+        this.delimiter = delimiter;
+        this.marker = marker;
+        this.nextMarker = nextMarker;
+        this.commonPrefixes = commonPrefixes;
+        this.truncated = truncated;
+        this.nextVersionIdMarker = null;
+        this.versionIdMarker = null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Set<String> getCommonPrefixes() {
+        return commonPrefixes;
+    }
+
+    @Override
+    public String getNextVersionIdMarker() {
+        return null;
+    }
+
+    @Override
+    public String getVersionIdMarker() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getDelimiter() {
+        return delimiter;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getMarker() {
+        return marker;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getNextMarker() {
+        return nextMarker;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int getMaxKeys() {
+        return maxKeys;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getPrefix() {
+        return prefix;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean isTruncated() {
+        return truncated;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = super.hashCode();
+        result = prime * result +
+            ((commonPrefixes == null) ? 0 : commonPrefixes.hashCode());
+        result =
+            prime * result + ((delimiter == null) ? 0 : delimiter.hashCode());
+        result = prime * result + ((marker == null) ? 0 : marker.hashCode());
+        result = prime * result + maxKeys;
+        result = prime * result + ((name == null) ? 0 : name.hashCode());
+        result = prime * result + ((prefix == null) ? 0 : prefix.hashCode());
+        result = prime * result + (truncated ? 1231 : 1237);
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {

Review comment:
       Can you implement these in terms of `Objects.hash` and `Objects.equal` as below?

##########
File path: apis/s3/src/main/java/org/jclouds/s3/blobstore/S3BlobStore.java
##########
@@ -174,7 +189,12 @@ public void setContainerAccess(String container, ContainerAccess access) {
    @Override
    public PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options) {
       ListBucketOptions httpOptions = container2BucketListOptions.apply(options);
-      PageSet<? extends StorageMetadata> list = bucket2ResourceList.apply(sync.listBucket(container, httpOptions));
+      PageSet<? extends StorageMetadata> list = null;
+      if (httpOptions.getVersions()){

Review comment:
       This can throw `NullPointerException` when it return `null`.  Can you change the implementation of `getVersions` to return `false` when it is not specified?

##########
File path: apis/s3/src/main/java/org/jclouds/s3/config/S3HttpApiModule.java
##########
@@ -184,7 +184,7 @@ protected void bindErrorHandlers() {
    }
 
    protected void bindRequestSigner() {
-      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV2.class).in(Scopes.SINGLETON);
+      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV4.class).in(Scopes.SINGLETON);

Review comment:
       I am willing to entertain changing the default to V4 but this should at least be a separate change.  We also probably need to document how to easily use the older signer.

##########
File path: blobstore/src/main/java/org/jclouds/blobstore/options/ListContainerOptions.java
##########
@@ -231,6 +244,15 @@ public ListContainerOptions delimiter(String delimiterString) {
       return this;
    }
 
+   /**
+    * return a listing of all objects inside the store, recursively.
+    */
+   public ListContainerOptions versions() {
+      // checkArgument(path == null, "path and recursive combination currently not supported");

Review comment:
       commented out code

##########
File path: apis/s3/src/main/java/org/jclouds/s3/S3Client.java
##########
@@ -260,7 +264,7 @@ DeleteResult deleteObjects(@Bucket @EndpointParam(parser = AssignCorrectHostname
     * @return ETag of the content uploaded
     * @throws org.jclouds.http.HttpResponseException
     *            if the conditions requested set are not satisfied by the object on the server.
-    * @see org.jclouds.s3.domain.CannedAccessPolicy#PRIVATE
+    * @see CannedAccessPolicy#PRIVATE

Review comment:
       There are a lot of noise changes in this PR -- can you revert them?

##########
File path: blobstore/src/main/java/org/jclouds/blobstore/domain/internal/MutableStorageMetadataImpl.java
##########
@@ -93,6 +107,16 @@ public void setETag(String eTag) {
       this.eTag = eTag;
    }
 
+   @Override
+   public void setVersionId(String versionId) {
+      this.versionId = versionId;
+   }
+
+   @Override
+   public void setIsLatest(String isLatest) {
+   this.isLatest = isLatest;

Review comment:
       indentation

##########
File path: apis/s3/src/main/java/org/jclouds/s3/S3Client.java
##########
@@ -640,6 +651,30 @@ void enableBucketLogging(@Bucket @EndpointParam(parser = AssignCorrectHostnameFo
    void disableBucketLogging(@Bucket @EndpointParam(parser = AssignCorrectHostnameForBucket.class) @BinderParam(
                BindNoBucketLoggingToXmlPayload.class) @ParamValidators(BucketNameValidator.class) String bucketName);
 
+   @Named("GetBucketConfiguration")
+   @GET
+   @Path("/")
+   @ResponseParser(BucketConfigurationHandler.class)
+   String getBucketConfiguration(@Bucket @EndpointParam(parser = AssignCorrectHostnameForBucket.class) @BinderParam(
+       BindAsHostPrefixIfConfigured.class) @ParamValidators(BucketNameValidator.class) String bucketName,
+                                    BucketConfigOptions... options);
+
+   @Named("DeleteBucketConfiguration")
+   @DELETE
+   @Path("/")
+   @ResponseParser(BucketConfigurationHandler.class)
+   String deleteBucketConfiguration(@Bucket @EndpointParam(parser = AssignCorrectHostnameForBucket.class) @BinderParam(
+       BindAsHostPrefixIfConfigured.class) @ParamValidators(BucketNameValidator.class) String bucketName, BucketConfigOptions... options);
+
+   @Named("PutBucketConfiguration")
+   @PUT
+   @Path("/")
+   @ResponseParser(BucketConfigurationHandler.class)
+   String putBucketConfiguration(@Bucket @EndpointParam(parser = AssignCorrectHostnameForBucket.class) @BinderParam(

Review comment:
       Can you pull the bucket configuration into a separate PR with unit tests?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] jiffysrc commented on a change in pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
jiffysrc commented on a change in pull request #125:
URL: https://github.com/apache/jclouds/pull/125#discussion_r775462999



##########
File path: apis/s3/src/main/java/org/jclouds/s3/S3Client.java
##########
@@ -640,6 +651,30 @@ void enableBucketLogging(@Bucket @EndpointParam(parser = AssignCorrectHostnameFo
    void disableBucketLogging(@Bucket @EndpointParam(parser = AssignCorrectHostnameForBucket.class) @BinderParam(
                BindNoBucketLoggingToXmlPayload.class) @ParamValidators(BucketNameValidator.class) String bucketName);
 
+   @Named("GetBucketConfiguration")
+   @GET
+   @Path("/")
+   @ResponseParser(BucketConfigurationHandler.class)
+   String getBucketConfiguration(@Bucket @EndpointParam(parser = AssignCorrectHostnameForBucket.class) @BinderParam(
+       BindAsHostPrefixIfConfigured.class) @ParamValidators(BucketNameValidator.class) String bucketName,
+                                    BucketConfigOptions... options);
+
+   @Named("DeleteBucketConfiguration")
+   @DELETE
+   @Path("/")
+   @ResponseParser(BucketConfigurationHandler.class)
+   String deleteBucketConfiguration(@Bucket @EndpointParam(parser = AssignCorrectHostnameForBucket.class) @BinderParam(
+       BindAsHostPrefixIfConfigured.class) @ParamValidators(BucketNameValidator.class) String bucketName, BucketConfigOptions... options);
+
+   @Named("PutBucketConfiguration")
+   @PUT
+   @Path("/")
+   @ResponseParser(BucketConfigurationHandler.class)
+   String putBucketConfiguration(@Bucket @EndpointParam(parser = AssignCorrectHostnameForBucket.class) @BinderParam(

Review comment:
       Hi @gaul 
   Will be raising new PR for this change with unit tests, and other noise changes highlighted in above comments. 




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] jiffysrc commented on a change in pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
jiffysrc commented on a change in pull request #125:
URL: https://github.com/apache/jclouds/pull/125#discussion_r775464229



##########
File path: apis/s3/src/main/java/org/jclouds/s3/domain/internal/ListVersionsResponseImpl.java
##########
@@ -0,0 +1,208 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.s3.domain.internal;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import com.google.common.collect.Iterables;
+
+import org.jclouds.s3.domain.ListVersionsResponse;
+import org.jclouds.s3.domain.ObjectMetadata;
+
+public class ListVersionsResponseImpl extends LinkedHashSet<ObjectMetadata>
+    implements ListVersionsResponse {
+
+    protected final String name;
+    protected final String prefix;
+    protected final int maxKeys;
+    protected final String delimiter;
+    protected final String marker;
+    protected final String nextMarker;
+    protected final Set<String> commonPrefixes;
+    protected final boolean truncated;
+    protected final String nextVersionIdMarker;
+    protected final String versionIdMarker;
+
+    public ListVersionsResponseImpl(String name,
+                                    Iterable<ObjectMetadata> version,
+                                    String prefix, String marker,
+                                    String nextMarker, int maxKeys,
+                                    String delimiter, boolean truncated,
+                                    Set<String> commonPrefixes
+                                    ) {
+        Iterables.addAll(this, version);
+        this.name = name;
+        this.prefix = prefix;
+        this.maxKeys = maxKeys;
+        this.delimiter = delimiter;
+        this.marker = marker;
+        this.nextMarker = nextMarker;
+        this.commonPrefixes = commonPrefixes;
+        this.truncated = truncated;
+        this.nextVersionIdMarker = null;
+        this.versionIdMarker = null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Set<String> getCommonPrefixes() {
+        return commonPrefixes;
+    }
+
+    @Override
+    public String getNextVersionIdMarker() {
+        return null;
+    }
+
+    @Override
+    public String getVersionIdMarker() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getDelimiter() {
+        return delimiter;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getMarker() {
+        return marker;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getNextMarker() {
+        return nextMarker;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int getMaxKeys() {
+        return maxKeys;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getPrefix() {
+        return prefix;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean isTruncated() {
+        return truncated;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = super.hashCode();
+        result = prime * result +
+            ((commonPrefixes == null) ? 0 : commonPrefixes.hashCode());
+        result =
+            prime * result + ((delimiter == null) ? 0 : delimiter.hashCode());
+        result = prime * result + ((marker == null) ? 0 : marker.hashCode());
+        result = prime * result + maxKeys;
+        result = prime * result + ((name == null) ? 0 : name.hashCode());
+        result = prime * result + ((prefix == null) ? 0 : prefix.hashCode());
+        result = prime * result + (truncated ? 1231 : 1237);
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {

Review comment:
       Done as part of bucket configuration PR




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] jiffysrc edited a comment on pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
jiffysrc edited a comment on pull request #125:
URL: https://github.com/apache/jclouds/pull/125#issuecomment-1001529498


   Hi @gaul 
   We will divide the changes in this pr into 2 new separate PR's having,
   1 : bucket configuration changes , 
   2 : Changing to RequestAuthorizeSignatureV4
   
   and close this PR.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] nacx commented on a change in pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
nacx commented on a change in pull request #125:
URL: https://github.com/apache/jclouds/pull/125#discussion_r780968370



##########
File path: apis/s3/src/main/java/org/jclouds/s3/config/S3HttpApiModule.java
##########
@@ -184,7 +184,7 @@ protected void bindErrorHandlers() {
    }
 
    protected void bindRequestSigner() {
-      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV2.class).in(Scopes.SINGLETON);
+      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV4.class).in(Scopes.SINGLETON);

Review comment:
       The approach looks good @gaul. Probably the code moving needs to change to something [like this](https://github.com/apache/jclouds/blob/master/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/auth/config/AuthenticationModule.java#L61-L77). The selected lines are the ones that configure, in OpenStack, the version of the Keystone API to inject based on a property. A similar pattern could be used here.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [jclouds] gaul commented on a change in pull request #125: JCLOUDS-1587 S3 Blobstore: Support Bucket Configuration Options - Versioning, Lifecycle, Encryption

Posted by GitBox <gi...@apache.org>.
gaul commented on a change in pull request #125:
URL: https://github.com/apache/jclouds/pull/125#discussion_r781234023



##########
File path: apis/s3/src/main/java/org/jclouds/s3/config/S3HttpApiModule.java
##########
@@ -184,7 +184,7 @@ protected void bindErrorHandlers() {
    }
 
    protected void bindRequestSigner() {
-      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV2.class).in(Scopes.SINGLETON);
+      bind(RequestAuthorizeSignature.class).to(RequestAuthorizeSignatureV4.class).in(Scopes.SINGLETON);

Review comment:
       @nacx Thanks for the hint!
   
   @jiffysrc Please test #129 -- I only looked at the unit tests.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org