Add saslUsername and saslPassword options#80
Open
emersonveenstra wants to merge 1 commit intomatrix-org:masterfrom
emersonveenstra:sasl-options
Open
Add saslUsername and saslPassword options#80emersonveenstra wants to merge 1 commit intomatrix-org:masterfrom emersonveenstra:sasl-options
emersonveenstra wants to merge 1 commit intomatrix-org:masterfrom
emersonveenstra:sasl-options
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 <git@emersonveenstra.net>
Half-Shot
requested changes
Aug 5, 2021
Half-Shot
left a comment
There was a problem hiding this comment.
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.
| sasl?: boolean; | ||
| saslType?: 'PLAIN'|'EXTERNAL'; | ||
| saslUsername?: string|null; | ||
| saslPassword?: string|null; |
There was a problem hiding this comment.
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.
| if (message.args[0] !== '+') { | ||
| return; | ||
| } | ||
| if (!this.opt.saslUsername || !this.opt.saslPassword) { |
There was a problem hiding this comment.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This enables bots to have separate fields for SASL authentication,
instead of using username/password for two different things.
Signed off by Emerson Veenstra git@emersonveenstra.net