puppet-mongodb
puppet-mongodb copied to clipboard
Fix password changing for SHA-1 mechanism #649
Pull Request (PR) description
Added the mechanism parameter for the password_hash command
def password_hash=(_value)
if db_ismaster
command = {
updateUser: @resource[:username],
pwd: @resource[:password_hash],
digestPassword: false
}
command[:mechanisms] = @resource[:auth_mechanism] == :scram_sha_1 ? ['SCRAM-SHA-1'] : ['SCRAM-SHA-256']
mongo_eval("db.runCommand(#{command.to_json})", @resource[:database])
else
Puppet.warning 'User password operations are available only from master host'
end
end
Changed unit test for mongodb_user due to new expected line generated for password_hash command.
This Pull Request (PR) fixes the following issues
Fixes #649