diff options
author | Sara Golemon <sara.golemon@mongodb.com> | 2021-11-09 20:20:06 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-12-20 18:46:05 +0000 |
commit | 68827214ba8746851a29454b4ef405ef629d7721 (patch) | |
tree | 69e11d36840a96cbfa122664626a39c48b4f8e81 /jstests/auth/security_token.js | |
parent | b53fc88485f274d9b20cc93b53058f77d8859d93 (diff) | |
download | mongo-68827214ba8746851a29454b4ef405ef629d7721.tar.gz |
SERVER-61616 Add allowedWithTenant() command property
Diffstat (limited to 'jstests/auth/security_token.js')
-rw-r--r-- | jstests/auth/security_token.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/jstests/auth/security_token.js b/jstests/auth/security_token.js index a1a0c6c2d3d..e0972118af7 100644 --- a/jstests/auth/security_token.js +++ b/jstests/auth/security_token.js @@ -112,16 +112,17 @@ function runTest(conn, enabled, rst = undefined) { // Negative test, logMessage requires logMessage privilege on cluster (not granted) assert.commandFailed(tokenDB.runCommand({logMessage: 'This is a test'})); - // Positive test, writing to a new collection. - assert.writeOK(tokenConn.getDB('test').coll1.insert({x: 1})); + // CRUD operations not yet supported in multitenancy using security token. + assert.writeError(tokenConn.getDB('test').coll1.insert({x: 1})); const log = checkLog.getGlobalLog(conn).map((l) => JSON.parse(l)); - // We performed 4 commands as a token auth'd user. - // We should see four post-operation logout events. + // We successfully dispatched 2 commands as a token auth'd user. + // The failed commands did not dispatch because they are forbidden in multitenancy. + // We should see two post-operation logout events. const logoutMessages = log.filter((l) => (l.id === kLogoutMessageID)); assert.eq(logoutMessages.length, - 4, + 2, 'Unexpected number of logout messages: ' + tojson(logoutMessages)); // None of those authorization sessions should remain active into their next requests. |