-
Type:
Task
-
Resolution: Duplicate
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
linborland has created PR #2413: GODRIVER-3726 Use unmarshaling for AutoEncryptOpts in the unified spec test in mongo-go-driver
Issue Text:
GODRIVER-3726
-
- Summary
Replace the giant switch condition in the createAutoEncryptionOptions function with a struct that mirrors the “autoEncryptOpts” JSON document format. Call the new struct AutoEncryptOpts. Unmarshal the JSON data into that struct instead of matching field names in a switch condition.
-
- Background & Motivation
Currently, the “autoEncryptOpts” JSON object is decoded as a bson.Raw, which can hold any BSON document value (see here). That unstructured document is then converted into an options.AutoEncryptionOptions by the createAutoEncryptionOptions function. While it works, the unstructured document makes it difficult to reason about the structure of the “autoEncryptOpts” data when writing code.
- duplicates
-
GODRIVER-3726 Use unmarshaling for AutoEncryptOpts in the unified spec test
-
- In Code Review
-