Skip to content

Commit 6e4e5b3

Browse files
committed
Implement Cleartext auth
1 parent 70253dd commit 6e4e5b3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/frontend.js

+8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const authNames = {
2525
}
2626

2727
const auths = {
28+
3 : AuthenticationCleartextPassword,
2829
5 : AuthenticationMD5Password,
2930
10: SASL,
3031
11: SASLContinue,
@@ -58,6 +59,13 @@ function connect({ user, database, connection }) {
5859
function auth(type, x, options) {
5960
return (auths[type] || authNotImplemented)(type, x, options) || ''
6061
}
62+
63+
function AuthenticationCleartextPassword(type, x, { pass }) {
64+
return bytes
65+
.p()
66+
.str(pass)
67+
.z(1)
68+
.end()
6169
}
6270

6371
function AuthenticationMD5Password(type, x, { user, pass }) {

0 commit comments

Comments
 (0)