|
@@ -66,12 +66,14 @@ class StsOssView(View):
|
|
req.set_DurationSeconds(3600)
|
|
req.set_DurationSeconds(3600)
|
|
Resource_access = "acs:oss:*:*:{bucket_name}/{userID}*".format(bucket_name=bucket_name,
|
|
Resource_access = "acs:oss:*:*:{bucket_name}/{userID}*".format(bucket_name=bucket_name,
|
|
userID=userID)
|
|
userID=userID)
|
|
|
|
+ Resource_access_root = "acs:oss:*:*:{bucket_name}".format(bucket_name=bucket_name)
|
|
|
|
+ # Resource_access_root = "acs:oss:*:*:{bucket_name}".format(bucket_name=bucket_name)
|
|
print(Resource_access)
|
|
print(Resource_access)
|
|
policys = {
|
|
policys = {
|
|
"Version": "1",
|
|
"Version": "1",
|
|
"Statement": [
|
|
"Statement": [
|
|
{
|
|
{
|
|
- "Action": ["oss:PutObject", "oss:DeleteObject", "oss:GetObject","oss:ListObjects"],
|
|
|
|
|
|
+ "Action": ["oss:PutObject", "oss:DeleteObject", "oss:GetObject"],
|
|
# "Action": ["*"],
|
|
# "Action": ["*"],
|
|
"Resource": [Resource_access],
|
|
"Resource": [Resource_access],
|
|
# "Resource": ["*"],
|
|
# "Resource": ["*"],
|
|
@@ -81,6 +83,26 @@ class StsOssView(View):
|
|
# "IpAddress": {"acs:SourceIp": "120.237.157.184"}
|
|
# "IpAddress": {"acs:SourceIp": "120.237.157.184"}
|
|
# "IpAddress": {"acs:SourceIp": "*"}
|
|
# "IpAddress": {"acs:SourceIp": "*"}
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ #######
|
|
|
|
+ {
|
|
|
|
+ "Effect": "Allow",
|
|
|
|
+ "Action": [
|
|
|
|
+ "oss:ListObjects"
|
|
|
|
+ ],
|
|
|
|
+ "Resource": [
|
|
|
|
+ "acs:oss:*:*:{userID}".format(userID=userID)
|
|
|
|
+ ],
|
|
|
|
+ "Condition": {
|
|
|
|
+ "StringLike": {
|
|
|
|
+ "oss:Prefix": [
|
|
|
|
+ ""
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ "StringEquals": {
|
|
|
|
+ "oss:Delimiter": "/"
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|