1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

feature #795: Add hash_passwords option

This commit is contained in:
Daniel Molina 2011-09-21 19:09:23 +02:00
parent 1ae44ee2bc
commit 9e3c3cb898

View File

@ -5,6 +5,10 @@ module BasicCloudAuth
if auth.provided? && auth.basic?
username, password = auth.credentials
if @conf[:hash_passwords]
password = Digest::SHA1.hexdigest(password)
end
one_pass = get_password(username)
if one_pass && one_pass == password
@token = "#{username}:#{password}"