简体   繁体   English

使用JavaScript SDK的AWS S3:未经身份验证的公共用户的listObjects

[英]AWS S3 using JavaScript SDK: listObjects for unauthenticated, public users

AWS JavaScript SDK has methods for listing all objects in an S3 bucket, but you have to use this method as an authenticated IAM. AWS JavaScript SDK具有列出 S3存储桶中所有对象的方法,但是您必须将此方法用作经过身份验证的IAM。

Is there a way to create an IAM that can be assumed by any public user and then use that IAM to list the contents of the bucket? 有没有一种方法可以创建任何公共用户都可以假定的IAM,然后使用该IAM列出存储桶中的内容?

Or is there any other way to list the contents of the bucket publicly using the front-end JavaScript SDK? 还是有其他方法可以使用前端JavaScript SDK公开列出存储桶的内容?

我认为做到这一点的方法是使用Amazon Cognito ,它允许“来宾”访问API。

I know this is kind of old but I just found this: https://github.com/aws/aws-sdk-js/commit/7a8e257f32d984821a8661422070fb861659015f 我知道这有点旧,但我刚刚发现了这个: https : //github.com/aws/aws-sdk-js/commit/7a8e257f32d984821a8661422070fb861659015f

It's a method for the AWS.S3() javascript sdk object, so one can make unathenticated requests to the api. 这是AWS.S3() javascript sdk对象的一种方法,因此可以向api发出未经请求的请求。 Works great with public buckets. 适用于公共水桶。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM