-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Leaving a note here as a reminder to take another look at the SASL error handling. At first glance I don't think the errors would bubble up as they're thrown synchronously in the helper functions and the caller does not catch or emit them up to the client.
Lines 4 to 17 in 0acaf9d
| function startSession (mechanisms) { | |
| if (mechanisms.indexOf('SCRAM-SHA-256') === -1) { | |
| throw new Error('SASL: Only mechanism SCRAM-SHA-256 is currently supported') | |
| } | |
| const clientNonce = crypto.randomBytes(18).toString('base64') | |
| return { | |
| mechanism: 'SCRAM-SHA-256', | |
| clientNonce, | |
| response: 'n,,n=*,r=' + clientNonce, | |
| message: 'SASLInitialResponse' | |
| } | |
| } |
Lines 142 to 146 in 0acaf9d
| con.on('authenticationSASL', checkPgPass(function (msg) { | |
| saslSession = sasl.startSession(msg.mechanisms) | |
| con.sendSASLInitialResponseMessage(saslSession.mechanism, saslSession.response) | |
| })) |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels