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
s3: add errors if requests are signed by no authentication is setup
Chris Lu431684798b97
diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.goindex a8dc34b546..3704291060 100644--- a/weed/s3api/s3api_object_handlers.go+++ b/weed/s3api/s3api_object_handlers.go@@ -62,6 +62,12 @@ func (s3a *S3ApiServer) PutObjectHandler(w http.ResponseWriter, r *http.Request)writeErrorResponse(w, s3ErrCode, r.URL)return}+ } else {+ rAuthType := getRequestAuthType(r)+ if authTypeAnonymous != rAuthType {+ writeErrorResponse(w, s3err.ErrAuthNotSetup, r.URL)+ return+ }}defer dataReader.Close()diff --git a/weed/s3api/s3err/s3api_errors.go b/weed/s3api/s3err/s3api_errors.goindex 877c39a520..258f21523a 100644--- a/weed/s3api/s3err/s3api_errors.go+++ b/weed/s3api/s3err/s3api_errors.go@@ -91,6 +91,7 @@ const (ErrRequestNotReadyYetErrMissingDateHeaderErrInvalidRequest+ ErrAuthNotSetupErrNotImplementedErrExistingObjectIsDirectory@@ -341,6 +342,11 @@ var errorCodeResponse = map[ErrorCode]APIError{Description: "Invalid Request",HTTPStatusCode: http.StatusBadRequest,},+ ErrAuthNotSetup : {+ Code: "InvalidRequest",+ Description: "Signed request requires setting up SeaweedFS S3 authentication",+ HTTPStatusCode: http.StatusBadRequest,+ },ErrNotImplemented: {Code: "NotImplemented",Description: "A header you provided implies functionality that is not implemented",