Skip to content

Commit e927499

Browse files
committed
fix(encryption): respect bypassAutoEncryption
B/c we no longer flatten the autoEncryption options (to avoid a nasty recursive bug when you pass an external keyVault client) we need to check in the right place for the bypassAutoEncryption option
1 parent 52cfcd2 commit e927499

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/core/wireprotocol/command.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ function supportsOpMsg(topologyOrServer) {
145145
}
146146

147147
function _cryptCommand(server, ns, cmd, options, callback) {
148-
const shouldBypassAutoEncryption = !!server.s.options.bypassAutoEncryption;
148+
const shouldBypassAutoEncryption = !!(
149+
server.s.options.autoEncryption && server.s.options.autoEncryption.bypassAutoEncryption
150+
);
149151
const autoEncrypter = server.autoEncrypter;
150152
function commandResponseHandler(err, response) {
151153
if (err || response == null) {

0 commit comments

Comments
 (0)