基于Golang的Web服务器上传 /下载AWS S3对象
这可能是一个非常基本的问题,但我正在寻找今天可用的最佳选择 /建议。
问题陈述: 我们有一个Web应用程序,该应用程序允许用户上传和下载文件(存储在S3中)。我们还希望服务器在开始上传 /下载之前先对请求进行身份验证。
几个选项:
- 使用S3预先签名的URL:我当然想避免这种情况,因为这些是私人文件,任何可以访问预先签名URL的人都可以访问这些文件。 (我们甚至无法通过将预签名URL的到期时间设置为几秒钟来承担风险)
- 一旦完成了身份验证,请直接将数据直接传输到S3到客户端。这可能可行吗?我们有任何工具或参考实现吗?
这个问题可能是对过去类似问题的重复(但是它们很旧),我想知道我们今天有什么工具 /选项可以解决这个问题?
我主要是在Golang / Python寻找选项(Golang是可取的)。如果这使情况更容易,则很乐意考虑S3以外的其他存储服务(虽然偏好是S3)。
This might be a very basic problem but I am looking for the best options / recommendations available today.
Problem Statement:
We have a web app which allow users to upload and download files (stored in S3). We also want server to authenticate the request first before starting the upload / download.
Few options:
- Use S3 pre-signed URLs: I certainly want to avoid this because these are private files and anyone who gets access to the pre-signed URLS can access those. (We can't even afford to take risk by setting the expiration time of the pre-signed URL to few seconds)
- Once authentication is done, stream data directly to/from S3 to client. Is this possible and viable? Do we have any tools or reference implementation for this?
This question might be a repeat of similar questions from the past (but they are very old), I wonder what all tools / options we have today to solve this?
I am mostly looking for options in GoLang / Python (GoLang is preferable). Happy to consider storage services other than S3 if that makes things easier (preference will be S3 though).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论