Skip to content

Commit 24493de

Browse files
committed
updated mongodb-core to 2.1.6
1 parent 25b2fca commit 24493de

File tree

3 files changed

+81
-5
lines changed

3 files changed

+81
-5
lines changed

HISTORY.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1+
2.2.21 2017-01-13
2+
-----------------
3+
* Updated mongodb-core to 2.1.6.
4+
* NODE-908 Keep auth contexts in replset and mongos topology to ensure correct application of authentication credentials when primary is first server to be detected causing an immediate connect event to happen.
5+
16
2.2.20 2017-01-11
27
-----------------
3-
- Updated mongodb-core to 2.1.5 to include bson 1.0.4 and bson-ext 1.0.4 due to Buffer.from being broken in early node 4.x versions.
8+
* Updated mongodb-core to 2.1.5 to include bson 1.0.4 and bson-ext 1.0.4 due to Buffer.from being broken in early node 4.x versions.
49

510
2.2.19 2017-01-03
611
-----------------
7-
- Corrupted Npm release fix.
12+
* Corrupted Npm release fix.
813

914
2.2.18 2017-01-03
1015
-----------------
11-
- Updated mongodb-core to 2.1.4 to fix bson ObjectId toString issue with utils.inspect messing with toString parameters in node 6.
16+
* Updated mongodb-core to 2.1.4 to fix bson ObjectId toString issue with utils.inspect messing with toString parameters in node 6.
1217

1318
2.2.17 2017-01-02
1419
-----------------

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mongodb",
3-
"version": "2.2.20",
3+
"version": "2.2.21",
44
"description": "The official MongoDB driver for Node.js",
55
"main": "index.js",
66
"repository": {
@@ -14,7 +14,7 @@
1414
],
1515
"dependencies": {
1616
"es6-promise": "3.2.1",
17-
"mongodb-core": "2.1.5",
17+
"mongodb-core": "2.1.6",
1818
"readable-stream": "2.1.5"
1919
},
2020
"devDependencies": {

test/functional/authentication_tests.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,73 @@ exports['Should correctly handle replicaset master stepdown and stepup without l
750750
}
751751
}
752752

753+
/**
754+
* @ignore
755+
*/
756+
exports['Should correctly perform nearest read from secondaries without auth fail when priamry is first seed'] = {
757+
metadata: { requires: { topology: ['auth'] } },
758+
759+
// The actual test we wish to run
760+
test: function(configuration, test) {
761+
var Db = configuration.require.Db
762+
, Server = configuration.require.Server
763+
, ReadPreference = configuration.require.ReadPreference
764+
, MongoClient = configuration.require.MongoClient
765+
, ReplSet = configuration.require.ReplSet;
766+
767+
setUp(configuration, function(err, replicasetManager) {
768+
var replSet = new ReplSet( [
769+
new Server( 'localhost', 31000),
770+
new Server( 'localhost', 31001)
771+
],
772+
{rs_name: 'rs', poolSize:1}
773+
);
774+
775+
// Connect
776+
new Db('replicaset_test_auth', replSet, {
777+
w: 1, readPreference: ReadPreference.NEAREST
778+
}).open(function(err, db) {
779+
// Add a user
780+
db.admin().addUser("root", "root", {w:3, wtimeout: 25000}, function(err, result) {
781+
test.equal(null, err);
782+
783+
db.close();
784+
785+
MongoClient.connect('mongodb://root:root@localhost:31000,localhost:31001,localhost:31002/admin?replicaSet=rs&readPreference=nearest', function(err, db) {
786+
test.equal(null, err);
787+
788+
db.collection('replicaset_test_auth').insert({a:1}, {w:1}, function(err, result) {
789+
test.equal(null, err);
790+
791+
db.collection('replicaset_test_auth').findOne({}, function(err) {
792+
test.equal(null, err);
793+
794+
db.collection('replicaset_test_auth').findOne({}, function(err) {
795+
test.equal(null, err);
796+
797+
db.collection('replicaset_test_auth').findOne({}, function(err) {
798+
test.equal(null, err);
799+
800+
db.collection('replicaset_test_auth').findOne({}, function(err) {
801+
test.equal(null, err);
802+
803+
db.close();
804+
805+
replicasetManager.stop().then(function() {
806+
test.done();
807+
});
808+
});
809+
});
810+
});
811+
});
812+
});
813+
});
814+
});
815+
});
816+
})
817+
}
818+
}
819+
753820
/**
754821
* @ignore
755822
*/
@@ -1501,6 +1568,7 @@ exports.shouldCorrectlyAuthAgainstReplicaSetAdminDbUsingMongoClient = {
15011568
, 'localhost', 31000, dbName, 'rs'), function(err, db) {
15021569
// console.log("--------------------------------------------- 3")
15031570
// console.dir(err)
1571+
// console.dir(err)
15041572

15051573
// db.on('all', function(err, db) {
15061574
// console.log("--------------------------------------------- 4")
@@ -1509,11 +1577,14 @@ exports.shouldCorrectlyAuthAgainstReplicaSetAdminDbUsingMongoClient = {
15091577
// Insert document
15101578
db.collection('authcollectiontest').insert({a:1}, {w:3, wtimeout: 25000}, function(err, result) {
15111579
// console.log("--------------------------------------------- 5")
1580+
// console.dir(err)
15121581
test.equal(null, err);
15131582

1583+
// console.log("--------------------------------------------- 5")
15141584
// Find the document
15151585
db.collection('authcollectiontest').find().toArray(function(err, docs) {
15161586
// console.log("--------------------------------------------- 6")
1587+
// console.dir(err)
15171588
// test.equal(null, err);
15181589
test.equal(1, docs.length);
15191590
test.equal(1, docs[0].a);

0 commit comments

Comments
 (0)