简体   繁体   English

带有预签名URL的s3前缀的目录列表

[英]Directory listing for s3 prefix with presigned urls

Is it possible to provide a directory listing of a portion of a bucket by prefix (eg a listing for /portionprefix/) by providing 3rd parties with presigned urls without own code to create the view? 是否可以通过为第三方提供带预签名的url而没有自己的代码来创建视图,从而按前缀提供存储桶的一部分的目录列表(例如/ portionprefix /的列表)?

My idea was that the customer would provide a token and the prefix to aws lambda, which would return an URL of some sort upon successful authorization where the customer would get a file browser or directory listing. 我的想法是,客户将为aws lambda提供令牌和前缀,这将在成功获得授权后返回某种URL,客户将获得文件浏览器或目录列表。

I was wondering if amazon already provides something for that out of the box? 我想知道亚马逊是否已经提供了开箱即用的功能?

S3 pre-signed URLs are for objects so you can't do this natively. S3预签名URL是针对对象的,因此您不能原生进行此操作。

You could write a Lambda function that, given an S3 prefix and appropriate credentials, enumerated the S3 objects with that prefix and returned them as a list. 您可以编写一个Lambda函数,该函数具有S3前缀和适当的凭据,并使用该前缀枚举S3对象并将它们作为列表返回。

Another option you might consider is for a Lambda function to enumerate the S3 objects with the given prefix and then write that list of objects to a text file in S3, and then return a pre-signed URL for that text file to the customer. 您可能考虑的另一种选择是让Lambda函数枚举具有给定前缀的S3对象,然后将该对象列表写入S3中的文本文件,然后将该文本文件的预签名URL返回给客户。 The customer could then retrieve the text file in a single operation and its contents would be the list of objects. 然后,客户可以通过一次操作检索文本文件,其内容就是对象列表。

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

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