From 64b3b09900ef7a753490c4db124a78d6ff33db7b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 21:01:38 +0000 Subject: [PATCH] Bump go.mongodb.org/mongo-driver from 1.17.2 to 1.17.3 --- updated-dependencies: - dependency-name: go.mongodb.org/mongo-driver dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- .../bson/bsoncodec/default_value_decoders.go | 8 +++++++- .../mongo-driver/bson/unmarshal.go | 3 +++ .../mongo-driver/mongo/bulk_write.go | 9 +++++++++ .../mongo-driver/mongo/collection.go | 17 +++++++++++++++++ .../mongo/options/bulkwriteoptions.go | 9 +++++++++ .../mongo-driver/mongo/options/findoptions.go | 18 ++++++++++++++++++ .../mongo/options/insertoptions.go | 18 ++++++++++++++++++ .../mongo/options/replaceoptions.go | 9 +++++++++ .../mongo/options/updateoptions.go | 9 +++++++++ .../mongo-driver/version/version.go | 7 +++++-- .../mongo/driver/operation/find_and_modify.go | 14 ++++++++++++++ .../x/mongo/driver/operation/insert.go | 14 ++++++++++++++ .../x/mongo/driver/operation/update.go | 14 ++++++++++++++ vendor/modules.txt | 2 +- 16 files changed, 150 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 2437d8e..f1ecfed 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/swaggo/files v1.0.1 github.com/swaggo/gin-swagger v1.6.0 github.com/swaggo/swag v1.16.4 - go.mongodb.org/mongo-driver v1.17.2 + go.mongodb.org/mongo-driver v1.17.3 go.uber.org/zap v1.27.0 golang.org/x/crypto v0.33.0 golang.org/x/time v0.10.0 diff --git a/go.sum b/go.sum index 2c3cb72..1d510bd 100644 --- a/go.sum +++ b/go.sum @@ -148,8 +148,8 @@ github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zU github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.mongodb.org/mongo-driver v1.17.2 h1:gvZyk8352qSfzyZ2UMWcpDpMSGEr1eqE4T793SqyhzM= -go.mongodb.org/mongo-driver v1.17.2/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= +go.mongodb.org/mongo-driver v1.17.3 h1:TQyXhnsWfWtgAhMtOgtYHMTkZIfBTpMTsMnd9ZBeHxQ= +go.mongodb.org/mongo-driver v1.17.3/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go index 159297e..8702d6d 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go @@ -1521,7 +1521,13 @@ func (dvd DefaultValueDecoders) ValueUnmarshalerDecodeValue(_ DecodeContext, vr return ValueDecoderError{Name: "ValueUnmarshalerDecodeValue", Types: []reflect.Type{tValueUnmarshaler}, Received: val} } - if vr.Type() == bsontype.Null { + // If BSON value is null and the go value is a pointer, then don't call + // UnmarshalBSONValue. Even if the Go pointer is already initialized (i.e., + // non-nil), encountering null in BSON will result in the pointer being + // directly set to nil here. Since the pointer is being replaced with nil, + // there is no opportunity (or reason) for the custom UnmarshalBSONValue logic + // to be called. + if vr.Type() == bsontype.Null && val.Kind() == reflect.Ptr { val.Set(reflect.Zero(val.Type())) return vr.ReadNull() diff --git a/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go b/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go index 66da17e..d749ba3 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go @@ -41,6 +41,9 @@ type ValueUnmarshaler interface { // Unmarshal parses the BSON-encoded data and stores the result in the value // pointed to by val. If val is nil or not a pointer, Unmarshal returns // InvalidUnmarshalError. +// +// When unmarshaling BSON, if the BSON value is null and the Go value is a +// pointer, the pointer is set to nil without calling UnmarshalBSONValue. func Unmarshal(data []byte, val interface{}) error { return UnmarshalWithRegistry(DefaultRegistry, data, val) } diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/bulk_write.go b/vendor/go.mongodb.org/mongo-driver/mongo/bulk_write.go index 40f1181..81dfbb1 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/bulk_write.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/bulk_write.go @@ -39,6 +39,7 @@ type bulkWrite struct { writeConcern *writeconcern.WriteConcern result BulkWriteResult let interface{} + bypassEmptyTsReplacement *bool } func (bw *bulkWrite) execute(ctx context.Context) error { @@ -207,6 +208,10 @@ func (bw *bulkWrite) runInsert(ctx context.Context, batch bulkWriteBatch) (opera } op = op.Retry(retry) + if bw.bypassEmptyTsReplacement != nil { + op.BypassEmptyTsReplacement(*bw.bypassEmptyTsReplacement) + } + err := op.Execute(ctx) return op.Result(), err @@ -415,6 +420,10 @@ func (bw *bulkWrite) runUpdate(ctx context.Context, batch bulkWriteBatch) (opera } op = op.Retry(retry) + if bw.bypassEmptyTsReplacement != nil { + op.BypassEmptyTsReplacement(*bw.bypassEmptyTsReplacement) + } + err := op.Execute(ctx) return op.Result(), err diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/collection.go b/vendor/go.mongodb.org/mongo-driver/mongo/collection.go index dbe238a..95889c8 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/collection.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/collection.go @@ -234,6 +234,7 @@ func (coll *Collection) BulkWrite(ctx context.Context, models []WriteModel, selector: selector, writeConcern: wc, let: bwo.Let, + bypassEmptyTsReplacement: bwo.BypassEmptyTsReplacement, } err = op.execute(ctx) @@ -307,6 +308,9 @@ func (coll *Collection) insert(ctx context.Context, documents []interface{}, if imo.Ordered != nil { op = op.Ordered(*imo.Ordered) } + if imo.BypassEmptyTsReplacement != nil { + op = op.BypassEmptyTsReplacement(*imo.BypassEmptyTsReplacement) + } retry := driver.RetryNone if coll.client.retryWrites { retry = driver.RetryOncePerCommand @@ -355,6 +359,9 @@ func (coll *Collection) InsertOne(ctx context.Context, document interface{}, if ioOpts.Comment != nil { imOpts.SetComment(ioOpts.Comment) } + if ioOpts.BypassEmptyTsReplacement != nil { + imOpts.BypassEmptyTsReplacement = ioOpts.BypassEmptyTsReplacement + } res, err := coll.insert(ctx, []interface{}{document}, imOpts) rr, err := processWriteError(err) @@ -609,6 +616,9 @@ func (coll *Collection) updateOrReplace(ctx context.Context, filter bsoncore.Doc } op = op.Comment(comment) } + if uo.BypassEmptyTsReplacement != nil { + op.BypassEmptyTsReplacement(*uo.BypassEmptyTsReplacement) + } retry := driver.RetryNone // retryable writes are only enabled updateOne/replaceOne operations if !multi && coll.client.retryWrites { @@ -760,6 +770,7 @@ func (coll *Collection) ReplaceOne(ctx context.Context, filter interface{}, uOpts.Hint = opt.Hint uOpts.Let = opt.Let uOpts.Comment = opt.Comment + uOpts.BypassEmptyTsReplacement = opt.BypassEmptyTsReplacement updateOptions = append(updateOptions, uOpts) } @@ -1659,6 +1670,9 @@ func (coll *Collection) FindOneAndReplace(ctx context.Context, filter interface{ } op = op.Let(let) } + if fo.BypassEmptyTsReplacement != nil { + op = op.BypassEmptyTsReplacement(*fo.BypassEmptyTsReplacement) + } return coll.findAndModify(ctx, op) } @@ -1765,6 +1779,9 @@ func (coll *Collection) FindOneAndUpdate(ctx context.Context, filter interface{} } op = op.Let(let) } + if fo.BypassEmptyTsReplacement != nil { + op = op.BypassEmptyTsReplacement(*fo.BypassEmptyTsReplacement) + } return coll.findAndModify(ctx, op) } diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/options/bulkwriteoptions.go b/vendor/go.mongodb.org/mongo-driver/mongo/options/bulkwriteoptions.go index 153de0c..49d7a0f 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/options/bulkwriteoptions.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/options/bulkwriteoptions.go @@ -29,6 +29,12 @@ type BulkWriteOptions struct { // parameter names to values. Values must be constant or closed expressions that do not reference document fields. // Parameters can then be accessed as variables in an aggregate expression context (e.g. "$$var"). Let interface{} + + // If true, the server accepts empty Timestamp as a literal rather than replacing it with the current time. + // + // Deprecated: This option is for internal use only and should not be set. It may be changed or removed in any + // release. + BypassEmptyTsReplacement *bool } // BulkWrite creates a new *BulkWriteOptions instance. @@ -88,6 +94,9 @@ func MergeBulkWriteOptions(opts ...*BulkWriteOptions) *BulkWriteOptions { if opt.Let != nil { b.Let = opt.Let } + if opt.BypassEmptyTsReplacement != nil { + b.BypassEmptyTsReplacement = opt.BypassEmptyTsReplacement + } } return b diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/options/findoptions.go b/vendor/go.mongodb.org/mongo-driver/mongo/options/findoptions.go index fa3bf11..5795f95 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/options/findoptions.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/options/findoptions.go @@ -675,6 +675,12 @@ type FindOneAndReplaceOptions struct { // Values must be constant or closed expressions that do not reference document fields. Parameters can then be // accessed as variables in an aggregate expression context (e.g. "$$var"). Let interface{} + + // If true, the server accepts empty Timestamp as a literal rather than replacing it with the current time. + // + // Deprecated: This option is for internal use only and should not be set. It may be changed or removed in any + // release. + BypassEmptyTsReplacement *bool } // FindOneAndReplace creates a new FindOneAndReplaceOptions instance. @@ -787,6 +793,9 @@ func MergeFindOneAndReplaceOptions(opts ...*FindOneAndReplaceOptions) *FindOneAn if opt.Let != nil { fo.Let = opt.Let } + if opt.BypassEmptyTsReplacement != nil { + fo.BypassEmptyTsReplacement = opt.BypassEmptyTsReplacement + } } return fo @@ -852,6 +861,12 @@ type FindOneAndUpdateOptions struct { // Values must be constant or closed expressions that do not reference document fields. Parameters can then be // accessed as variables in an aggregate expression context (e.g. "$$var"). Let interface{} + + // If true, the server accepts empty Timestamp as a literal rather than replacing it with the current time. + // + // Deprecated: This option is for internal use only and should not be set. It may be changed or removed in any + // release. + BypassEmptyTsReplacement *bool } // FindOneAndUpdate creates a new FindOneAndUpdateOptions instance. @@ -973,6 +988,9 @@ func MergeFindOneAndUpdateOptions(opts ...*FindOneAndUpdateOptions) *FindOneAndU if opt.Let != nil { fo.Let = opt.Let } + if opt.BypassEmptyTsReplacement != nil { + fo.BypassEmptyTsReplacement = opt.BypassEmptyTsReplacement + } } return fo diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/options/insertoptions.go b/vendor/go.mongodb.org/mongo-driver/mongo/options/insertoptions.go index 82137c6..f84f799 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/options/insertoptions.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/options/insertoptions.go @@ -17,6 +17,12 @@ type InsertOneOptions struct { // A string or document that will be included in server logs, profiling logs, and currentOp queries to help trace // the operation. The default value is nil, which means that no comment will be included in the logs. Comment interface{} + + // If true, the server accepts empty Timestamp as a literal rather than replacing it with the current time. + // + // Deprecated: This option is for internal use only and should not be set. It may be changed or removed in any + // release. + BypassEmptyTsReplacement *bool } // InsertOne creates a new InsertOneOptions instance. @@ -53,6 +59,9 @@ func MergeInsertOneOptions(opts ...*InsertOneOptions) *InsertOneOptions { if ioo.Comment != nil { ioOpts.Comment = ioo.Comment } + if ioo.BypassEmptyTsReplacement != nil { + ioOpts.BypassEmptyTsReplacement = ioo.BypassEmptyTsReplacement + } } return ioOpts @@ -72,6 +81,12 @@ type InsertManyOptions struct { // If true, no writes will be executed after one fails. The default value is true. Ordered *bool + + // If true, the server accepts empty Timestamp as a literal rather than replacing it with the current time. + // + // Deprecated: This option is for internal use only and should not be set. It may be changed or removed in any + // release. + BypassEmptyTsReplacement *bool } // InsertMany creates a new InsertManyOptions instance. @@ -119,6 +134,9 @@ func MergeInsertManyOptions(opts ...*InsertManyOptions) *InsertManyOptions { if imo.Ordered != nil { imOpts.Ordered = imo.Ordered } + if imo.BypassEmptyTsReplacement != nil { + imOpts.BypassEmptyTsReplacement = imo.BypassEmptyTsReplacement + } } return imOpts diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/options/replaceoptions.go b/vendor/go.mongodb.org/mongo-driver/mongo/options/replaceoptions.go index f7d3960..ae3e784 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/options/replaceoptions.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/options/replaceoptions.go @@ -40,6 +40,12 @@ type ReplaceOptions struct { // Values must be constant or closed expressions that do not reference document fields. Parameters can then be // accessed as variables in an aggregate expression context (e.g. "$$var"). Let interface{} + + // If true, the server accepts empty Timestamp as a literal rather than replacing it with the current time. + // + // Deprecated: This option is for internal use only and should not be set. It may be changed or removed in any + // release. + BypassEmptyTsReplacement *bool } // Replace creates a new ReplaceOptions instance. @@ -112,6 +118,9 @@ func MergeReplaceOptions(opts ...*ReplaceOptions) *ReplaceOptions { if ro.Let != nil { rOpts.Let = ro.Let } + if ro.BypassEmptyTsReplacement != nil { + rOpts.BypassEmptyTsReplacement = ro.BypassEmptyTsReplacement + } } return rOpts diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/options/updateoptions.go b/vendor/go.mongodb.org/mongo-driver/mongo/options/updateoptions.go index 5206f9f..9f22ca9 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/options/updateoptions.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/options/updateoptions.go @@ -45,6 +45,12 @@ type UpdateOptions struct { // Values must be constant or closed expressions that do not reference document fields. Parameters can then be // accessed as variables in an aggregate expression context (e.g. "$$var"). Let interface{} + + // If true, the server accepts empty Timestamp as a literal rather than replacing it with the current time. + // + // Deprecated: This option is for internal use only and should not be set. It may be changed or removed in any + // release. + BypassEmptyTsReplacement *bool } // Update creates a new UpdateOptions instance. @@ -125,6 +131,9 @@ func MergeUpdateOptions(opts ...*UpdateOptions) *UpdateOptions { if uo.Let != nil { uOpts.Let = uo.Let } + if uo.BypassEmptyTsReplacement != nil { + uOpts.BypassEmptyTsReplacement = uo.BypassEmptyTsReplacement + } } return uOpts diff --git a/vendor/go.mongodb.org/mongo-driver/version/version.go b/vendor/go.mongodb.org/mongo-driver/version/version.go index 37c900c..8992fad 100644 --- a/vendor/go.mongodb.org/mongo-driver/version/version.go +++ b/vendor/go.mongodb.org/mongo-driver/version/version.go @@ -4,8 +4,11 @@ // not use this file except in compliance with the License. You may obtain // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// DO NOT EDIT. Code generated by Github action +// "mongodb-labs/drivers-github-tools/golang/pre-publish". + // Package version defines the Go Driver version. -package version // import "go.mongodb.org/mongo-driver/version" +package version // Driver is the current version of the driver. -var Driver = "1.17.2" +var Driver = "1.17.3" diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/find_and_modify.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/find_and_modify.go index ea365cc..89f8874 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/find_and_modify.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/find_and_modify.go @@ -52,6 +52,7 @@ type FindAndModify struct { serverAPI *driver.ServerAPIOptions let bsoncore.Document timeout *time.Duration + bypassEmptyTsReplacement *bool result FindAndModifyResult } @@ -214,6 +215,9 @@ func (fam *FindAndModify) command(dst []byte, desc description.SelectedServer) ( if fam.let != nil { dst = bsoncore.AppendDocumentElement(dst, "let", fam.let) } + if fam.bypassEmptyTsReplacement != nil { + dst = bsoncore.AppendBooleanElement(dst, "bypassEmptyTsReplacement", *fam.bypassEmptyTsReplacement) + } return dst, nil } @@ -489,3 +493,13 @@ func (fam *FindAndModify) Authenticator(authenticator driver.Authenticator) *Fin fam.authenticator = authenticator return fam } + +// BypassEmptyTsReplacement sets the bypassEmptyTsReplacement to use for this operation. +func (fam *FindAndModify) BypassEmptyTsReplacement(bypassEmptyTsReplacement bool) *FindAndModify { + if fam == nil { + fam = new(FindAndModify) + } + + fam.bypassEmptyTsReplacement = &bypassEmptyTsReplacement + return fam +} diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/insert.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/insert.go index a65a489..eea285b 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/insert.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/insert.go @@ -43,6 +43,7 @@ type Insert struct { result InsertResult serverAPI *driver.ServerAPIOptions timeout *time.Duration + bypassEmptyTsReplacement *bool logger *logger.Logger } @@ -131,6 +132,9 @@ func (i *Insert) command(dst []byte, desc description.SelectedServer) ([]byte, e if i.ordered != nil { dst = bsoncore.AppendBooleanElement(dst, "ordered", *i.ordered) } + if i.bypassEmptyTsReplacement != nil { + dst = bsoncore.AppendBooleanElement(dst, "bypassEmptyTsReplacement", *i.bypassEmptyTsReplacement) + } return dst, nil } @@ -317,3 +321,13 @@ func (i *Insert) Authenticator(authenticator driver.Authenticator) *Insert { i.authenticator = authenticator return i } + +// BypassEmptyTsReplacement sets the bypassEmptyTsReplacement to use for this operation. +func (i *Insert) BypassEmptyTsReplacement(bypassEmptyTsReplacement bool) *Insert { + if i == nil { + i = new(Insert) + } + + i.bypassEmptyTsReplacement = &bypassEmptyTsReplacement + return i +} diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/update.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/update.go index 1070e7c..a33c67e 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/update.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/update.go @@ -47,6 +47,7 @@ type Update struct { serverAPI *driver.ServerAPIOptions let bsoncore.Document timeout *time.Duration + bypassEmptyTsReplacement *bool logger *logger.Logger } @@ -204,6 +205,9 @@ func (u *Update) command(dst []byte, desc description.SelectedServer) ([]byte, e if u.let != nil { dst = bsoncore.AppendDocumentElement(dst, "let", u.let) } + if u.bypassEmptyTsReplacement != nil { + dst = bsoncore.AppendBooleanElement(dst, "bypassEmptyTsReplacement", *u.bypassEmptyTsReplacement) + } return dst, nil } @@ -426,3 +430,13 @@ func (u *Update) Authenticator(authenticator driver.Authenticator) *Update { u.authenticator = authenticator return u } + +// BypassEmptyTsReplacement sets the bypassEmptyTsReplacement to use for this operation. +func (u *Update) BypassEmptyTsReplacement(bypassEmptyTsReplacement bool) *Update { + if u == nil { + u = new(Update) + } + + u.bypassEmptyTsReplacement = &bypassEmptyTsReplacement + return u +} diff --git a/vendor/modules.txt b/vendor/modules.txt index a57532e..1345d88 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -272,7 +272,7 @@ github.com/xdg-go/stringprep # github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 ## explicit; go 1.17 github.com/youmark/pkcs8 -# go.mongodb.org/mongo-driver v1.17.2 +# go.mongodb.org/mongo-driver v1.17.3 ## explicit; go 1.18 go.mongodb.org/mongo-driver/bson go.mongodb.org/mongo-driver/bson/bsoncodec