aws-s3
aws-s3 copied to clipboard
"Invalid group: uri" while setting :authenticated_read
trafficstars
My object was private and I wanted to grant the READ permission to authenticated users:
policy = S3Object.acl(name, bucket)
policy.grants << ACL::Grant.grant(:authenticated_read)
# persist it:
S3Object.acl(name, bucket, policy) # BOOM! doesn't work
The exception is from the server: "Invalid group uri". This is what it was trying to send (for the offending grant):
<Grantee xsi:type="Group" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<URI>http://acs.amazonaws.com/groups/global/Authenticated</URI>
</Grantee>
I think it Amazon choked because it wanted this URI instead:
http://acs.amazonaws.com/groups/global/AuthenticatedUsers