mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-19 03:12:55 +09:00
feature #2500: option to encode credentials in sunstone
This commit is contained in:
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)
|
||||
|
||||
|
||||
@@ -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
|
||||
################################################################################
|
||||
|
||||
Reference in new issue
Block a user