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

Set ACL with put/file (S3) #52

Open
MicahElliott opened this issue Oct 30, 2015 · 2 comments
Open

Set ACL with put/file (S3) #52

MicahElliott opened this issue Oct 30, 2015 · 2 comments

Comments

@MicahElliott
Copy link

The AWS CLI has a cp command that makes it very convenient to set an ACL. A very common usage is: aws s3 --acl=public-read cp foo.txt s3://mybucket.example.com/bar/foo.txt

I see you've provided a put-acl function, but it's hard to figure out what a valid x-expression would be to use with it. The output from get-acl is pretty big, so do you have to replicate such an xexpr to use with put-acl?

It seems it would be very convenient for put/file to take a keyword argument like put/file b+p p #:acl "public-read".

@greghendershott
Copy link
Owner

Your link is to doc for the old PLaneT package, so first I want to make sure you know that's out of date. Instead see the new package and its doc.


I see you've provided a put-acl function, but it's hard to figure out what a valid x-expression would be to use with it. The output from get-acl is pretty big, so do you have to replicate such an xexpr to use with put-acl?

I agree it's not convenient.

My doc links to the AWS doc explaining their XML for ACLs. My assumption was this would be the most comprehensive (and future-proof) way to support S3 ACLs -- just pass the XML back and forth as xexprs.

And in all honesty, it saved me from having to fully learn about S3 ACLs to the point where I could figure out a more Rackety abstraction in which to wrap them. I figured it would be worse if I attempted that but got it wrong, vs. leaving it up to users for whom ACLs are important.

It seems it would be very convenient for put/file to take a keyword argument like put/file b+p p #:acl "public-read".

I agree that would be more convenient.


My use of S3 is limited these days. Even when I used S3 more heavily, it was mostly buckets with the default access. So I don't have any hands-on with S3 ACLs. I also don't have an opinion about how to make the 80% case more convenient, while still allowing the 20% case. (I'm not even sure what the 80% case is, although I imagine it includes "public read".)

TL;DR: I think it would be wiser for something like this to be a pull request from someone for whom this is important?

@mflatt
Copy link
Contributor

mflatt commented Jan 12, 2016

@MicahElliott In case you still care, with put/bytes, you can supply a canned ACL as a 'x-amz-acl header. Maybe put/file should accept extra headers, too.
Pull request #53 adds an extra-headers argument to put-acl, so that it can be used like (put-acl <object> #f (hash 'x-amz-acl "public-read"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants