Skip to content

fix(NODE-5289): prevent scram auth from throwing TypeError if saslprep is not a function#3727

Merged
nbbeeken merged 4 commits intomainfrom
NODE-5289-handle-null-saslprep
Jun 16, 2023
Merged

fix(NODE-5289): prevent scram auth from throwing TypeError if saslprep is not a function#3727
nbbeeken merged 4 commits intomainfrom
NODE-5289-handle-null-saslprep

Conversation

@baileympearson
Copy link
Copy Markdown
Contributor

@baileympearson baileympearson commented Jun 15, 2023

Description

What is changing?

Is there new documentation needed for these changes?

What is the motivation for this change?

saslprep "is not a function" fix for bundled deployments

saslprep is an optional dependency used to perform Stringprep Profile for User Names and Passwords for SCRAM-SHA-256 authentication. The saslprep library breaks when it is bundled, causing the driver to throw TypeErrors.

This release includes a fix that prevents the driver throwing TypeErrors when attempting to use saslprep in bundled environments.

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@baileympearson baileympearson force-pushed the NODE-5289-handle-null-saslprep branch from b1e90dc to d6899a3 Compare June 15, 2023 20:35
@baileympearson baileympearson changed the title DI sasl prep and handle non-function value fix(NODE-5289): prevent scram auth from throwing TypeError if saslprep is not a function Jun 15, 2023
@nbbeeken nbbeeken self-assigned this Jun 15, 2023
@nbbeeken nbbeeken self-requested a review June 15, 2023 21:29
Comment thread src/cmap/auth/scram.ts Outdated
Comment thread test/integration/auth/scram_sha_256.test.ts Outdated
Comment thread test/mongodb.ts Outdated
Comment thread src/cmap/auth/scram.ts Outdated
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Jun 15, 2023
Comment thread test/integration/auth/scram_sha_256.test.ts
@baileympearson baileympearson requested a review from nbbeeken June 16, 2023 15:16
Comment thread test/integration/auth/scram_sha_256.test.ts
Comment thread test/mongodb.ts Outdated
@baileympearson baileympearson marked this pull request as ready for review June 16, 2023 15:32
@baileympearson baileympearson requested a review from nbbeeken June 16, 2023 15:32
Comment thread test/integration/auth/scram_sha_256.test.ts Outdated
@nbbeeken nbbeeken added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Jun 16, 2023
Co-authored-by: Neal Beeken <neal.beeken@mongodb.com>
@baileympearson baileympearson requested a review from nbbeeken June 16, 2023 19:49
@nbbeeken nbbeeken merged commit e006347 into main Jun 16, 2023
@nbbeeken nbbeeken deleted the NODE-5289-handle-null-saslprep branch June 16, 2023 21:07
baileympearson added a commit that referenced this pull request Jun 16, 2023
baileympearson added a commit that referenced this pull request Jun 16, 2023
malikj2000 pushed a commit that referenced this pull request Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team Review Needs review from team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants