Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add saslUsername and saslPassword options #80

wants to merge 1 commit into from

Conversation

emersonveenstra
Copy link

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]

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]>
Copy link

@Half-Shot Half-Shot left a 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;

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) {

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants