|
|
@ -21,7 +21,7 @@ import ( |
|
|
|
"github.com/seaweedfs/seaweedfs/weed/s3api/s3err" |
|
|
|
) |
|
|
|
|
|
|
|
// TestIsRequestPresignedSignatureV4 - Test validates the logic for presign signature verision v4 detection.
|
|
|
|
// TestIsRequestPresignedSignatureV4 - Test validates the logic for presign signature version v4 detection.
|
|
|
|
func TestIsRequestPresignedSignatureV4(t *testing.T) { |
|
|
|
testCases := []struct { |
|
|
|
inputQueryKey string |
|
|
@ -138,7 +138,7 @@ func mustNewSignedRequest(method string, urlStr string, contentLength int64, bod |
|
|
|
req := mustNewRequest(method, urlStr, contentLength, body, t) |
|
|
|
cred := &Credential{"access_key_1", "secret_key_1"} |
|
|
|
if err := signRequestV4(req, cred.AccessKey, cred.SecretKey); err != nil { |
|
|
|
t.Fatalf("Unable to inititalized new signed http request %s", err) |
|
|
|
t.Fatalf("Unable to initialized new signed http request %s", err) |
|
|
|
} |
|
|
|
return req |
|
|
|
} |
|
|
@ -149,7 +149,7 @@ func mustNewPresignedRequest(method string, urlStr string, contentLength int64, |
|
|
|
req := mustNewRequest(method, urlStr, contentLength, body, t) |
|
|
|
cred := &Credential{"access_key_1", "secret_key_1"} |
|
|
|
if err := preSignV4(req, cred.AccessKey, cred.SecretKey, int64(10*time.Minute.Seconds())); err != nil { |
|
|
|
t.Fatalf("Unable to inititalized new signed http request %s", err) |
|
|
|
t.Fatalf("Unable to initialized new signed http request %s", err) |
|
|
|
} |
|
|
|
return req |
|
|
|
} |
|
|
|