|
|
@ -160,7 +160,7 @@ func (web *webAPIHandlers) MakeBucket(r *http.Request, args *MakeBucketArgs, rep |
|
|
|
AccountName: claims.Subject, |
|
|
|
AccountName: claims.Subject, |
|
|
|
Action: iampolicy.CreateBucketAction, |
|
|
|
Action: iampolicy.CreateBucketAction, |
|
|
|
BucketName: args.BucketName, |
|
|
|
BucketName: args.BucketName, |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject), |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject, claims.Map()), |
|
|
|
IsOwner: owner, |
|
|
|
IsOwner: owner, |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
return toJSONError(ctx, errAccessDenied) |
|
|
|
return toJSONError(ctx, errAccessDenied) |
|
|
@ -221,7 +221,7 @@ func (web *webAPIHandlers) DeleteBucket(r *http.Request, args *RemoveBucketArgs, |
|
|
|
AccountName: claims.Subject, |
|
|
|
AccountName: claims.Subject, |
|
|
|
Action: iampolicy.DeleteBucketAction, |
|
|
|
Action: iampolicy.DeleteBucketAction, |
|
|
|
BucketName: args.BucketName, |
|
|
|
BucketName: args.BucketName, |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject), |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject, claims.Map()), |
|
|
|
IsOwner: owner, |
|
|
|
IsOwner: owner, |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
return toJSONError(ctx, errAccessDenied) |
|
|
|
return toJSONError(ctx, errAccessDenied) |
|
|
@ -325,7 +325,7 @@ func (web *webAPIHandlers) ListBuckets(r *http.Request, args *WebGenericArgs, re |
|
|
|
AccountName: claims.Subject, |
|
|
|
AccountName: claims.Subject, |
|
|
|
Action: iampolicy.ListBucketAction, |
|
|
|
Action: iampolicy.ListBucketAction, |
|
|
|
BucketName: dnsRecord.Key, |
|
|
|
BucketName: dnsRecord.Key, |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject), |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject, claims.Map()), |
|
|
|
IsOwner: owner, |
|
|
|
IsOwner: owner, |
|
|
|
ObjectName: "", |
|
|
|
ObjectName: "", |
|
|
|
}) { |
|
|
|
}) { |
|
|
@ -347,7 +347,7 @@ func (web *webAPIHandlers) ListBuckets(r *http.Request, args *WebGenericArgs, re |
|
|
|
AccountName: claims.Subject, |
|
|
|
AccountName: claims.Subject, |
|
|
|
Action: iampolicy.ListBucketAction, |
|
|
|
Action: iampolicy.ListBucketAction, |
|
|
|
BucketName: bucket.Name, |
|
|
|
BucketName: bucket.Name, |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject), |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject, claims.Map()), |
|
|
|
IsOwner: owner, |
|
|
|
IsOwner: owner, |
|
|
|
ObjectName: "", |
|
|
|
ObjectName: "", |
|
|
|
}) { |
|
|
|
}) { |
|
|
@ -459,7 +459,7 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r |
|
|
|
readable := globalPolicySys.IsAllowed(policy.Args{ |
|
|
|
readable := globalPolicySys.IsAllowed(policy.Args{ |
|
|
|
Action: policy.ListBucketAction, |
|
|
|
Action: policy.ListBucketAction, |
|
|
|
BucketName: args.BucketName, |
|
|
|
BucketName: args.BucketName, |
|
|
|
ConditionValues: getConditionValues(r, "", ""), |
|
|
|
ConditionValues: getConditionValues(r, "", "", nil), |
|
|
|
IsOwner: false, |
|
|
|
IsOwner: false, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
@ -467,7 +467,7 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r |
|
|
|
writable := globalPolicySys.IsAllowed(policy.Args{ |
|
|
|
writable := globalPolicySys.IsAllowed(policy.Args{ |
|
|
|
Action: policy.PutObjectAction, |
|
|
|
Action: policy.PutObjectAction, |
|
|
|
BucketName: args.BucketName, |
|
|
|
BucketName: args.BucketName, |
|
|
|
ConditionValues: getConditionValues(r, "", ""), |
|
|
|
ConditionValues: getConditionValues(r, "", "", nil), |
|
|
|
IsOwner: false, |
|
|
|
IsOwner: false, |
|
|
|
ObjectName: args.Prefix + SlashSeparator, |
|
|
|
ObjectName: args.Prefix + SlashSeparator, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -498,7 +498,7 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r |
|
|
|
AccountName: claims.Subject, |
|
|
|
AccountName: claims.Subject, |
|
|
|
Action: iampolicy.ListBucketAction, |
|
|
|
Action: iampolicy.ListBucketAction, |
|
|
|
BucketName: args.BucketName, |
|
|
|
BucketName: args.BucketName, |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject), |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject, claims.Map()), |
|
|
|
IsOwner: owner, |
|
|
|
IsOwner: owner, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
@ -506,7 +506,7 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r |
|
|
|
AccountName: claims.Subject, |
|
|
|
AccountName: claims.Subject, |
|
|
|
Action: iampolicy.PutObjectAction, |
|
|
|
Action: iampolicy.PutObjectAction, |
|
|
|
BucketName: args.BucketName, |
|
|
|
BucketName: args.BucketName, |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject), |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject, claims.Map()), |
|
|
|
IsOwner: owner, |
|
|
|
IsOwner: owner, |
|
|
|
ObjectName: args.Prefix + SlashSeparator, |
|
|
|
ObjectName: args.Prefix + SlashSeparator, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -598,7 +598,7 @@ func (web *webAPIHandlers) RemoveObject(r *http.Request, args *RemoveObjectArgs, |
|
|
|
if !globalPolicySys.IsAllowed(policy.Args{ |
|
|
|
if !globalPolicySys.IsAllowed(policy.Args{ |
|
|
|
Action: policy.DeleteObjectAction, |
|
|
|
Action: policy.DeleteObjectAction, |
|
|
|
BucketName: args.BucketName, |
|
|
|
BucketName: args.BucketName, |
|
|
|
ConditionValues: getConditionValues(r, "", ""), |
|
|
|
ConditionValues: getConditionValues(r, "", "", nil), |
|
|
|
IsOwner: false, |
|
|
|
IsOwner: false, |
|
|
|
ObjectName: object, |
|
|
|
ObjectName: object, |
|
|
|
}) { |
|
|
|
}) { |
|
|
@ -672,7 +672,7 @@ next: |
|
|
|
AccountName: claims.Subject, |
|
|
|
AccountName: claims.Subject, |
|
|
|
Action: iampolicy.DeleteObjectAction, |
|
|
|
Action: iampolicy.DeleteObjectAction, |
|
|
|
BucketName: args.BucketName, |
|
|
|
BucketName: args.BucketName, |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject), |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject, claims.Map()), |
|
|
|
IsOwner: owner, |
|
|
|
IsOwner: owner, |
|
|
|
ObjectName: objectName, |
|
|
|
ObjectName: objectName, |
|
|
|
}) { |
|
|
|
}) { |
|
|
@ -690,7 +690,7 @@ next: |
|
|
|
AccountName: claims.Subject, |
|
|
|
AccountName: claims.Subject, |
|
|
|
Action: iampolicy.DeleteObjectAction, |
|
|
|
Action: iampolicy.DeleteObjectAction, |
|
|
|
BucketName: args.BucketName, |
|
|
|
BucketName: args.BucketName, |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject), |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject, claims.Map()), |
|
|
|
IsOwner: owner, |
|
|
|
IsOwner: owner, |
|
|
|
ObjectName: objectName, |
|
|
|
ObjectName: objectName, |
|
|
|
}) { |
|
|
|
}) { |
|
|
@ -930,7 +930,7 @@ func (web *webAPIHandlers) Upload(w http.ResponseWriter, r *http.Request) { |
|
|
|
if !globalPolicySys.IsAllowed(policy.Args{ |
|
|
|
if !globalPolicySys.IsAllowed(policy.Args{ |
|
|
|
Action: policy.PutObjectAction, |
|
|
|
Action: policy.PutObjectAction, |
|
|
|
BucketName: bucket, |
|
|
|
BucketName: bucket, |
|
|
|
ConditionValues: getConditionValues(r, "", ""), |
|
|
|
ConditionValues: getConditionValues(r, "", "", nil), |
|
|
|
IsOwner: false, |
|
|
|
IsOwner: false, |
|
|
|
ObjectName: object, |
|
|
|
ObjectName: object, |
|
|
|
}) { |
|
|
|
}) { |
|
|
@ -949,7 +949,7 @@ func (web *webAPIHandlers) Upload(w http.ResponseWriter, r *http.Request) { |
|
|
|
AccountName: claims.Subject, |
|
|
|
AccountName: claims.Subject, |
|
|
|
Action: iampolicy.PutObjectAction, |
|
|
|
Action: iampolicy.PutObjectAction, |
|
|
|
BucketName: bucket, |
|
|
|
BucketName: bucket, |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject), |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject, claims.Map()), |
|
|
|
IsOwner: owner, |
|
|
|
IsOwner: owner, |
|
|
|
ObjectName: object, |
|
|
|
ObjectName: object, |
|
|
|
}) { |
|
|
|
}) { |
|
|
@ -1110,7 +1110,7 @@ func (web *webAPIHandlers) Download(w http.ResponseWriter, r *http.Request) { |
|
|
|
if !globalPolicySys.IsAllowed(policy.Args{ |
|
|
|
if !globalPolicySys.IsAllowed(policy.Args{ |
|
|
|
Action: policy.GetObjectAction, |
|
|
|
Action: policy.GetObjectAction, |
|
|
|
BucketName: bucket, |
|
|
|
BucketName: bucket, |
|
|
|
ConditionValues: getConditionValues(r, "", ""), |
|
|
|
ConditionValues: getConditionValues(r, "", "", nil), |
|
|
|
IsOwner: false, |
|
|
|
IsOwner: false, |
|
|
|
ObjectName: object, |
|
|
|
ObjectName: object, |
|
|
|
}) { |
|
|
|
}) { |
|
|
@ -1129,7 +1129,7 @@ func (web *webAPIHandlers) Download(w http.ResponseWriter, r *http.Request) { |
|
|
|
AccountName: claims.Subject, |
|
|
|
AccountName: claims.Subject, |
|
|
|
Action: iampolicy.GetObjectAction, |
|
|
|
Action: iampolicy.GetObjectAction, |
|
|
|
BucketName: bucket, |
|
|
|
BucketName: bucket, |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject), |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject, claims.Map()), |
|
|
|
IsOwner: owner, |
|
|
|
IsOwner: owner, |
|
|
|
ObjectName: object, |
|
|
|
ObjectName: object, |
|
|
|
}) { |
|
|
|
}) { |
|
|
@ -1259,7 +1259,7 @@ func (web *webAPIHandlers) DownloadZip(w http.ResponseWriter, r *http.Request) { |
|
|
|
if !globalPolicySys.IsAllowed(policy.Args{ |
|
|
|
if !globalPolicySys.IsAllowed(policy.Args{ |
|
|
|
Action: policy.GetObjectAction, |
|
|
|
Action: policy.GetObjectAction, |
|
|
|
BucketName: args.BucketName, |
|
|
|
BucketName: args.BucketName, |
|
|
|
ConditionValues: getConditionValues(r, "", ""), |
|
|
|
ConditionValues: getConditionValues(r, "", "", nil), |
|
|
|
IsOwner: false, |
|
|
|
IsOwner: false, |
|
|
|
ObjectName: pathJoin(args.Prefix, object), |
|
|
|
ObjectName: pathJoin(args.Prefix, object), |
|
|
|
}) { |
|
|
|
}) { |
|
|
@ -1280,7 +1280,7 @@ func (web *webAPIHandlers) DownloadZip(w http.ResponseWriter, r *http.Request) { |
|
|
|
AccountName: claims.Subject, |
|
|
|
AccountName: claims.Subject, |
|
|
|
Action: iampolicy.GetObjectAction, |
|
|
|
Action: iampolicy.GetObjectAction, |
|
|
|
BucketName: args.BucketName, |
|
|
|
BucketName: args.BucketName, |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject), |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject, claims.Map()), |
|
|
|
IsOwner: owner, |
|
|
|
IsOwner: owner, |
|
|
|
ObjectName: pathJoin(args.Prefix, object), |
|
|
|
ObjectName: pathJoin(args.Prefix, object), |
|
|
|
}) { |
|
|
|
}) { |
|
|
@ -1426,7 +1426,7 @@ func (web *webAPIHandlers) GetBucketPolicy(r *http.Request, args *GetBucketPolic |
|
|
|
AccountName: claims.Subject, |
|
|
|
AccountName: claims.Subject, |
|
|
|
Action: iampolicy.GetBucketPolicyAction, |
|
|
|
Action: iampolicy.GetBucketPolicyAction, |
|
|
|
BucketName: args.BucketName, |
|
|
|
BucketName: args.BucketName, |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject), |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject, claims.Map()), |
|
|
|
IsOwner: owner, |
|
|
|
IsOwner: owner, |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
return toJSONError(ctx, errAccessDenied) |
|
|
|
return toJSONError(ctx, errAccessDenied) |
|
|
@ -1523,7 +1523,7 @@ func (web *webAPIHandlers) ListAllBucketPolicies(r *http.Request, args *ListAllB |
|
|
|
AccountName: claims.Subject, |
|
|
|
AccountName: claims.Subject, |
|
|
|
Action: iampolicy.GetBucketPolicyAction, |
|
|
|
Action: iampolicy.GetBucketPolicyAction, |
|
|
|
BucketName: args.BucketName, |
|
|
|
BucketName: args.BucketName, |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject), |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject, claims.Map()), |
|
|
|
IsOwner: owner, |
|
|
|
IsOwner: owner, |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
return toJSONError(ctx, errAccessDenied) |
|
|
|
return toJSONError(ctx, errAccessDenied) |
|
|
@ -1613,7 +1613,7 @@ func (web *webAPIHandlers) SetBucketPolicy(r *http.Request, args *SetBucketPolic |
|
|
|
AccountName: claims.Subject, |
|
|
|
AccountName: claims.Subject, |
|
|
|
Action: iampolicy.PutBucketPolicyAction, |
|
|
|
Action: iampolicy.PutBucketPolicyAction, |
|
|
|
BucketName: args.BucketName, |
|
|
|
BucketName: args.BucketName, |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject), |
|
|
|
ConditionValues: getConditionValues(r, "", claims.Subject, claims.Map()), |
|
|
|
IsOwner: owner, |
|
|
|
IsOwner: owner, |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
return toJSONError(ctx, errAccessDenied) |
|
|
|
return toJSONError(ctx, errAccessDenied) |
|
|
|