jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCLOUDS-1042) S3BlobStore.putBlob() makes a call to get ACL which maybe blocked by S3 policy, resulting in failure of the operation.
Date Sat, 19 Dec 2015 07:29:46 GMT

    [ https://issues.apache.org/jira/browse/JCLOUDS-1042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15065283#comment-15065283
] 

ASF subversion and git services commented on JCLOUDS-1042:
----------------------------------------------------------

Commit a7c66d5120bd8ee8d64459a0a5504bfffa4cbece in jclouds's branch refs/heads/master from
[~gaul]
[ https://git-wip-us.apache.org/repos/asf?p=jclouds.git;h=a7c66d5 ]

JCLOUDS-1042: Test reading from public container

Blob has default access but container is public-read.


> S3BlobStore.putBlob() makes a call to get ACL which maybe blocked by S3 policy, resulting
in failure of the operation.
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: JCLOUDS-1042
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1042
>             Project: jclouds
>          Issue Type: Bug
>    Affects Versions: 1.9.1
>            Reporter: Igor Alekseev
>             Fix For: 1.9.1
>
>
> 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.
> {code:java}
> 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);
>    }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message