summaryrefslogtreecommitdiff
path: root/jstests/auth/auth_mechanisms_parsing.js
diff options
context:
space:
mode:
authorJason Piao <jason.piao@Jasons-MacBook-Pro.local>2019-06-07 11:40:34 -0400
committerJason Piao <jason.piao@mongodb.com>2019-06-19 16:15:22 -0400
commitc31362708f26397dd20818ab780a5180e257d5a7 (patch)
tree0ed6f50d4f1135ffac585bf6500241bcf9c1c67f /jstests/auth/auth_mechanisms_parsing.js
parent145f4d0e1e738833f4ea1d0cd8e825088f885995 (diff)
downloadmongo-c31362708f26397dd20818ab780a5180e257d5a7.tar.gz
SERVER-41152 strip white space from auth mechanisms
Diffstat (limited to 'jstests/auth/auth_mechanisms_parsing.js')
-rw-r--r--jstests/auth/auth_mechanisms_parsing.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/jstests/auth/auth_mechanisms_parsing.js b/jstests/auth/auth_mechanisms_parsing.js
new file mode 100644
index 00000000000..72f906b3c68
--- /dev/null
+++ b/jstests/auth/auth_mechanisms_parsing.js
@@ -0,0 +1,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);
+}());