summaryrefslogtreecommitdiff
path: root/jstests/auth/auth_mechanisms_parsing.js
blob: 3954963b88587da068d7a09f8bc09e685df4a657 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Test for stripping whitespace for authenticationMechanisms
(function() {
"use strict";

const conn = MongoRunner.runMongod(
    {setParameter: "authenticationMechanisms=SCRAM-SHA-1,SCRAM-SHA-256, PLAIN"});

const cmdOut = conn.getDB('admin').runCommand({getParameter: 1, authenticationMechanisms: 1});

// Check to see if whitespace in front of PLAIN is stripped
assert.sameMembers(cmdOut.authenticationMechanisms, ["SCRAM-SHA-1", "SCRAM-SHA-256", "PLAIN"]);
MongoRunner.stopMongod(conn);
}());