Skip to content

Instantly share code, notes, and snippets.

@mwhagedorn
Created March 27, 2014 14:31
Show Gist options
  • Save mwhagedorn/9808802 to your computer and use it in GitHub Desktop.
Save mwhagedorn/9808802 to your computer and use it in GitHub Desktop.
Problem with AuthenticateV2.. OSC
module Fog
module OpenStackCommon
module Authentication
module Adapters
module AuthenticatorV2
....
def authenticate(options, connection_options = {})
....
unless service
unless tenant_name
#get_tenant_name returns the first tenant found in the new_connection request that is generated.
#this seems wrong to me, how can you assume that? If the user doesnt give us a tenant how
#can we assume anything at all about which tenant he means.. additionally #new_connection sends a request,
#thats expensive. The whole intent of this whole section is "get me a scoped token". If the user doesnt sent
#us a tenantname, he shouldnt get a scoped token. If he wants a scoped token he should send a tenant, thats the
#OpenStack way...
options[:openstack_tenant] = get_tenant_name(new_connection(uri, connection_options, body))
end
body = request_tokens(options, connection_options)
service = get_service(body, service_type, service_name)
end
....
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment