-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add saslUsername and saslPassword options #80
base: master
Are you sure you want to change the base?
Conversation
This enables bots to have separate fields for SASL authentication, instead of using username/password for two different things. Signed off by Emerson Veenstra <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good feature to have, just a few nits. Would be good to get a changelog item since we're being grown up and using those now.
@@ -87,6 +87,8 @@ export interface IrcClientOpts { | |||
floodProtectionDelay?: number; | |||
sasl?: boolean; | |||
saslType?: 'PLAIN'|'EXTERNAL'; | |||
saslUsername?: string|null; | |||
saslPassword?: string|null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think this is great, but I'd actually turn sasl
into an object and make it include the type,username and password as keys. Just to make this a bit less messy. It's a breaking change, but worthwhile I feel.
@@ -843,13 +849,16 @@ export class Client extends EventEmitter { | |||
if (message.args[0] !== '+') { | |||
return; | |||
} | |||
if (!this.opt.saslUsername || !this.opt.saslPassword) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I worry this might be a silent error. If we've missed the username or password but expect to use SASL, that feels like a fail. Perhaps we should add this check to the PLAIN
case statement and throw?
This enables bots to have separate fields for SASL authentication,
instead of using username/password for two different things.
Signed off by Emerson Veenstra [email protected]