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

Add bucket policy functions #51

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

petergillardmoss
Copy link

Added get-bucket-policy and update-bucket-policy.

Externally the policy is a clojure data structure. The AWS sdk wants a json structure as a string so the new s3 functions hide this implementation by converting between cli and json.

@weavejester
Copy link
Owner

I wonder if we should prefer Cheshire over data.json. Thoughts?

@petergillardmoss
Copy link
Author

No problems with Cheshire.

Updated to use.

@weavejester
Copy link
Owner

What keys are allowed in update-bucket-policy? The docstring doesn't say.

@petergillardmoss
Copy link
Author

That's rather a complex and open question!

Policies are quite complex data structures used by AWS represented in JSON. The BucketPolicy bean simply takes a string: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/model/BucketPolicy.html

As you can see the AWS SDK isn't very explicit about them. I guess that's because they are beasts. See the docs on policy documents here: http://docs.aws.amazon.com/AmazonS3/latest/dev/AccessPolicyLanguage.html

Policies are so complex most of the time people use the Policy Generator rather than hand craft them:
http://awspolicygen.s3.amazonaws.com/policygen.html

They are also subject to change as AWS sees fit.

More than happy to take guidance but I think documenting AWS policies would be thankless. Perhaps just a link to the AWS docs would suffice?

@weavejester
Copy link
Owner

Okay, that's reasonable. A link to the docs should be sufficient.

@petergillardmoss
Copy link
Author

I have updated with a link to the docs

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

Successfully merging this pull request may close these issues.

2 participants