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

bug #847: Adds option to filter public users in CloudAuth. Fixes paths for auth's files

This commit is contained in:
Ruben S. Montero 2011-10-25 22:10:50 +02:00
parent c7584ad602
commit 898750a790
5 changed files with 12 additions and 6 deletions

View File

@ -86,7 +86,7 @@ class CloudAuth
@token_expiration_time
end
def get_password(username)
def get_password(username, non_public_user=false)
token = @server_auth.login_token(expiration_time)
@oneadmin_client ||= OpenNebula::Client.new(token, @conf[:one_xmlrpc])
@ -99,6 +99,12 @@ class CloudAuth
end
end
return @user_pool["USER[NAME=\"#{username}\"]/PASSWORD"]
if non_public_user == true
xp="USER[NAME=\"#{username}\" and AUTH_DRIVER!=\"public\"]/PASSWORD"
else
xp="USER[NAME=\"#{username}\"]/PASSWORD"
end
return @user_pool[xp]
end
end

View File

@ -21,7 +21,7 @@ module SunstoneCloudAuth
if auth.provided? && auth.basic?
username, password = auth.credentials
one_pass = get_password(username)
one_pass = get_password(username, true)
if one_pass && one_pass == Digest::SHA1.hexdigest(password)
return username

View File

@ -28,7 +28,7 @@ else
RUBY_LIB_LOCATION = ONE_LOCATION+"/lib/ruby"
CONFIGURATION_FILE = ONE_LOCATION+"/etc/econe.conf"
TEMPLATE_LOCATION = ONE_LOCATION+"/etc/ec2query_templates"
EC2_AUTH = ONE_LOCATION + "/etc/one/auth/ec2_auth"
EC2_AUTH = ONE_LOCATION + "/etc/auth/ec2_auth"
end
VIEWS_LOCATION = RUBY_LIB_LOCATION + "/cloud/econe/views"

View File

@ -33,7 +33,7 @@ else
RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby"
TEMPLATE_LOCATION=ONE_LOCATION+"/etc/occi_templates"
CONFIGURATION_FILE = ONE_LOCATION+"/etc/occi-server.conf"
OCCI_AUTH = ONE_LOCATION + "/etc/one/auth/occi_auth"
OCCI_AUTH = ONE_LOCATION + "/etc/auth/occi_auth"
end
$: << RUBY_LIB_LOCATION

View File

@ -32,7 +32,7 @@ else
RUBY_LIB_LOCATION = ONE_LOCATION+"/lib/ruby"
CONFIGURATION_FILE = ONE_LOCATION+"/etc/sunstone-server.conf"
PLUGIN_CONFIGURATION_FILE = ONE_LOCATION+"/etc/sunstone-plugins.yaml"
SUNSTONE_AUTH = ONE_LOCATION + "/etc/one/auth/sunstone_auth"
SUNSTONE_AUTH = ONE_LOCATION + "/etc/auth/sunstone_auth"
end
SUNSTONE_ROOT_DIR = File.dirname(__FILE__)