[chore]: Bump github.com/minio/minio-go/v7 from 7.0.56 to 7.0.58 (#1928)

This commit is contained in:
dependabot[bot] 2023-06-26 20:45:49 +00:00 committed by GitHub
parent 4ad933b71c
commit e3e0f673cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 86 additions and 34 deletions

2
go.mod
View file

@ -36,7 +36,7 @@ require (
github.com/jackc/pgx/v5 v5.4.1 github.com/jackc/pgx/v5 v5.4.1
github.com/microcosm-cc/bluemonday v1.0.24 github.com/microcosm-cc/bluemonday v1.0.24
github.com/miekg/dns v1.1.55 github.com/miekg/dns v1.1.55
github.com/minio/minio-go/v7 v7.0.56 github.com/minio/minio-go/v7 v7.0.58
github.com/mitchellh/mapstructure v1.5.0 github.com/mitchellh/mapstructure v1.5.0
github.com/oklog/ulid v1.3.1 github.com/oklog/ulid v1.3.1
github.com/spf13/cobra v1.7.0 github.com/spf13/cobra v1.7.0

4
go.sum
View file

@ -450,8 +450,8 @@ github.com/miekg/dns v1.1.55 h1:GoQ4hpsj0nFLYe+bWiCToyrBEJXkQfOOIvFGFy0lEgo=
github.com/miekg/dns v1.1.55/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= github.com/miekg/dns v1.1.55/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
github.com/minio/minio-go/v7 v7.0.56 h1:pkZplIEHu8vinjkmhsexcXpWth2tjVLphrTZx6fBVZY= github.com/minio/minio-go/v7 v7.0.58 h1:B9/8Az8Om/2kX8Ys2ai2PZbBTokRE5W6P5OaqnAs6po=
github.com/minio/minio-go/v7 v7.0.56/go.mod h1:NUDy4A4oXPq1l2yK6LTSvCEzAMeIcoz9lcj5dbzSrRE= github.com/minio/minio-go/v7 v7.0.58/go.mod h1:NUDy4A4oXPq1l2yK6LTSvCEzAMeIcoz9lcj5dbzSrRE=
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=

View file

@ -23,6 +23,7 @@ import (
"fmt" "fmt"
"io" "io"
"net/http" "net/http"
"strings"
) )
/* **** SAMPLE ERROR RESPONSE **** /* **** SAMPLE ERROR RESPONSE ****
@ -188,6 +189,15 @@ func httpRespToErrorResponse(resp *http.Response, bucketName, objectName string)
} }
} }
code := resp.Header.Get("x-minio-error-code")
if code != "" {
errResp.Code = code
}
desc := resp.Header.Get("x-minio-error-desc")
if desc != "" {
errResp.Message = strings.Trim(desc, `"`)
}
// Save hostID, requestID and region information // Save hostID, requestID and region information
// from headers if not available through error XML. // from headers if not available through error XML.
if errResp.RequestID == "" { if errResp.RequestID == "" {

View file

@ -62,7 +62,7 @@ type PutObjectFanOutResponse struct {
ETag string `json:"etag,omitempty"` ETag string `json:"etag,omitempty"`
VersionID string `json:"versionId,omitempty"` VersionID string `json:"versionId,omitempty"`
LastModified *time.Time `json:"lastModified,omitempty"` LastModified *time.Time `json:"lastModified,omitempty"`
Error error `json:"error,omitempty"` Error string `json:"error,omitempty"`
} }
// PutObjectFanOut - is a variant of PutObject instead of writing a single object from a single // PutObjectFanOut - is a variant of PutObject instead of writing a single object from a single

View file

@ -391,6 +391,7 @@ func (c *Client) completeMultipartUpload(ctx context.Context, bucketName, object
if s3utils.IsAmazonEndpoint(*c.endpointURL) { if s3utils.IsAmazonEndpoint(*c.endpointURL) {
headers.Del(encrypt.SseKmsKeyID) // Remove X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id not supported in CompleteMultipartUpload headers.Del(encrypt.SseKmsKeyID) // Remove X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id not supported in CompleteMultipartUpload
headers.Del(encrypt.SseGenericHeader) // Remove X-Amz-Server-Side-Encryption not supported in CompleteMultipartUpload headers.Del(encrypt.SseGenericHeader) // Remove X-Amz-Server-Side-Encryption not supported in CompleteMultipartUpload
headers.Del(encrypt.SseEncryptionContext) // Remove X-Amz-Server-Side-Encryption-Context not supported in CompleteMultipartUpload
} }
// Instantiate all the complete multipart buffer. // Instantiate all the complete multipart buffer.

View file

@ -124,7 +124,7 @@ type Options struct {
// Global constants. // Global constants.
const ( const (
libraryName = "minio-go" libraryName = "minio-go"
libraryVersion = "v7.0.56" libraryVersion = "v7.0.58"
) )
// User Agent should always following the below style. // User Agent should always following the below style.
@ -363,7 +363,8 @@ const (
online = 1 online = 1
) )
// IsOnline returns true if healthcheck enabled and client is online // IsOnline returns true if healthcheck enabled and client is online.
// If HealthCheck function has not been called this will always return true.
func (c *Client) IsOnline() bool { func (c *Client) IsOnline() bool {
return !c.IsOffline() return !c.IsOffline()
} }
@ -374,22 +375,37 @@ func (c *Client) markOffline() {
} }
// IsOffline returns true if healthcheck enabled and client is offline // IsOffline returns true if healthcheck enabled and client is offline
// If HealthCheck function has not been called this will always return false.
func (c *Client) IsOffline() bool { func (c *Client) IsOffline() bool {
return atomic.LoadInt32(&c.healthStatus) == offline return atomic.LoadInt32(&c.healthStatus) == offline
} }
// HealthCheck starts a healthcheck to see if endpoint is up. Returns a context cancellation function // HealthCheck starts a healthcheck to see if endpoint is up.
// and and error if health check is already started // Returns a context cancellation function, to stop the health check,
// and an error if health check is already started.
func (c *Client) HealthCheck(hcDuration time.Duration) (context.CancelFunc, error) { func (c *Client) HealthCheck(hcDuration time.Duration) (context.CancelFunc, error) {
if atomic.LoadInt32(&c.healthStatus) == online { if atomic.LoadInt32(&c.healthStatus) != unknown {
return nil, fmt.Errorf("health check is running") return nil, fmt.Errorf("health check is running")
} }
if hcDuration < 1*time.Second { if hcDuration < 1*time.Second {
return nil, fmt.Errorf("health check duration should be at least 1 second") return nil, fmt.Errorf("health check duration should be at least 1 second")
} }
ctx, cancelFn := context.WithCancel(context.Background())
atomic.StoreInt32(&c.healthStatus, online)
probeBucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "probe-health-") probeBucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "probe-health-")
ctx, cancelFn := context.WithCancel(context.Background())
atomic.StoreInt32(&c.healthStatus, offline)
{
// Change to online, if we can connect.
gctx, gcancel := context.WithTimeout(ctx, 3*time.Second)
_, err := c.getBucketLocation(gctx, probeBucketName)
gcancel()
if !IsNetworkOrHostDown(err, false) {
switch ToErrorResponse(err).Code {
case "NoSuchBucket", "AccessDenied", "":
atomic.CompareAndSwapInt32(&c.healthStatus, offline, online)
}
}
}
go func(duration time.Duration) { go func(duration time.Duration) {
timer := time.NewTimer(duration) timer := time.NewTimer(duration)
defer timer.Stop() defer timer.Stop()

View file

@ -4821,6 +4821,11 @@ func testPresignedPostPolicy() {
policy.SetContentType("binary/octet-stream") policy.SetContentType("binary/octet-stream")
policy.SetContentLengthRange(10, 1024*1024) policy.SetContentLengthRange(10, 1024*1024)
policy.SetUserMetadata(metadataKey, metadataValue) policy.SetUserMetadata(metadataKey, metadataValue)
// Add CRC32C
checksum := minio.ChecksumCRC32C.ChecksumBytes(buf)
policy.SetChecksum(checksum)
args["policy"] = policy.String() args["policy"] = policy.String()
presignedPostPolicyURL, formData, err := c.PresignedPostPolicy(context.Background(), policy) presignedPostPolicyURL, formData, err := c.PresignedPostPolicy(context.Background(), policy)
@ -4888,6 +4893,7 @@ func testPresignedPostPolicy() {
Timeout: 30 * time.Second, Timeout: 30 * time.Second,
Transport: transport, Transport: transport,
} }
args["url"] = presignedPostPolicyURL.String()
req, err := http.NewRequest(http.MethodPost, presignedPostPolicyURL.String(), bytes.NewReader(formBuf.Bytes())) req, err := http.NewRequest(http.MethodPost, presignedPostPolicyURL.String(), bytes.NewReader(formBuf.Bytes()))
if err != nil { if err != nil {
@ -4920,15 +4926,23 @@ func testPresignedPostPolicy() {
expectedLocation := scheme + os.Getenv(serverEndpoint) + "/" + bucketName + "/" + objectName expectedLocation := scheme + os.Getenv(serverEndpoint) + "/" + bucketName + "/" + objectName
expectedLocationBucketDNS := scheme + bucketName + "." + os.Getenv(serverEndpoint) + "/" + objectName expectedLocationBucketDNS := scheme + bucketName + "." + os.Getenv(serverEndpoint) + "/" + objectName
if !strings.Contains(expectedLocation, "s3.amazonaws.com/") {
// Test when not against AWS S3.
if val, ok := res.Header["Location"]; ok { if val, ok := res.Header["Location"]; ok {
if val[0] != expectedLocation && val[0] != expectedLocationBucketDNS { if val[0] != expectedLocation && val[0] != expectedLocationBucketDNS {
logError(testName, function, args, startTime, "", "Location in header response is incorrect", err) logError(testName, function, args, startTime, "", fmt.Sprintf("Location in header response is incorrect. Want %q or %q, got %q", expectedLocation, expectedLocationBucketDNS, val[0]), err)
return return
} }
} else { } else {
logError(testName, function, args, startTime, "", "Location not found in header response", err) logError(testName, function, args, startTime, "", "Location not found in header response", err)
return return
} }
}
want := checksum.Encoded()
if got := res.Header.Get("X-Amz-Checksum-Crc32c"); got != want {
logError(testName, function, args, startTime, "", fmt.Sprintf("Want checksum %q, got %q", want, got), nil)
return
}
successLogger(testName, function, args, startTime).Info() successLogger(testName, function, args, startTime).Info()
} }

View file

@ -45,6 +45,17 @@ const (
ObjectRemovedDelete EventType = "s3:ObjectRemoved:Delete" ObjectRemovedDelete EventType = "s3:ObjectRemoved:Delete"
ObjectRemovedDeleteMarkerCreated EventType = "s3:ObjectRemoved:DeleteMarkerCreated" ObjectRemovedDeleteMarkerCreated EventType = "s3:ObjectRemoved:DeleteMarkerCreated"
ObjectReducedRedundancyLostObject EventType = "s3:ReducedRedundancyLostObject" ObjectReducedRedundancyLostObject EventType = "s3:ReducedRedundancyLostObject"
ObjectTransitionAll EventType = "s3:ObjectTransition:*"
ObjectTransitionFailed EventType = "s3:ObjectTransition:Failed"
ObjectTransitionComplete EventType = "s3:ObjectTransition:Complete"
ObjectTransitionPost EventType = "s3:ObjectRestore:Post"
ObjectTransitionCompleted EventType = "s3:ObjectRestore:Completed"
ObjectReplicationAll EventType = "s3:Replication:*"
ObjectReplicationOperationCompletedReplication EventType = "s3:Replication:OperationCompletedReplication"
ObjectReplicationOperationFailedReplication EventType = "s3:Replication:OperationFailedReplication"
ObjectReplicationOperationMissedThreshold EventType = "s3:Replication:OperationMissedThreshold"
ObjectReplicationOperationNotTracked EventType = "s3:Replication:OperationNotTracked"
ObjectReplicationOperationReplicatedAfterThreshold EventType = "s3:Replication:OperationReplicatedAfterThreshold"
BucketCreatedAll EventType = "s3:BucketCreated:*" BucketCreatedAll EventType = "s3:BucketCreated:*"
BucketRemovedAll EventType = "s3:BucketRemoved:*" BucketRemovedAll EventType = "s3:BucketRemoved:*"
) )

2
vendor/modules.txt vendored
View file

@ -386,7 +386,7 @@ github.com/miekg/dns
# github.com/minio/md5-simd v1.1.2 # github.com/minio/md5-simd v1.1.2
## explicit; go 1.14 ## explicit; go 1.14
github.com/minio/md5-simd github.com/minio/md5-simd
# github.com/minio/minio-go/v7 v7.0.56 # github.com/minio/minio-go/v7 v7.0.58
## explicit; go 1.17 ## explicit; go 1.17
github.com/minio/minio-go/v7 github.com/minio/minio-go/v7
github.com/minio/minio-go/v7/pkg/credentials github.com/minio/minio-go/v7/pkg/credentials