From e75bc3e6cdfdc4caae258373a9515c26b259aa11 Mon Sep 17 00:00:00 2001 From: chrislu Date: Wed, 12 Nov 2025 20:57:42 -0800 Subject: [PATCH] remove legacy support --- weed/s3api/s3api_bucket_policy_handlers.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/weed/s3api/s3api_bucket_policy_handlers.go b/weed/s3api/s3api_bucket_policy_handlers.go index ca1acbbfd..355fe0957 100644 --- a/weed/s3api/s3api_bucket_policy_handlers.go +++ b/weed/s3api/s3api_bucket_policy_handlers.go @@ -275,14 +275,10 @@ func (s3a *S3ApiServer) validateBucketPolicy(policyDoc *policy.PolicyDocument, b // validateResourceForBucket checks if a resource ARN is valid for the given bucket func (s3a *S3ApiServer) validateResourceForBucket(resource, bucket string) bool { // Accepted formats for S3 bucket policies: - // AWS-style ARNs (recommended): + // AWS-style ARNs (standard): // arn:aws:s3:::bucket-name // arn:aws:s3:::bucket-name/* // arn:aws:s3:::bucket-name/path/to/object - // Legacy SeaweedFS ARNs (supported for backward compatibility): - // arn:seaweed:s3:::bucket-name - // arn:seaweed:s3:::bucket-name/* - // arn:seaweed:s3:::bucket-name/path/to/object // Simplified formats (for convenience): // bucket-name // bucket-name/* @@ -290,13 +286,10 @@ func (s3a *S3ApiServer) validateResourceForBucket(resource, bucket string) bool var resourcePath string const awsPrefix = "arn:aws:s3:::" - const seaweedPrefix = "arn:seaweed:s3:::" // Strip the optional ARN prefix to get the resource path if path, ok := strings.CutPrefix(resource, awsPrefix); ok { resourcePath = path - } else if path, ok := strings.CutPrefix(resource, seaweedPrefix); ok { - resourcePath = path } else { resourcePath = resource }