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 support to SASL SCRAM #72

Merged
merged 20 commits into from
Jun 7, 2018
Merged

Add support to SASL SCRAM #72

merged 20 commits into from
Jun 7, 2018

Conversation

tulios
Copy link
Owner

@tulios tulios commented Jun 5, 2018

Closes #71

@tulios tulios requested a review from Nevon June 5, 2018 22:40
Copy link
Collaborator

@Nevon Nevon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this was a nice and simple PR. No complicated logic anywhere to be found.

@@ -313,6 +319,11 @@ module.exports = class Connection {

// The full payload is loaded, erase the temporary buffer
this.buffer = Buffer.alloc(0)

if (this.authHandlers && this.authExpectResponse) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove the second condition


const finalMessageWithoutProof = this.finalMessageWithoutProof(clientMessageResponse)
const clientProof = await this.clientProof(clientMessageResponse)
const finalMessage = `${finalMessageWithoutProof},p=${clientProof}`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this p, r, n etc. is reminding me of node-postgres. I would suggest to extract them to named constants so that I don't have to read the RFC to understand what they all mean.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think naming this different will help; it's better to have a close mapping to the RFC. This is also "standardized", anyone reading SCRAM code will easily find the components of the message instead of parsing our understanding of it. WDYT?

@Nevon Nevon merged commit f225ee8 into master Jun 7, 2018
@Nevon Nevon deleted the add-support-to-sasl-scram branch June 7, 2018 12:37
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