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/shell | |
parent | 631ca9943ca90732a0bd7ff8454a13fc78948c10 (diff) | |
download | mongo-d762bb7bc5e99c387fe16468c562132de24c5a45.tar.gz |
SERVER-67148 Refactor ValidatedTenantId into ValidatedSecurityToken
Diffstat (limited to 'src/mongo/shell')
-rw-r--r-- | src/mongo/shell/shell_utils.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/shell/shell_utils.cpp b/src/mongo/shell/shell_utils.cpp index 3c1f4a843f5..748d5a1b80c 100644 --- a/src/mongo/shell/shell_utils.cpp +++ b/src/mongo/shell/shell_utils.cpp @@ -48,7 +48,8 @@ #include "mongo/base/shim.h" #include "mongo/client/dbclient_base.h" #include "mongo/client/replica_set_monitor.h" -#include "mongo/db/auth/security_token.h" +#include "mongo/db/auth/security_token_gen.h" +#include "mongo/db/auth/validated_tenancy_scope.h" #include "mongo/db/hasher.h" #include "mongo/logv2/log.h" #include "mongo/platform/decimal128.h" @@ -436,7 +437,9 @@ BSONObj _createSecurityToken(const BSONObj& args, void* data) { constexpr auto authUserFieldName = auth::SecurityToken::kAuthenticatedUserFieldName; auto authUser = args.firstElement().Obj(); - return BSON("" << auth::signSecurityToken(BSON(authUserFieldName << authUser))); + using VTS = auth::ValidatedTenancyScope; + auto token = VTS(BSON(authUserFieldName << authUser), VTS::TokenForTestingTag{}); + return BSON("" << token.getOriginalToken()); } BSONObj replMonitorStats(const BSONObj& a, void* data) { |