summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheahuychou Mao <mao.cheahuychou@gmail.com>2021-05-06 14:17:08 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-06 20:41:43 +0000
commit3c80f1e6c677d65822260e263a6a624d2f6408a7 (patch)
tree453e6889e72da36834d961924a339daf4e950729
parentd3559beab25b08afa292529182ce100922596741 (diff)
downloadmongo-3c80f1e6c677d65822260e263a6a624d2f6408a7.tar.gz
SERVER-56711 Remove unused auth code in tenant_migration_test.js
(cherry picked from commit ac3a335935e916b906a203b66c773222c6f2bc61)
-rw-r--r--jstests/replsets/libs/tenant_migration_test.js46
1 files changed, 0 insertions, 46 deletions
diff --git a/jstests/replsets/libs/tenant_migration_test.js b/jstests/replsets/libs/tenant_migration_test.js
index 19582630a4d..a77c866e828 100644
--- a/jstests/replsets/libs/tenant_migration_test.js
+++ b/jstests/replsets/libs/tenant_migration_test.js
@@ -94,52 +94,6 @@ function TenantMigrationTest({
}
/**
- * Creates a role for running find command against config.external_validation_keys if it
- * doesn't exist.
- */
- function createFindExternalClusterTimeKeysRoleIfNotExist(rst) {
- const adminDB = rst.getPrimary().getDB("admin");
-
- if (TenantMigrationUtil.roleExists(adminDB, "findExternalClusterTimeKeysRole")) {
- return;
- }
-
- assert.commandWorked(adminDB.runCommand({
- createRole: "findExternalClusterTimeKeysRole",
- privileges: [{
- resource: {db: "config", collection: "external_validation_keys"},
- actions: ["find"]
- }],
- roles: []
- }));
- }
-
- /**
- * Gives the current admin database user the privilege to run find commands against
- * config.external_validation_keys if it does not have that privilege. Used by
- * 'assertNoDuplicatedExternalKeyDocs' below.
- */
- function grantFindExternalClusterTimeKeysPrivilegeIfNeeded(rst) {
- const adminDB = rst.getPrimary().getDB("admin");
- const users = assert.commandWorked(adminDB.runCommand({connectionStatus: 1}))
- .authInfo.authenticatedUsers;
-
- if (users.length === 0 || users[0].user === "__system" || users[0].db != "admin") {
- return;
- }
-
- const userRoles = adminDB.getUser(users[0].user).roles;
-
- if (userRoles.includes("findExternalClusterTimeKeysRole")) {
- return;
- }
-
- createFindExternalClusterTimeKeysRoleIfNotExist(rst);
- userRoles.push("findExternalClusterTimeKeysRole");
- assert.commandWorked(adminDB.runCommand({updateUser: users[0].user, roles: userRoles}));
- }
-
- /**
* Returns whether tenant migration commands are supported.
*/
this.isFeatureFlagEnabled = function() {