diff options
author | Sara Golemon <sara.golemon@mongodb.com> | 2022-06-08 22:22:08 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-06-15 17:51:25 +0000 |
commit | d762bb7bc5e99c387fe16468c562132de24c5a45 (patch) | |
tree | 7c84a777cf15c3d90a6e2ed5c4010496a222efa7 /src/mongo/executor | |
parent | 631ca9943ca90732a0bd7ff8454a13fc78948c10 (diff) | |
download | mongo-d762bb7bc5e99c387fe16468c562132de24c5a45.tar.gz |
SERVER-67148 Refactor ValidatedTenantId into ValidatedSecurityToken
Diffstat (limited to 'src/mongo/executor')
-rw-r--r-- | src/mongo/executor/network_interface_tl.cpp | 6 | ||||
-rw-r--r-- | src/mongo/executor/remote_command_request.h | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/mongo/executor/network_interface_tl.cpp b/src/mongo/executor/network_interface_tl.cpp index 9ee2ffac0b6..d919bca3c3b 100644 --- a/src/mongo/executor/network_interface_tl.cpp +++ b/src/mongo/executor/network_interface_tl.cpp @@ -33,7 +33,7 @@ #include <fmt/format.h> #include "mongo/config.h" -#include "mongo/db/auth/security_token.h" +#include "mongo/db/auth/validated_tenancy_scope.h" #include "mongo/db/server_options.h" #include "mongo/db/wire_version.h" #include "mongo/executor/connection_pool_tl.h" @@ -71,9 +71,7 @@ Status appendMetadata(RemoteCommandRequestOnAny* request, if (!request->opCtx) return Status::OK(); - if (auto securityToken = auth::getSecurityToken(request->opCtx)) { - request->securityToken = securityToken->toBSON(); - } + request->validatedTenancyScope = auth::ValidatedTenancyScope::get(request->opCtx); return Status::OK(); } diff --git a/src/mongo/executor/remote_command_request.h b/src/mongo/executor/remote_command_request.h index 7d232a34756..cca27b03e71 100644 --- a/src/mongo/executor/remote_command_request.h +++ b/src/mongo/executor/remote_command_request.h @@ -33,6 +33,7 @@ #include <string> #include "mongo/base/error_codes.h" +#include "mongo/db/auth/validated_tenancy_scope.h" #include "mongo/db/jsobj.h" #include "mongo/rpc/metadata.h" #include "mongo/transport/transport_layer.h" @@ -73,7 +74,7 @@ struct RemoteCommandRequestBase { std::string dbname; BSONObj metadata{rpc::makeEmptyMetadata()}; BSONObj cmdObj; - BSONObj securityToken; + boost::optional<auth::ValidatedTenancyScope> validatedTenancyScope; // OperationContext is added to each request to allow OP_Command metadata attachment access to // the Client object. The OperationContext is only accessed on the thread that calls |