WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 5b2b04f

Browse files
committed
minor updates
1 parent 8af495d commit 5b2b04f

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

internal/integration/unified/client_entity.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ func getURIForClient(opts *entityOptions) string {
259259
}
260260
}
261261

262+
// TODO(GODRIVER-3726): Need to update the logic to an Unmarshal method.
262263
func createAutoEncryptionOptions(opts bson.Raw) (*options.AutoEncryptionOptions, error) {
263264
aeo := options.AutoEncryption()
264265
var kvnsFound bool

internal/integration/unified/collection_data.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (c *collectionData) createCollection(ctx context.Context) error {
6262
return fmt.Errorf("error creating collection: %w", err)
6363
}
6464
} else {
65-
// If options are provided, still create the collection with write concern "majority".
65+
// If no options are provided, still create the collection with write concern "majority".
6666
// The write concern has to be manually specified in the command document because RunCommand does not honor
6767
// the database's write concern.
6868
create := bson.D{

internal/integration/unified/entity.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ var (
3636

3737
var placeholderDoc = bsoncore.NewDocumentBuilder().AppendInt32("$$placeholder", 1).Build()
3838

39+
const defaultLocalKeyBase64 = "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk"
40+
3941
type storeEventsAsEntitiesConfig struct {
4042
EventListID string `bson:"id"`
4143
Events []string `bson:"events"`
@@ -517,7 +519,7 @@ func (em *EntityMap) close(ctx context.Context) []error {
517519
}
518520
for _, coll := range colls {
519521
if re.MatchString(coll) {
520-
_, err = db.Collection(coll).DeleteMany(ctx, bson.D{})
522+
err = db.Collection(coll).Drop(ctx)
521523
if err != nil {
522524
errs = append(errs, fmt.Errorf("error clearing collection %q: %w", coll, err))
523525
}
@@ -645,8 +647,8 @@ func getKmsProvider(key string, opt bson.Raw) (map[string]any, error) {
645647
key string
646648
envVar string
647649
}{
648-
{"accessKeyId", accessKeyID},
649-
{"secretAccessKey", secretAccessKey},
650+
{key: "accessKeyId", envVar: accessKeyID},
651+
{key: "secretAccessKey", envVar: secretAccessKey},
650652
} {
651653
v, err = getKmsCredential(opt, e.key, e.envVar, "")
652654
if err != nil {
@@ -661,9 +663,9 @@ func getKmsProvider(key string, opt bson.Raw) (map[string]any, error) {
661663
key string
662664
envVar string
663665
}{
664-
{"tenantId", "FLE_AZURE_TENANTID"},
665-
{"clientId", "FLE_AZURE_CLIENTID"},
666-
{"clientSecret", "FLE_AZURE_CLIENTSECRET"},
666+
{key: "tenantId", envVar: "FLE_AZURE_TENANTID"},
667+
{key: "clientId", envVar: "FLE_AZURE_CLIENTID"},
668+
{key: "clientSecret", envVar: "FLE_AZURE_CLIENTSECRET"},
667669
} {
668670
v, err := getKmsCredential(opt, e.key, e.envVar, "")
669671
if err != nil {
@@ -678,8 +680,8 @@ func getKmsProvider(key string, opt bson.Raw) (map[string]any, error) {
678680
key string
679681
envVar string
680682
}{
681-
{"email", "FLE_GCP_EMAIL"},
682-
{"privateKey", "FLE_GCP_PRIVATEKEY"},
683+
{key: "email", envVar: "FLE_GCP_EMAIL"},
684+
{key: "privateKey", envVar: "FLE_GCP_PRIVATEKEY"},
683685
} {
684686
v, err := getKmsCredential(opt, e.key, e.envVar, "")
685687
if err != nil {
@@ -698,7 +700,6 @@ func getKmsProvider(key string, opt bson.Raw) (map[string]any, error) {
698700
provider["endpoint"] = v
699701
}
700702
case "local", "local:name2":
701-
defaultLocalKeyBase64 := "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk"
702703
v, err := getKmsCredential(opt, "key", "", defaultLocalKeyBase64)
703704
if err != nil {
704705
return nil, err

0 commit comments

Comments
 (0)