Skip to content

Commit f09e388

Browse files
committed
MONGO-CR -> MONGODB-CR (spec change)
1 parent 902c1d6 commit f09e388

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

pymongo/auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from pymongo.errors import OperationFailure
3232

3333

34-
MECHANISMS = ('MONGO-CR', 'GSSAPI')
34+
MECHANISMS = ('MONGODB-CR', 'GSSAPI')
3535
"""The authentication mechanisms supported by PyMongo."""
3636

3737

@@ -142,7 +142,7 @@ def _authenticate_gssapi(username, sock_info, cmd_func):
142142

143143

144144
def _authenticate_mongo_cr(username, password, source, sock_info, cmd_func):
145-
"""Authenticate using MONGO-CR.
145+
"""Authenticate using MONGODB-CR.
146146
"""
147147
# Get a nonce
148148
response, _ = cmd_func(sock_info, source, {'getnonce': 1})

pymongo/database.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ def remove_user(self, name):
650650
self.system.users.remove({"user": name}, **self._get_wc_override())
651651

652652
def authenticate(self, name, password=None,
653-
source=None, mechanism='MONGO-CR'):
653+
source=None, mechanism='MONGODB-CR'):
654654
"""Authenticate to use this database.
655655
656656
Raises :class:`TypeError` if either `name` or `password` is not
@@ -688,7 +688,7 @@ def authenticate(self, name, password=None,
688688
specified the current database is used.
689689
- `mechanism` (optional): See
690690
:data:`~pymongo.auth.MECHANISMS` for options.
691-
Defaults to MONGO-CR (Mongo Challenge Response protocol)
691+
Defaults to MONGODB-CR (MongoDB Challenge Response protocol)
692692
693693
.. mongodoc:: authenticate
694694
"""

pymongo/mongo_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def __init__(self, host=None, port=None, max_pool_size=10,
274274
"ignored. If you wish to authenticate to %s, you "
275275
"must provide a username and password." % (db_name,))
276276
if username:
277-
mechanism = options.get('authmechanism', 'MONGO-CR')
277+
mechanism = options.get('authmechanism', 'MONGODB-CR')
278278
if mechanism == 'GSSAPI':
279279
source = '$external'
280280
else:

pymongo/mongo_replica_set_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ def __init__(self, hosts_or_uri=None, max_pool_size=10,
464464
"ignored. If you wish to authenticate to %s, you "
465465
"must provide a username and password." % (db_name,))
466466
if username:
467-
mechanism = options.get('authmechanism', 'MONGO-CR')
467+
mechanism = options.get('authmechanism', 'MONGODB-CR')
468468
if mechanism == 'GSSAPI':
469469
source = '$external'
470470
else:

test/test_uri_parser.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ def test_split_options(self):
128128
self.assertEqual({'fsync': False}, split_options('fsync=false'))
129129
self.assertEqual({'authmechanism': 'GSSAPI'},
130130
split_options('authMechanism=GSSAPI'))
131-
self.assertEqual({'authmechanism': 'MONGO-CR'},
132-
split_options('authMechanism=MONGO-CR'))
131+
self.assertEqual({'authmechanism': 'MONGODB-CR'},
132+
split_options('authMechanism=MONGODB-CR'))
133133
self.assertEqual({'authsource': 'foobar'}, split_options('authSource=foobar'))
134134
# maxPoolSize isn't yet a documented URI option.
135135
self.assertRaises(ConfigurationError, split_options, 'maxpoolsize=50')
@@ -285,29 +285,29 @@ def test_parse_uri(self):
285285

286286
# Various authentication tests
287287
res = copy.deepcopy(orig)
288-
res['options'] = {'authmechanism': 'MONGO-CR'}
288+
res['options'] = {'authmechanism': 'MONGODB-CR'}
289289
res['username'] = 'user'
290290
res['password'] = 'password'
291291
self.assertEqual(res,
292292
parse_uri("mongodb://user:password@localhost/"
293-
"?authMechanism=MONGO-CR"))
293+
"?authMechanism=MONGODB-CR"))
294294

295295
res = copy.deepcopy(orig)
296-
res['options'] = {'authmechanism': 'MONGO-CR', 'authsource': 'bar'}
296+
res['options'] = {'authmechanism': 'MONGODB-CR', 'authsource': 'bar'}
297297
res['username'] = 'user'
298298
res['password'] = 'password'
299299
res['database'] = 'foo'
300300
self.assertEqual(res,
301301
parse_uri("mongodb://user:password@localhost/foo"
302-
"?authSource=bar;authMechanism=MONGO-CR"))
302+
"?authSource=bar;authMechanism=MONGODB-CR"))
303303

304304
res = copy.deepcopy(orig)
305-
res['options'] = {'authmechanism': 'MONGO-CR'}
305+
res['options'] = {'authmechanism': 'MONGODB-CR'}
306306
res['username'] = 'user'
307307
res['password'] = ''
308308
self.assertEqual(res,
309309
parse_uri("mongodb://user:@localhost/"
310-
"?authMechanism=MONGO-CR"))
310+
"?authMechanism=MONGODB-CR"))
311311

312312
res = copy.deepcopy(orig)
313313
res['username'] = '[email protected]'

0 commit comments

Comments
 (0)