Skip to content

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.

docs(s3api): readability improvements (#3696)

Ryan Russell6f7ef8711ae4
diff --git a/weed/s3api/auth_signature_v2.go b/weed/s3api/auth_signature_v2.go
index a30cec5e89..3fdc321b17 100644
--- a/weed/s3api/auth_signature_v2.go
+++ b/weed/s3api/auth_signature_v2.go
@@ -119,7 +119,7 @@ func validateV2AuthHeader(v2Auth string) (accessKey string, errCode s3err.ErrorC
return "", s3err.ErrMissingFields
}
- // Then will be splitting on ":", this will seprate `AWSAccessKeyId` and `Signature` string.
+ // Then will be splitting on ":", this will separate `AWSAccessKeyId` and `Signature` string.
keySignFields := strings.Split(strings.TrimSpace(authFields[1]), ":")
if len(keySignFields) != 2 {
return "", s3err.ErrMissingFields
diff --git a/weed/s3api/auth_signature_v4.go b/weed/s3api/auth_signature_v4.go
index bd78f471da..02a6bd4e05 100644
--- a/weed/s3api/auth_signature_v4.go
+++ b/weed/s3api/auth_signature_v4.go
@@ -225,7 +225,7 @@ func parseSignV4(v4Auth string) (sv signValues, aec s3err.ErrorCode) {
signV4Values := signValues{}
var err s3err.ErrorCode
- // Save credentail values.
+ // Save credential values.
signV4Values.Credential, err = parseCredentialHeader(authFields[0])
if err != s3err.ErrNone {
return sv, err
@@ -467,7 +467,7 @@ func contains(list []string, elem string) bool {
return false
}
-// preSignValues data type represents structued form of AWS Signature V4 query string.
+// preSignValues data type represents structured form of AWS Signature V4 query string.
type preSignValues struct {
signValues
Date time.Time
@@ -551,7 +551,7 @@ func parsePreSignV4(query url.Values) (psv preSignValues, aec s3err.ErrorCode) {
return psv, err
}
- // Return structed form of signature query string.
+ // Return structured form of signature query string.
return preSignV4Values, s3err.ErrNone
}
diff --git a/weed/s3api/auto_signature_v4_test.go b/weed/s3api/auto_signature_v4_test.go
index 9daf7bebab..db8bfd8ef5 100644
--- a/weed/s3api/auto_signature_v4_test.go
+++ b/weed/s3api/auto_signature_v4_test.go
@@ -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
}
diff --git a/weed/s3api/chunked_reader_v4.go b/weed/s3api/chunked_reader_v4.go
index c8c8239079..8ba1bc4793 100644
--- a/weed/s3api/chunked_reader_v4.go
+++ b/weed/s3api/chunked_reader_v4.go
@@ -135,7 +135,7 @@ func (iam *IdentityAccessManagement) calculateSeedSignature(r *http.Request) (cr
return nil, "", "", time.Time{}, s3err.ErrSignatureDoesNotMatch
}
- // Return caculated signature.
+ // Return calculated signature.
return cred, newSignature, region, date, s3err.ErrNone
}
diff --git a/weed/s3api/policy/post-policy_test.go b/weed/s3api/policy/post-policy_test.go
index ce241b7238..8b054023af 100644
--- a/weed/s3api/policy/post-policy_test.go
+++ b/weed/s3api/policy/post-policy_test.go
@@ -125,7 +125,7 @@ func newPostPolicyBytesV2(bucketName, objectKey string, expiration time.Time) []
// postPresignSignatureV4 - presigned signature for PostPolicy requests.
func postPresignSignatureV4(policyBase64 string, t time.Time, secretAccessKey, location string) string {
- // Get signining key.
+ // Get signing key.
signingkey := getSigningKey(secretAccessKey, t, location)
// Calculate signature.
signature := getSignature(signingkey, policyBase64)
diff --git a/weed/s3api/policy/postpolicyform.go b/weed/s3api/policy/postpolicyform.go
index 3a6f3a8826..011f782d75 100644
--- a/weed/s3api/policy/postpolicyform.go
+++ b/weed/s3api/policy/postpolicyform.go
@@ -203,7 +203,7 @@ func ParsePostPolicyForm(policy string) (ppf PostPolicyForm, e error) {
return parsedPolicy, nil
}
-// checkPolicyCond returns a boolean to indicate if a condition is satisified according
+// checkPolicyCond returns a boolean to indicate if a condition is satisfied according
// to the passed operator
func checkPolicyCond(op string, input1, input2 string) bool {
switch op {