Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MalformedACLError when using the PutBucketAcl method. #917

Closed
ejcx opened this issue Oct 31, 2016 · 3 comments
Closed

MalformedACLError when using the PutBucketAcl method. #917

ejcx opened this issue Oct 31, 2016 · 3 comments

Comments

@ejcx
Copy link

ejcx commented Oct 31, 2016

Here is my code.

   var allGrants []*s3.Grant

    for _, permission := range bucketSettings.Permissions {
      permission.Grantee.Type = aws.String("Canonical User")
      allGrants = append(allGrants, &s3.Grant{
        Grantee:    &permission.Grantee,
        Permission: &permission.Permission,
      })
    }
    permissions, err := svc.PutBucketAcl(&s3.PutBucketAclInput{
      Bucket: &bucketName,
      AccessControlPolicy: &s3.AccessControlPolicy{
        Owner:  bucketSettings.Owner,
        Grants: allGrants,
      },
    })

Canonical User is assigned as a workaround to #916 . Owner, and Grants are all grants the exact objects returned from GetBucketAcl. I have not not modified them at all...

@xibz
Copy link
Contributor

xibz commented Oct 31, 2016

Hello @ejcx, thank you for reaching out to us.Canonical User should be CanonicalUser. If you have any additional questions, please reach out to us.

@ejcx
Copy link
Author

ejcx commented Oct 31, 2016

WOW! I just tried it and that worked. Ridiculous.

Are there any docs that show this?

@xibz
Copy link
Contributor

xibz commented Oct 31, 2016

@ejcx - Yes, you can find it in the service's docs under constants. The Grantee is a enum that is named Type. So, if you search for that, you should find it. I'll go ahead and close this. If you have any additional questions, please reach out to us.

@xibz xibz closed this as completed Oct 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants