feature #2500: option to encode credentials in sunstone

This commit is contained in:
Javi Fontan committed 2013-11-27 13:14:34 +01:00
1 parent 080a8031e0
commit 8b71eb6a29
2 files changed
+18

No files matched your search

@@ -14,6 +14,8 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'uri'
module OpenNebulaCloudAuth
#
@@ -33,6 +35,17 @@ module OpenNebulaCloudAuth
if auth.provided? && auth.basic?
username, password = auth.credentials
if @conf[:encode_user_password]
if defined?(URI::Parser)
parser=URI::Parser.new
else
parser=URI
end
username=parser.escape(username)
password=parser.escape(password)
end
client = OpenNebula::Client.new("#{username}:#{password}", @conf[:one_xmlrpc])
user = OpenNebula::User.new_with_id(OpenNebula::User::SELF, client)
+5
View File
@@ -71,6 +71,11 @@
#
:core_auth: cipher
# For LDAP auth. Encode credentials sent to OpenNebula. Turns espaces into %20.
# This only works with "opennebula" auth.
#
#:encode_user_password: true
################################################################################
# UI Settings
################################################################################