summaryrefslogtreecommitdiff
path: root/jstests/auth/auth_mechanisms_parsing.js
blob: 72f906b3c683516b6892c931b20b3d82a18c5954 (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);
}());