Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1042

S3BlobStore.putBlob() makes a call to get ACL which maybe blocked by S3 policy, resulting in failure of the operation.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.1
    • Fix Version/s: 2.0.0
    • Component/s: jclouds-blobstore
    • Labels:

      Description

      A user may be prevented by S3 bucket policy from getting ACL, but can still have rights to do put/get/delete. Currently the code below fails to do put when there's an exception getting ACL.

      public String putBlob(String container, Blob blob, PutOptions overrides) {
            if (overrides.isMultipart()) {
               // need to use a provider if the strategy object is stateful
               return multipartUploadStrategy.get().execute(container, blob);
            }
      
            // TODO: Make use of options overrides
            PutObjectOptions options = new PutObjectOptions();
            try {
               AccessControlList acl = bucketAcls.getUnchecked(container);
               if (acl != null && acl.hasPermission(GroupGranteeURI.ALL_USERS, Permission.READ))
                  options.withAcl(CannedAccessPolicy.PUBLIC_READ);
            } catch (CacheLoader.InvalidCacheLoadException e) {
               // nulls not permitted from cache loader
            }
            return sync.putObject(container, blob2Object.apply(blob), options);
         }
      

        Attachments

          Activity

            People

            • Assignee:
              gaul Andrew Gaul
              Reporter:
              igor.alekseev@yahoo.com Igor Alekseev
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: