diff options
author | Jonathan Reams <jbreams@mongodb.com> | 2018-08-16 16:02:16 -0400 |
---|---|---|
committer | Jonathan Reams <jbreams@mongodb.com> | 2018-09-14 11:12:45 -0400 |
commit | 2ea069aa505c750cad6a7ba6ae6d4ac897f396d1 (patch) | |
tree | b8093da62175046189de9fbb876b5ef8b79181b1 /src/mongo/rpc/metadata.cpp | |
parent | 7087350d1d5c943520e9972ac1f8b85252c0eceb (diff) | |
download | mongo-2ea069aa505c750cad6a7ba6ae6d4ac897f396d1.tar.gz |
SERVER-5261 Include authentication information in currentOp output
Diffstat (limited to 'src/mongo/rpc/metadata.cpp')
-rw-r--r-- | src/mongo/rpc/metadata.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/rpc/metadata.cpp b/src/mongo/rpc/metadata.cpp index 74360ead237..6359c9e1952 100644 --- a/src/mongo/rpc/metadata.cpp +++ b/src/mongo/rpc/metadata.cpp @@ -36,9 +36,9 @@ #include "mongo/db/jsobj.h" #include "mongo/db/logical_clock.h" #include "mongo/db/logical_time_validator.h" -#include "mongo/rpc/metadata/audit_metadata.h" #include "mongo/rpc/metadata/client_metadata_ismaster.h" #include "mongo/rpc/metadata/config_server_metadata.h" +#include "mongo/rpc/metadata/impersonated_user_metadata.h" #include "mongo/rpc/metadata/logical_time_metadata.h" #include "mongo/rpc/metadata/sharding_metadata.h" #include "mongo/rpc/metadata/tracking_metadata.h" @@ -53,18 +53,16 @@ BSONObj makeEmptyMetadata() { void readRequestMetadata(OperationContext* opCtx, const BSONObj& metadataObj, bool requiresAuth) { BSONElement readPreferenceElem; - BSONElement auditElem; BSONElement configSvrElem; BSONElement trackingElem; BSONElement clientElem; BSONElement logicalTimeElem; + BSONElement impersonationElem; for (const auto& metadataElem : metadataObj) { auto fieldName = metadataElem.fieldNameStringData(); if (fieldName == "$readPreference") { readPreferenceElem = metadataElem; - } else if (fieldName == AuditMetadata::fieldName()) { - auditElem = metadataElem; } else if (fieldName == ConfigServerMetadata::fieldName()) { configSvrElem = metadataElem; } else if (fieldName == ClientMetadata::fieldName()) { @@ -73,6 +71,8 @@ void readRequestMetadata(OperationContext* opCtx, const BSONObj& metadataObj, bo trackingElem = metadataElem; } else if (fieldName == LogicalTimeMetadata::fieldName()) { logicalTimeElem = metadataElem; + } else if (fieldName == kImpersonationMetadataSectionName) { + impersonationElem = metadataElem; } } @@ -81,7 +81,7 @@ void readRequestMetadata(OperationContext* opCtx, const BSONObj& metadataObj, bo uassertStatusOK(ReadPreferenceSetting::fromInnerBSON(readPreferenceElem)); } - AuditMetadata::get(opCtx) = uassertStatusOK(AuditMetadata::readFromMetadata(auditElem)); + readImpersonatedUserMetadata(impersonationElem, opCtx); uassertStatusOK(ClientMetadataIsMasterState::readFromMetadata(opCtx, clientElem)); |