diff options
| author | Hugh Tong <hugh.tong@mongodb.com> | 2022-07-26 19:20:58 +0000 |
|---|---|---|
| committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-07-26 21:00:49 +0000 |
| commit | 044d2f734e0dba40b9dfb02cc49c2bff8f575cd5 (patch) | |
| tree | eb2d17564a0c99d2ee9ea3d2f95c81c46bcfcee1 /src/mongo/crypto | |
| parent | 921bba175902f9b9f29751a466383c3d7e80df7b (diff) | |
| download | mongo-044d2f734e0dba40b9dfb02cc49c2bff8f575cd5.tar.gz | |
SERVER-67824 Rename IDLParserErrorContext to IDLParserContext
Diffstat (limited to 'src/mongo/crypto')
| -rw-r--r-- | src/mongo/crypto/fle_crypto.cpp | 9 | ||||
| -rw-r--r-- | src/mongo/crypto/fle_crypto.h | 2 | ||||
| -rw-r--r-- | src/mongo/crypto/fle_crypto_test.cpp | 16 | ||||
| -rw-r--r-- | src/mongo/crypto/fle_data_frames.h | 4 |
4 files changed, 15 insertions, 16 deletions
diff --git a/src/mongo/crypto/fle_crypto.cpp b/src/mongo/crypto/fle_crypto.cpp index 555c27e9baf..9f0b0acca51 100644 --- a/src/mongo/crypto/fle_crypto.cpp +++ b/src/mongo/crypto/fle_crypto.cpp @@ -1796,7 +1796,7 @@ BSONObj ECOCCollection::generateDocument(StringData fieldName, ConstDataRange pa } ECOCCompactionDocument ECOCCollection::parseAndDecrypt(const BSONObj& doc, ECOCToken token) { - IDLParserErrorContext ctx("root"); + IDLParserContext ctx("root"); auto ecocDoc = EcocDocument::parse(ctx, doc); auto swTokens = EncryptedStateCollectionTokens::decryptAndParse(token, ecocDoc.getValue()); @@ -2354,7 +2354,7 @@ EncryptedFieldConfig EncryptionInformationHelpers::getAndValidateSchema( "Expected an object for schema in EncryptionInformation", !element.eoo() && element.type() == Object); - auto efc = EncryptedFieldConfig::parse(IDLParserErrorContext("schema"), element.Obj()); + auto efc = EncryptedFieldConfig::parse(IDLParserContext("schema"), element.Obj()); uassert(6371206, "Expected a value for eccCollection", efc.getEccCollection().has_value()); uassert(6371207, "Expected a value for escCollection", efc.getEscCollection().has_value()); @@ -2369,7 +2369,7 @@ std::pair<EncryptedBinDataType, ConstDataRange> fromEncryptedConstDataRange(Cons uint8_t subTypeByte = cdrc.readAndAdvance<uint8_t>(); - auto subType = EncryptedBinDataType_parse(IDLParserErrorContext("subtype"), subTypeByte); + auto subType = EncryptedBinDataType_parse(IDLParserContext("subtype"), subTypeByte); return {subType, cdrc}; } @@ -2402,8 +2402,7 @@ StringMap<FLEDeleteToken> EncryptionInformationHelpers::getDeleteTokens( for (const auto& deleteTokenBSON : element.Obj()) { uassert(6371310, "DeleteToken is not an object", deleteTokenBSON.type() == Object); - auto payload = - FLE2DeletePayload::parse(IDLParserErrorContext("delete"), deleteTokenBSON.Obj()); + auto payload = FLE2DeletePayload::parse(IDLParserContext("delete"), deleteTokenBSON.Obj()); auto deleteToken = FLEDeleteToken{FLETokenFromCDR<FLETokenType::ECOCToken>(payload.getEcocToken()), diff --git a/src/mongo/crypto/fle_crypto.h b/src/mongo/crypto/fle_crypto.h index 7b2b63a4712..c3bac17c09c 100644 --- a/src/mongo/crypto/fle_crypto.h +++ b/src/mongo/crypto/fle_crypto.h @@ -1202,7 +1202,7 @@ T parseFromCDR(ConstDataRange cdr) { ConstDataRangeCursor cdc(cdr); auto obj = cdc.readAndAdvance<Validated<BSONObj>>(); - IDLParserErrorContext ctx("root"); + IDLParserContext ctx("root"); return T::parse(ctx, obj); } diff --git a/src/mongo/crypto/fle_crypto_test.cpp b/src/mongo/crypto/fle_crypto_test.cpp index 9e9b4d9269f..2d234f62ae5 100644 --- a/src/mongo/crypto/fle_crypto_test.cpp +++ b/src/mongo/crypto/fle_crypto_test.cpp @@ -1260,7 +1260,7 @@ EncryptedFieldConfig getTestEncryptedFieldConfig() { ] })"; - return EncryptedFieldConfig::parse(IDLParserErrorContext("root"), fromjson(schema)); + return EncryptedFieldConfig::parse(IDLParserContext("root"), fromjson(schema)); } TEST(EncryptionInformation, RoundTrip) { @@ -1271,7 +1271,7 @@ TEST(EncryptionInformation, RoundTrip) { EncryptedFieldConfig efc2 = EncryptionInformationHelpers::getAndValidateSchema( - ns, EncryptionInformation::parse(IDLParserErrorContext("foo"), obj)); + ns, EncryptionInformation::parse(IDLParserContext("foo"), obj)); ASSERT_BSONOBJ_EQ(efc.toBSON(), efc2.toBSON()); } @@ -1287,7 +1287,7 @@ TEST(EncryptionInformation, BadSchema) { NamespaceString ns("test.test"); ASSERT_THROWS_CODE(EncryptionInformationHelpers::getAndValidateSchema( - ns, EncryptionInformation::parse(IDLParserErrorContext("foo"), obj)), + ns, EncryptionInformation::parse(IDLParserContext("foo"), obj)), DBException, 6371205); } @@ -1300,7 +1300,7 @@ TEST(EncryptionInformation, MissingStateCollection) { efc.setEscCollection(boost::none); auto obj = EncryptionInformationHelpers::encryptionInformationSerialize(ns, efc); ASSERT_THROWS_CODE(EncryptionInformationHelpers::getAndValidateSchema( - ns, EncryptionInformation::parse(IDLParserErrorContext("foo"), obj)), + ns, EncryptionInformation::parse(IDLParserContext("foo"), obj)), DBException, 6371207); } @@ -1309,7 +1309,7 @@ TEST(EncryptionInformation, MissingStateCollection) { efc.setEccCollection(boost::none); auto obj = EncryptionInformationHelpers::encryptionInformationSerialize(ns, efc); ASSERT_THROWS_CODE(EncryptionInformationHelpers::getAndValidateSchema( - ns, EncryptionInformation::parse(IDLParserErrorContext("foo"), obj)), + ns, EncryptionInformation::parse(IDLParserContext("foo"), obj)), DBException, 6371206); } @@ -1318,7 +1318,7 @@ TEST(EncryptionInformation, MissingStateCollection) { efc.setEcocCollection(boost::none); auto obj = EncryptionInformationHelpers::encryptionInformationSerialize(ns, efc); ASSERT_THROWS_CODE(EncryptionInformationHelpers::getAndValidateSchema( - ns, EncryptionInformation::parse(IDLParserErrorContext("foo"), obj)), + ns, EncryptionInformation::parse(IDLParserContext("foo"), obj)), DBException, 6371208); } @@ -1412,7 +1412,7 @@ TEST(DeleteTokens, Fetch) { EncryptionInformationHelpers::encryptionInformationSerializeForDelete(ns, efc, &keyVault); auto tokenMap = EncryptionInformationHelpers::getDeleteTokens( - ns, EncryptionInformation::parse(IDLParserErrorContext("foo"), obj)); + ns, EncryptionInformation::parse(IDLParserContext("foo"), obj)); ASSERT_EQ(tokenMap.size(), 2); @@ -1815,7 +1815,7 @@ TEST(FLE_Update, PullTokens) { EncryptionInformationHelpers::encryptionInformationSerializeForDelete(ns, efc, &keyVault); auto tokenMap = EncryptionInformationHelpers::getDeleteTokens( - ns, EncryptionInformation::parse(IDLParserErrorContext("foo"), obj)); + ns, EncryptionInformation::parse(IDLParserContext("foo"), obj)); ASSERT_EQ(tokenMap.size(), 2); diff --git a/src/mongo/crypto/fle_data_frames.h b/src/mongo/crypto/fle_data_frames.h index 897f273198a..037574a5d4b 100644 --- a/src/mongo/crypto/fle_data_frames.h +++ b/src/mongo/crypto/fle_data_frames.h @@ -136,7 +136,7 @@ public: uint8_t* getCiphertextMutable() && = delete; FleAlgorithmInt getFLEAlgorithmType() { - return FleAlgorithmInt_parse(IDLParserErrorContext("root"), _data[0]); + return FleAlgorithmInt_parse(IDLParserContext("root"), _data[0]); } size_t getDataLength() const { @@ -204,7 +204,7 @@ public: private: FleAlgorithmInt getFLEAlgorithmType() const { - return FleAlgorithmInt_parse(IDLParserErrorContext("root"), *_data.data<uint8_t>()); + return FleAlgorithmInt_parse(IDLParserContext("root"), *_data.data<uint8_t>()); } size_t getDataLength() const { |
