From af918ba5b85aae1fc0b73141fd14815f6962a4ec Mon Sep 17 00:00:00 2001 From: malefici Date: Wed, 29 Jan 2025 15:05:33 +0200 Subject: [PATCH 1/2] Update codes.js SASL message codes. --- lib/codes.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/codes.js b/lib/codes.js index 4fc01feb..0874b62b 100644 --- a/lib/codes.js +++ b/lib/codes.js @@ -510,5 +510,30 @@ module.exports = { 502: { name: 'err_usersdontmatch', type: 'error' + }, + // If authentication is successful, a 900 and 903 numeric will be sent. + 900: { + name: 'rpl_loggedas', + type: 'reply' + }, + 903: { + name: 'rpl_authenticationsuccessful', + type: 'reply' + }, + // If authentication fails, a 904 or 905 numeric will be sent and the client MAY retry + // from the AUTHENTICATE command. + 904: { + name: 'err_authenticationfailed', // dunno know what may be here + type: 'error' + }, + 905: { + name: 'err_authenticationfailed', + type: 'error' + }, + // If the client attempts to issue the AUTHENTICATE command after already authenticating + // successfully, the server MUST reject it with a 907 numeric. + 907: { + name: 'err_alreadyloggedintoanaccount', + type: 'error' } }; From d27488825715886cce2e2b8880d0b619cd9dc079 Mon Sep 17 00:00:00 2001 From: malefici Date: Wed, 29 Jan 2025 15:21:16 +0200 Subject: [PATCH 2/2] Full list of SASL replies and errors --- lib/codes.js | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/lib/codes.js b/lib/codes.js index 0874b62b..e2299218 100644 --- a/lib/codes.js +++ b/lib/codes.js @@ -511,29 +511,40 @@ module.exports = { name: 'err_usersdontmatch', type: 'error' }, - // If authentication is successful, a 900 and 903 numeric will be sent. 900: { - name: 'rpl_loggedas', + name: 'rpl_loggedin', type: 'reply' }, + 901: { + name: 'rpl_loggedout', + type: 'reply' + }, + 902: { + name: 'err_nicklocked', + type: 'error' + }, 903: { - name: 'rpl_authenticationsuccessful', + name: 'rpl_saslsuccess', type: 'reply' }, - // If authentication fails, a 904 or 905 numeric will be sent and the client MAY retry - // from the AUTHENTICATE command. 904: { - name: 'err_authenticationfailed', // dunno know what may be here + name: 'err_saslfailed', type: 'error' }, 905: { - name: 'err_authenticationfailed', + name: 'err_sasltoolong', + type: 'error' + }, + 906: { + name: 'err_saslaborted', type: 'error' }, - // If the client attempts to issue the AUTHENTICATE command after already authenticating - // successfully, the server MUST reject it with a 907 numeric. 907: { - name: 'err_alreadyloggedintoanaccount', + name: 'err_saslalready', + type: 'error' + }, + 908: { + name: 'rpl_saslmechs', type: 'error' } };