aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/s3api_auth.go
diff options
context:
space:
mode:
authorTom Crasset <25140344+tcrasset@users.noreply.github.com>2025-02-07 19:54:31 +0100
committerGitHub <noreply@github.com>2025-02-07 10:54:31 -0800
commita7b964af96cd6bc07fc89571cc5f3f8048464cb3 (patch)
tree8d88b37154f72da6b101a6f1def1eff7a2092bd7 /weed/s3api/s3api_auth.go
parente8d8bfccccc666bbef4f1019f880e9aed5aea668 (diff)
downloadseaweedfs-a7b964af96cd6bc07fc89571cc5f3f8048464cb3.tar.xz
seaweedfs-a7b964af96cd6bc07fc89571cc5f3f8048464cb3.zip
add s3 signature tests and prepare implementation of STREAMING-UNSIGNED-PAYLOAD-TRAILER (#6525)
* add tests for s3 signature * add test for newSignV4ChunkedReader.Read() * add glog import
Diffstat (limited to 'weed/s3api/s3api_auth.go')
-rw-r--r--weed/s3api/s3api_auth.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/weed/s3api/s3api_auth.go b/weed/s3api/s3api_auth.go
index bf5cf5fab..8424e7d2c 100644
--- a/weed/s3api/s3api_auth.go
+++ b/weed/s3api/s3api_auth.go
@@ -53,6 +53,11 @@ func isRequestSignStreamingV4(r *http.Request) bool {
r.Method == http.MethodPut
}
+func isRequestUnsignedStreaming(r *http.Request) bool {
+ return r.Header.Get("x-amz-content-sha256") == streamingUnsignedPayload &&
+ r.Method == http.MethodPut
+}
+
// Authorization type.
type authType int
@@ -64,6 +69,7 @@ const (
authTypePresignedV2
authTypePostPolicy
authTypeStreamingSigned
+ authTypeStreamingUnsigned
authTypeSigned
authTypeSignedV2
authTypeJWT
@@ -77,6 +83,8 @@ func getRequestAuthType(r *http.Request) authType {
return authTypePresignedV2
} else if isRequestSignStreamingV4(r) {
return authTypeStreamingSigned
+ } else if isRequestUnsignedStreaming(r) {
+ return authTypeStreamingUnsigned
} else if isRequestSignatureV4(r) {
return authTypeSigned
} else if isRequestPresignedSignatureV4(r) {