Skip to content

Commit 666c2d5

Browse files
committed
updates
1 parent 54766aa commit 666c2d5

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

internal/integration/unified/collection_data.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type collectionData struct {
2929
type createOptions struct {
3030
Capped *bool `bson:"capped"`
3131
SizeInBytes *int64 `bson:"size"`
32-
EncryptedFields any `bson:"encryptedFields"`
32+
EncryptedFields bson.Raw `bson:"encryptedFields"`
3333
Validator bson.Raw `bson:"validator"`
3434
}
3535

internal/integration/unified/database_operation_execution.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,17 @@ func executeDropCollection(ctx context.Context, operation *operation) (*operatio
158158
return nil, err
159159
}
160160

161+
dco := options.DropCollection()
162+
161163
var collName string
162164
elems, _ := operation.Arguments.Elements()
163165
for _, elem := range elems {
164166
key := elem.Key()
165167
val := elem.Value()
166168

167169
switch key {
170+
case "encryptedFields":
171+
dco.SetEncryptedFields(val.Document())
168172
case "collection":
169173
collName = val.StringValue()
170174
default:
@@ -175,7 +179,7 @@ func executeDropCollection(ctx context.Context, operation *operation) (*operatio
175179
return nil, newMissingArgumentError("collection")
176180
}
177181

178-
err = db.Collection(collName).Drop(ctx)
182+
err = db.Collection(collName).Drop(ctx, dco)
179183
return newErrorResult(err), nil
180184
}
181185

internal/integration/unified/entity.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"bytes"
1111
"context"
1212
"crypto/tls"
13+
"encoding/base64"
1314
"errors"
1415
"fmt"
1516
"os"
@@ -685,7 +686,11 @@ func getKmsProvider(key string, opt bson.Raw) (map[string]any, error) {
685686
return nil, err
686687
}
687688
if v != nil {
688-
provider["key"] = v
689+
b, err := base64.StdEncoding.DecodeString(v.(string))
690+
if err != nil {
691+
return nil, err
692+
}
693+
provider["key"] = b
689694
}
690695
default:
691696
return nil, fmt.Errorf("unrecognized KMS provider: %s", key)

internal/integration/unified/operation.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,11 @@ func (op *operation) run(ctx context.Context, loopDone <-chan struct{}) (*operat
274274
return executeAddKeyAltName(ctx, op)
275275
case "decrypt":
276276
return executeDecrypt(ctx, op)
277+
case "assertIndexNotExists":
278+
db := lookupString(op.Arguments, "databaseName")
279+
coll := lookupString(op.Arguments, "collectionName")
280+
index := lookupString(op.Arguments, "indexName")
281+
return nil, verifyIndexExists(ctx, db, coll, index, false)
277282

278283
// Unsupported operations
279284
case "count", "listIndexNames", "mapReduce":

internal/spectest/skip.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,12 @@ var skipTests = map[string][]string{
392392
"TestClientSideEncryptionSpec/timeoutMS.json/timeoutMS_applied_to_listCollections_to_get_collection_schema",
393393
},
394394

395+
// TODO(GODRIVER-3403): Support QE with Client.bulkWrite
396+
"Support QE with Client.bulkWrite (GODRIVER-3403)": {
397+
"TestUnifiedSpec/client-side-encryption/tests/unified/client-bulkWrite-qe.json/client_bulkWrite_QE_replaceOne",
398+
"TestUnifiedSpec/client-side-encryption/tests/unified/client-bulkWrite-qe.json/client_bulkWrite_QE_with_multiple_replace_fails",
399+
},
400+
395401
// TODO(GODRIVER-3076): CSFLE/QE Support for more than 1 KMS provider per
396402
// type.
397403
"Support multiple KMS providers per type (GODRIVER-3076)": {

0 commit comments

Comments
 (0)