mongodb-mongo 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/mongo/db.rb CHANGED
@@ -161,7 +161,7 @@ module XGen
161
161
  auth['authenticate'] = 1
162
162
  auth['user'] = username
163
163
  auth['nonce'] = nonce
164
- auth['key'] = Digest::MD5.hexdigest("#{nonce}#{username}#{hash_password(password)}")
164
+ auth['key'] = Digest::MD5.hexdigest("#{nonce}#{username}#{hash_password(username, password)}")
165
165
  ok?(db_command(auth))
166
166
  end
167
167
 
@@ -461,8 +461,8 @@ module XGen
461
461
 
462
462
  private
463
463
 
464
- def hash_password(plaintext)
465
- Digest::MD5.hexdigest("mongo#{plaintext}")
464
+ def hash_password(username, plaintext)
465
+ Digest::MD5.hexdigest("#{username}:mongo:#{plaintext}")
466
466
  end
467
467
 
468
468
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'mongo'
3
- s.version = '0.4.2'
3
+ s.version = '0.4.3'
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.summary = 'Simple pure-Ruby driver for the 10gen Mongo DB'
6
6
  s.description = 'A pure-Ruby driver for the 10gen Mongo DB. For more information about Mongo, see http://www.mongodb.org.'
data/tests/test_db.rb CHANGED
@@ -24,7 +24,7 @@ class DBTest < Test::Unit::TestCase
24
24
  @spongebob_password = 'squarepants'
25
25
  @users = @db.collection('system.users')
26
26
  @users.clear
27
- @users.insert(:user => @spongebob, :pwd => @db.send(:hash_password, @spongebob_password))
27
+ @users.insert(:user => @spongebob, :pwd => @db.send(:hash_password, @spongebob, @spongebob_password))
28
28
  end
29
29
 
30
30
  def teardown
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongodb-mongo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Menard