Skip to content

Commit

Permalink
fix(encryption): respect bypassAutoEncryption
Browse files Browse the repository at this point in the history
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
  • Loading branch information
daprahamian committed Nov 13, 2019
1 parent 52cfcd2 commit e927499
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/core/wireprotocol/command.js
Expand Up @@ -145,7 +145,9 @@ function supportsOpMsg(topologyOrServer) {
}

function _cryptCommand(server, ns, cmd, options, callback) {
const shouldBypassAutoEncryption = !!server.s.options.bypassAutoEncryption;
const shouldBypassAutoEncryption = !!(
server.s.options.autoEncryption && server.s.options.autoEncryption.bypassAutoEncryption
);
const autoEncrypter = server.autoEncrypter;
function commandResponseHandler(err, response) {
if (err || response == null) {
Expand Down

0 comments on commit e927499

Please sign in to comment.