Skip to content

Commit ccd5854

Browse files
committed
test(NODE-4338): refactor auth prose tests
1 parent 68e5d67 commit ccd5854

File tree

4 files changed

+362
-433
lines changed

4 files changed

+362
-433
lines changed

src/cmap/auth/scram.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ class ScramSHA extends AuthProvider {
6464
}
6565

6666
function cleanUsername(username: string) {
67-
return username.replace('=', '=3D').replace(',', '=2C');
67+
// return username.replace('=', '=3D').replace(',', '=2C');
68+
return username;
6869
}
6970

7071
function clientFirstMessageBare(username: string, nonce: Buffer) {
@@ -212,7 +213,7 @@ function parsePayload(payload: Binary) {
212213
const dict: Document = {};
213214
const parts = payloadStr.split(',');
214215
for (let i = 0; i < parts.length; i++) {
215-
const valueParts = parts[i].split('=');
216+
const valueParts = (parts[i].match(/^([^=]*)=(.*)$/) ?? []).slice(1);
216217
dict[valueParts[0]] = valueParts[1];
217218
}
218219
return dict;

0 commit comments

Comments
 (0)