关于S3文件传输中的权限 [英] About permission in S3 file transfer
问题描述
我正在使用S3TransferManager-Sample进行测试.我创建了Cognito并设置了IAM,最后更改了constants.swift文件,上传没有问题,但下载失败.错误消息是:
I'm using S3TransferManager-Sample to do testing. I created the Cognito and setup the IAM and change the constants.swift file at last.I have no problem to upload but failed to download. The error message is:
下载失败:[Error Domain = com.amazonaws.AWSS3ErrorDomain代码= 1操作无法完成.(com.amazonaws.AWSS3ErrorDomain错误1.)"UserInfo = 0x7f8cd658a5a0{HostId = d4yLouhlYmGn4s1Zp54 + EOsZQEy2bVEGNs5XIa8pMxerJggANV/9Zb82c1QtF/5Hsn5KqYXGqdw =,Message =拒绝访问,Code =拒绝访问,RequestId = A1966393EAC3F15F}]
download failed: [Error Domain=com.amazonaws.AWSS3ErrorDomain Code=1 "The operation couldn’t be completed. (com.amazonaws.AWSS3ErrorDomain error 1.)" UserInfo=0x7f8cd658a5a0 {HostId=d4yLouhlYmGn4s1Zp54+EOsZQEy2bVEGNs5XIa8pMxerJggANV/9Zb82c1QtF/5Hsn5KqYXGqdw=, Message=Access Denied, Code=AccessDenied, RequestId=A1966393EAC3F15F}]
这是我的角色设置:
我在S3存储桶中的设置:
My setting in the S3 bucket:
当然,当我添加所有人"以允许列表"权限时,我可以下载.但是,Cognito的目的是什么?谢谢
Of course when I added "Everyone" to allow "List" permission, I can download. But what is the purpose for Cognito then? Thanks
推荐答案
问题中有两点需要注意:
A couple of things to note in your question:
- 您已将unauth角色设置为仅允许只读访问.该示例未使用身份验证,因此请确保将unauth角色更新为具有完全访问权限.
- 凭据提供程序会将获取的凭据最多缓存一小时.您可能想要直到以前的凭据过期,或者要在凭据提供者上显式调用refresh方法以强制应用新策略.
这篇关于关于S3文件传输中的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!