Browse Source

validate

pull/7471/head
chrislu 2 months ago
parent
commit
3fc0ac4430
  1. 8
      weed/s3api/s3api_bucket_policy_engine.go

8
weed/s3api/s3api_bucket_policy_engine.go

@ -91,6 +91,14 @@ func (bpe *BucketPolicyEngine) DeleteBucketPolicy(bucket string) error {
// - evaluated: whether a policy was found and evaluated (false = no policy exists)
// - error: any error during evaluation
func (bpe *BucketPolicyEngine) EvaluatePolicy(bucket, object, action, principal string) (allowed bool, evaluated bool, err error) {
// Validate required parameters
if bucket == "" {
return false, false, fmt.Errorf("bucket cannot be empty")
}
if action == "" {
return false, false, fmt.Errorf("action cannot be empty")
}
// Convert action to S3 action format
s3Action := convertActionToS3Format(action)

Loading…
Cancel
Save