SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
s3tables: align ARN regex patterns with S3 standards and refactor to constants
Chris Lud98e104dc595
diff --git a/weed/s3api/s3tables/utils.go b/weed/s3api/s3tables/utils.goindex 0d3a91bce4..c1194c63ec 100644--- a/weed/s3api/s3tables/utils.go+++ b/weed/s3api/s3tables/utils.go@@ -11,10 +11,15 @@ import ("time")+const (+ bucketNamePatternStr = `[a-z0-9-]+`+ tableNamespacePatternStr = `[a-z0-9_-]+`+)+var (- bucketARNPattern = regexp.MustCompile(`^arn:aws:s3tables:[^:]*:[^:]*:bucket/([a-z0-9_-]+)$`)- tableARNPattern = regexp.MustCompile(`^arn:aws:s3tables:[^:]*:[^:]*:bucket/([a-z0-9_-]+)/table/([a-z0-9_-]+)/([a-z0-9_-]+)$`)- bucketNamePattern = regexp.MustCompile(`^[a-z0-9_-]+$`)+ bucketARNPattern = regexp.MustCompile(`^arn:aws:s3tables:[^:]*:[^:]*:bucket/(` + bucketNamePatternStr + `)$`)+ tableARNPattern = regexp.MustCompile(`^arn:aws:s3tables:[^:]*:[^:]*:bucket/(` + bucketNamePatternStr + `)/table/(` + tableNamespacePatternStr + `)/(` + tableNamespacePatternStr + `)$`)+ bucketNamePattern = regexp.MustCompile(`^` + bucketNamePatternStr + `$`))// ARN parsing functions