diff options
author | Cheahuychou Mao <mao.cheahuychou@gmail.com> | 2020-11-23 06:40:22 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-01-05 00:39:04 +0000 |
commit | fee631bc61d2fc85bd727967cfb4f2f243395461 (patch) | |
tree | e7ef493d74477b00b93f242e6ea973877d1a4306 /src/mongo/db/commands.cpp | |
parent | e2f5ada302c5541dc7af96391583e327820a5f5e (diff) | |
download | mongo-fee631bc61d2fc85bd727967cfb4f2f243395461.tar.gz |
SERVER-52708 Make tenant migration donor take certificate as string in donorStartMigration command
Diffstat (limited to 'src/mongo/db/commands.cpp')
-rw-r--r-- | src/mongo/db/commands.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp index 025def0f609..6b279d1ebfe 100644 --- a/src/mongo/db/commands.cpp +++ b/src/mongo/db/commands.cpp @@ -214,11 +214,11 @@ void CommandHelpers::auditLogAuthEvent(OperationContext* opCtx, } } - StringData sensitiveFieldName() const override { + std::set<StringData> sensitiveFieldNames() const override { if (_invocation) { - return _invocation->definition()->sensitiveFieldName(); + return _invocation->definition()->sensitiveFieldNames(); } - return StringData{}; + return {}; } StringData getName() const override { @@ -898,15 +898,15 @@ private: Command::~Command() = default; void Command::snipForLogging(mutablebson::Document* cmdObj) const { - StringData sensitiveField = sensitiveFieldName(); - if (!sensitiveField.empty()) { - - for (mutablebson::Element pwdElement = - mutablebson::findFirstChildNamed(cmdObj->root(), sensitiveField); - pwdElement.ok(); - pwdElement = - mutablebson::findElementNamed(pwdElement.rightSibling(), sensitiveField)) { - uassertStatusOK(pwdElement.setValueString("xxx")); + auto sensitiveFields = sensitiveFieldNames(); + if (!sensitiveFields.empty()) { + for (auto& sensitiveField : sensitiveFields) { + for (mutablebson::Element element = + mutablebson::findFirstChildNamed(cmdObj->root(), sensitiveField); + element.ok(); + element = mutablebson::findElementNamed(element.rightSibling(), sensitiveField)) { + uassertStatusOK(element.setValueString("xxx")); + } } } } |