Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
NODE-927 fixes issue where authentication was performed against arbit…
Browse files Browse the repository at this point in the history
…er instances.
  • Loading branch information
christkv committed Feb 10, 2017
1 parent a73ac53 commit fb6747d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions HISTORY.md
@@ -1,3 +1,8 @@
2.1.8
----------------
* NODE-925 ensure we reschedule operations while pool is < poolSize while pool is growing and there are no connnections with not currently performing work.
* NODE-927 fixes issue where authentication was performed against arbiter instances.

2.1.7 2017-01-24
----------------
* NODE-919 ReplicaSet connection does not close immediately (Issue #156).
Expand Down
7 changes: 6 additions & 1 deletion lib/topologies/replset.js
Expand Up @@ -83,7 +83,7 @@ var handlers = ['connect', 'close', 'error', 'timeout', 'parseError'];
* @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types.
* @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers.
* @param {number} [options.pingInterval=5000] Ping interval to check the response time to the different servers
* @param {number} [options.localThresholdMS=15] Cutoff latency point in MS for MongoS proxy selection
* @param {number} [options.localThresholdMS=15] Cutoff latency point in MS for Replicaset member selection
* @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
* @return {ReplSet} A cursor instance
* @fires ReplSet#connect
Expand Down Expand Up @@ -603,6 +603,11 @@ function applyAuthenticationContexts(self, server, callback) {
return callback();
}

// Do not apply any auth contexts if it's an arbiter
if(server.lastIsMaster() && server.lastIsMaster().arbiterOnly) {
return callback();
}

// Copy contexts to ensure no modificiation in the middle of
// auth process.
var authContexts = self.s.authenticationContexts.slice(0);
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "mongodb-core",
"version": "2.1.7",
"version": "2.1.8",
"description": "Core MongoDB driver functionality, no bells and whistles and meant for integration not end applications",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit fb6747d

Please sign in to comment.