This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-22
Channels
- # announcements (2)
- # asami (123)
- # aws (17)
- # babashka (77)
- # babashka-sci-dev (23)
- # beginners (48)
- # biff (6)
- # calva (35)
- # cider (16)
- # clj-on-windows (1)
- # clj-yaml (19)
- # clojure (36)
- # clojure-europe (78)
- # clojure-nl (5)
- # clojure-norway (8)
- # clojure-poland (3)
- # clojure-uk (16)
- # clojurescript (17)
- # cursive (6)
- # datahike (3)
- # datalevin (26)
- # duct (7)
- # emacs (41)
- # events (2)
- # fulcro (7)
- # graphql (5)
- # honeysql (13)
- # juxt (3)
- # kaocha (7)
- # lsp (5)
- # malli (12)
- # off-topic (14)
- # pathom (3)
- # portal (1)
- # rdf (9)
- # reitit (3)
- # remote-jobs (2)
- # shadow-cljs (37)
- # spacemacs (5)
- # tools-build (1)
- # tools-deps (20)
- # xtdb (2)
Are there any examples of using aws-api with s3 access control lists? Looking at the javadocs for the java api it's unclear to me if aws-api would manage to have a data representation of those parts of the api.
like making a bucket public?
Well my usecase is assigning a grant to a specific user on specific objects as I create them in the bucket, but just any example of using ACL stuff would satisfy me.
I think granting a user access to a bucket would be done through IAM and would reference the bucket. here is an example of some code that uses the s3 aws-api to make a bucket public:
{:op :PutObject :request {:Bucket bucket :Key (str stack-name "/" to-file)
:ACL "public-read"
:Body (io/input-stream from-file)}}
the use of :ACL
there surprises me since the Java SDK has that property as :AccessControlList
. Where in the docs should I be looking for this sort of thing? Do I need to be finding aws' http docs or something?
might be that :ACL
maps to the x-amz-acl
header in the underlying https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#API_PutObject_RequestSyntax
Ok, cool, that's what I'd wanted to know about, that I have to match the http api, not the java sdk
The aws api has a doc function you can call on putobject to get more information.
> here is an example of some code that uses the s3 aws-api to make a bucket public: Had to nit a bit 😄 , that set's the ACL for a single object to be public, not the whole bucket 🙂 But a very great example indeed, just the right example indeed 🙂
Right.
I forget, but you might need to do both.
the single object is actually what I have to mess with
not the bucket
yup, though there is also this https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html, so if that is turned on, then those single object ACLs might not apply
The aws-api repo has s3 examples that will give you a good idea of how to work with it in general. The rest is on aws to explain.
This could be the source in the https://github.com/aws/aws-sdk-js/blob/master/apis/s3-2006-03-01.normal.json#L9412-L9417 from where that ACL
key is picked up