From 614060764dc6d19e4183b8c810b451f77cc90919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=9E=E9=9B=AA=E6=97=A0=E6=83=85?= Date: Tue, 13 Oct 2020 06:18:22 +0800 Subject: [PATCH] fix: use the correct Action type for policy.Args and iampolicy.Args (#10650) --- cmd/auth-handler.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/auth-handler.go b/cmd/auth-handler.go index a3ea868c6..8408d0515 100644 --- a/cmd/auth-handler.go +++ b/cmd/auth-handler.go @@ -385,7 +385,7 @@ func checkRequestAuthTypeToAccessKey(ctx context.Context, r *http.Request, actio // verify as a fallback. if globalIAMSys.IsAllowed(iampolicy.Args{ AccountName: cred.AccessKey, - Action: iampolicy.Action(policy.ListBucketAction), + Action: iampolicy.ListBucketAction, BucketName: bucketName, ConditionValues: getConditionValues(r, "", cred.AccessKey, claims), ObjectName: objectName, @@ -556,7 +556,7 @@ func isPutRetentionAllowed(bucketName, objectName string, retDays int, retDate t if retMode == objectlock.RetGovernance && byPassSet { byPassSet = globalPolicySys.IsAllowed(policy.Args{ AccountName: cred.AccessKey, - Action: policy.Action(policy.BypassGovernanceRetentionAction), + Action: policy.BypassGovernanceRetentionAction, BucketName: bucketName, ConditionValues: conditions, IsOwner: false, @@ -565,7 +565,7 @@ func isPutRetentionAllowed(bucketName, objectName string, retDays int, retDate t } if globalPolicySys.IsAllowed(policy.Args{ AccountName: cred.AccessKey, - Action: policy.Action(policy.PutObjectRetentionAction), + Action: policy.PutObjectRetentionAction, BucketName: bucketName, ConditionValues: conditions, IsOwner: false, @@ -588,7 +588,7 @@ func isPutRetentionAllowed(bucketName, objectName string, retDays int, retDate t if retMode == objectlock.RetGovernance && byPassSet { byPassSet = globalIAMSys.IsAllowed(iampolicy.Args{ AccountName: cred.AccessKey, - Action: policy.BypassGovernanceRetentionAction, + Action: iampolicy.BypassGovernanceRetentionAction, BucketName: bucketName, ObjectName: objectName, ConditionValues: conditions, @@ -598,7 +598,7 @@ func isPutRetentionAllowed(bucketName, objectName string, retDays int, retDate t } if globalIAMSys.IsAllowed(iampolicy.Args{ AccountName: cred.AccessKey, - Action: policy.PutObjectRetentionAction, + Action: iampolicy.PutObjectRetentionAction, BucketName: bucketName, ConditionValues: conditions, ObjectName: objectName,