Skip to content

Commit 8433095

Browse files
committed
pr feedback: updated error language and clarified SCRAM-SHA-1 info in docs
1 parent 54f003f commit 8433095

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,14 @@ Additionally, our Typescript types are compatible with the ECMAScript standard f
103103

104104
#### Running in Custom Runtimes
105105

106-
We are working on removing NodeJS as a dependency of the driver, so that in the future it will be possible to use the drive in non-Node environments.
106+
We are working on removing NodeJS as a dependency of the driver, so that in the future it will be possible to use the driver in non-Node environments.
107107
This work is currently in progress, and if you're curious, this is [our first runtime adapter commit](https://github.com/mongodb/node-mongodb-native/commit/d2ad07f20903d86334da81222a6df9717f76faaa).
108108

109109
Some things to keep in mind if you are using a non-Node runtime:
110110

111111
1. Users of Webpack/Vite may need to prevent `crypto` polyfill injection.
112-
2. Auth mechanism `SCRAM-SHA-1` has a hard dependency on NodeJS and is not supported in FIPS mode.
112+
2. Auth mechanism `SCRAM-SHA-1` has a hard dependency on NodeJS.
113+
3. Auth mechanism `SCRAM-SHA-1` is not supported in FIPS mode.
113114

114115
## Installation
115116

src/cmap/auth/scram.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,12 @@ function passwordDigest(username: string, password: string) {
234234
// eslint-disable-next-line @typescript-eslint/no-require-imports
235235
nodeCrypto = require('crypto');
236236
} catch (e) {
237-
throw new MongoRuntimeError('global crypto is required for SCRAM-SHA-1 authentication', {
238-
cause: e
239-
});
237+
throw new MongoRuntimeError(
238+
'Node.js crypto module is required for SCRAM-SHA-1 authentication',
239+
{
240+
cause: e
241+
}
242+
);
240243
}
241244

242245
try {

0 commit comments

Comments
 (0)