[chore]: Bump github.com/minio/minio-go/v7 from 7.0.70 to 7.0.71 (#2988)

Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.70 to 7.0.71.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.70...v7.0.71)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot] 2024-06-10 07:40:16 +00:00 committed by GitHub
parent 048339a6aa
commit 83ee766e34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 179 additions and 5 deletions

2
go.mod
View file

@ -42,7 +42,7 @@ require (
github.com/jackc/pgx/v5 v5.6.0
github.com/microcosm-cc/bluemonday v1.0.26
github.com/miekg/dns v1.1.59
github.com/minio/minio-go/v7 v7.0.70
github.com/minio/minio-go/v7 v7.0.71
github.com/mitchellh/mapstructure v1.5.0
github.com/ncruces/go-sqlite3 v0.16.1
github.com/oklog/ulid v1.3.1

4
go.sum
View file

@ -426,8 +426,8 @@ github.com/miekg/dns v1.1.59 h1:C9EXc/UToRwKLhK5wKU/I4QVsBUc8kE6MkHBkeypWZs=
github.com/miekg/dns v1.1.59/go.mod h1:nZpewl5p6IvctfgrckopVx2OlSEHPRO/U4SYkRklrEk=
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/minio-go/v7 v7.0.70 h1:1u9NtMgfK1U42kUxcsl5v0yj6TEOPR497OAQxpJnn2g=
github.com/minio/minio-go/v7 v7.0.70/go.mod h1:4yBA8v80xGA30cfM3fz0DKYMXunWl/AV/6tWEs9ryzo=
github.com/minio/minio-go/v7 v7.0.71 h1:No9XfOKTYi6i0GnBj+WZwD8WP5GZfL7n7GOjRqCdAjA=
github.com/minio/minio-go/v7 v7.0.71/go.mod h1:4yBA8v80xGA30cfM3fz0DKYMXunWl/AV/6tWEs9ryzo=
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=

View file

@ -129,7 +129,7 @@ type Options struct {
// Global constants.
const (
libraryName = "minio-go"
libraryVersion = "v7.0.70"
libraryVersion = "v7.0.71"
)
// User Agent should always following the below style.

View file

@ -1216,6 +1216,130 @@ func testPutObjectWithVersioning() {
logSuccess(testName, function, args, startTime)
}
func testListMultipartUpload() {
// initialize logging params
startTime := time.Now()
testName := getFuncName()
function := "GetObject()"
args := map[string]interface{}{}
// Instantiate new minio client object.
opts := &minio.Options{
Creds: credentials.NewStaticV4(os.Getenv(accessKey), os.Getenv(secretKey), ""),
Transport: createHTTPTransport(),
Secure: mustParseBool(os.Getenv(enableHTTPS)),
}
c, err := minio.New(os.Getenv(serverEndpoint), opts)
if err != nil {
logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
return
}
core, err := minio.NewCore(os.Getenv(serverEndpoint), opts)
if err != nil {
logError(testName, function, args, startTime, "", "MinIO core client object creation failed", err)
return
}
// Enable tracing, write to stderr.
// c.TraceOn(os.Stderr)
// Set user agent.
c.SetAppInfo("MinIO-go-FunctionalTest", appVersion)
// Generate a new random bucket name.
bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
args["bucketName"] = bucketName
// Make a new bucket.
ctx := context.Background()
err = c.MakeBucket(ctx, bucketName, minio.MakeBucketOptions{Region: "us-east-1", ObjectLocking: true})
if err != nil {
logError(testName, function, args, startTime, "", "Make bucket failed", err)
return
}
defer func() {
if err = cleanupVersionedBucket(bucketName, c); err != nil {
logError(testName, function, args, startTime, "", "CleanupBucket failed", err)
}
}()
objName := "prefix/objectName"
want := minio.ListMultipartUploadsResult{
Bucket: bucketName,
KeyMarker: "",
UploadIDMarker: "",
NextKeyMarker: "",
NextUploadIDMarker: "",
EncodingType: "url",
MaxUploads: 1000,
IsTruncated: false,
Prefix: "prefix/objectName",
Delimiter: "/",
CommonPrefixes: nil,
}
for i := 0; i < 5; i++ {
uid, err := core.NewMultipartUpload(ctx, bucketName, objName, minio.PutObjectOptions{})
if err != nil {
logError(testName, function, args, startTime, "", "NewMultipartUpload failed", err)
return
}
want.Uploads = append(want.Uploads, minio.ObjectMultipartInfo{
Initiated: time.Time{},
StorageClass: "",
Key: objName,
Size: 0,
UploadID: uid,
Err: nil,
})
for j := 0; j < 5; j++ {
cmpGot := func(call string, got minio.ListMultipartUploadsResult) bool {
for i := range got.Uploads {
got.Uploads[i].Initiated = time.Time{}
}
if !reflect.DeepEqual(want, got) {
err := fmt.Errorf("want: %#v\ngot : %#v", want, got)
logError(testName, function, args, startTime, "", call+" failed", err)
}
return true
}
got, err := core.ListMultipartUploads(ctx, bucketName, objName, "", "", "/", 1000)
if err != nil {
logError(testName, function, args, startTime, "", "ListMultipartUploads failed", err)
return
}
if !cmpGot("ListMultipartUploads-prefix", got) {
return
}
got, err = core.ListMultipartUploads(ctx, bucketName, objName, objName, "", "/", 1000)
got.KeyMarker = ""
if err != nil {
logError(testName, function, args, startTime, "", "ListMultipartUploads failed", err)
return
}
if !cmpGot("ListMultipartUploads-marker", got) {
return
}
}
if i > 2 {
err = core.AbortMultipartUpload(ctx, bucketName, objName, uid)
if err != nil {
logError(testName, function, args, startTime, "", "AbortMultipartUpload failed", err)
return
}
want.Uploads = want.Uploads[:len(want.Uploads)-1]
}
}
for _, up := range want.Uploads {
err = core.AbortMultipartUpload(ctx, bucketName, objName, up.UploadID)
if err != nil {
logError(testName, function, args, startTime, "", "AbortMultipartUpload failed", err)
return
}
}
logSuccess(testName, function, args, startTime)
}
func testCopyObjectWithVersioning() {
// initialize logging params
startTime := time.Now()
@ -13536,6 +13660,7 @@ func main() {
// execute tests
if isFullMode() {
testListMultipartUpload()
testGetObjectAttributes()
testGetObjectAttributesErrorCases()
testMakeBucketErrorV2()

View file

@ -414,11 +414,32 @@ func (e Expiration) MarshalXML(en *xml.Encoder, startElement xml.StartElement) e
return en.EncodeElement(expirationWrapper(e), startElement)
}
// DelMarkerExpiration represents DelMarkerExpiration actions element in an ILM policy
type DelMarkerExpiration struct {
XMLName xml.Name `xml:"DelMarkerExpiration" json:"-"`
Days int `xml:"Days,omitempty" json:"Days,omitempty"`
}
// IsNull returns true if Days isn't specified and false otherwise.
func (de DelMarkerExpiration) IsNull() bool {
return de.Days == 0
}
// MarshalXML avoids serializing an empty DelMarkerExpiration element
func (de DelMarkerExpiration) MarshalXML(enc *xml.Encoder, start xml.StartElement) error {
if de.IsNull() {
return nil
}
type delMarkerExp DelMarkerExpiration
return enc.EncodeElement(delMarkerExp(de), start)
}
// MarshalJSON customizes json encoding by omitting empty values
func (r Rule) MarshalJSON() ([]byte, error) {
type rule struct {
AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `json:"AbortIncompleteMultipartUpload,omitempty"`
Expiration *Expiration `json:"Expiration,omitempty"`
DelMarkerExpiration *DelMarkerExpiration `json:"DelMarkerExpiration,omitempty"`
ID string `json:"ID"`
RuleFilter *Filter `json:"Filter,omitempty"`
NoncurrentVersionExpiration *NoncurrentVersionExpiration `json:"NoncurrentVersionExpiration,omitempty"`
@ -442,6 +463,9 @@ func (r Rule) MarshalJSON() ([]byte, error) {
if !r.Expiration.IsNull() {
newr.Expiration = &r.Expiration
}
if !r.DelMarkerExpiration.IsNull() {
newr.DelMarkerExpiration = &r.DelMarkerExpiration
}
if !r.Transition.IsNull() {
newr.Transition = &r.Transition
}
@ -460,6 +484,7 @@ type Rule struct {
XMLName xml.Name `xml:"Rule,omitempty" json:"-"`
AbortIncompleteMultipartUpload AbortIncompleteMultipartUpload `xml:"AbortIncompleteMultipartUpload,omitempty" json:"AbortIncompleteMultipartUpload,omitempty"`
Expiration Expiration `xml:"Expiration,omitempty" json:"Expiration,omitempty"`
DelMarkerExpiration DelMarkerExpiration `xml:"DelMarkerExpiration,omitempty" json:"DelMarkerExpiration,omitempty"`
ID string `xml:"ID" json:"ID"`
RuleFilter Filter `xml:"Filter,omitempty" json:"Filter,omitempty"`
NoncurrentVersionExpiration NoncurrentVersionExpiration `xml:"NoncurrentVersionExpiration,omitempty" json:"NoncurrentVersionExpiration,omitempty"`

View file

@ -50,6 +50,7 @@ const (
ObjectRemovedAll EventType = "s3:ObjectRemoved:*"
ObjectRemovedDelete EventType = "s3:ObjectRemoved:Delete"
ObjectRemovedDeleteMarkerCreated EventType = "s3:ObjectRemoved:DeleteMarkerCreated"
ILMDelMarkerExpirationDelete EventType = "s3:LifecycleDelMarkerExpiration:Delete"
ObjectReducedRedundancyLostObject EventType = "s3:ReducedRedundancyLostObject"
ObjectTransitionAll EventType = "s3:ObjectTransition:*"
ObjectTransitionFailed EventType = "s3:ObjectTransition:Failed"

View file

@ -19,12 +19,14 @@ package minio
import (
"encoding/base64"
"errors"
"fmt"
"net/http"
"strings"
"time"
"github.com/minio/minio-go/v7/pkg/encrypt"
"github.com/minio/minio-go/v7/pkg/tags"
)
// expirationDateFormat date format for expiration key in json policy.
@ -152,6 +154,27 @@ func (p *PostPolicy) SetCondition(matchType, condition, value string) error {
return errInvalidArgument("Invalid condition in policy")
}
// SetTagging - Sets tagging for the object for this policy based upload.
func (p *PostPolicy) SetTagging(tagging string) error {
if strings.TrimSpace(tagging) == "" || tagging == "" {
return errInvalidArgument("No tagging specified.")
}
_, err := tags.ParseObjectXML(strings.NewReader(tagging))
if err != nil {
return errors.New("The XML you provided was not well-formed or did not validate against our published schema.") //nolint
}
policyCond := policyCondition{
matchType: "eq",
condition: "$tagging",
value: tagging,
}
if err := p.addNewPolicy(policyCond); err != nil {
return err
}
p.formData["tagging"] = tagging
return nil
}
// SetContentType - Sets content-type of the object for this policy
// based upload.
func (p *PostPolicy) SetContentType(contentType string) error {

2
vendor/modules.txt vendored
View file

@ -489,7 +489,7 @@ github.com/miekg/dns
# github.com/minio/md5-simd v1.1.2
## explicit; go 1.14
github.com/minio/md5-simd
# github.com/minio/minio-go/v7 v7.0.70
# github.com/minio/minio-go/v7 v7.0.71
## explicit; go 1.21
github.com/minio/minio-go/v7
github.com/minio/minio-go/v7/pkg/credentials