Sha256: 21d17272c3bad5f1db4583a5ade5f0e8ce6f559ee45c3e9b5fbf9abc8582cbef
Contents?: true
Size: 1.33 KB
Versions: 1
Compression:
Stored size: 1.33 KB
Contents
define_request :create_token do anonymous endpoint_type :public api_version :v2 http_method :post link_to 'documentation', 'http://docs.openstack.org/api/openstack-identity-service/2.0/content/POST_authenticate_v2.0_tokens_.html' link_to 'documentation bug', 'https://bugs.launchpad.net/keystone/+bug/1208607' optional_param :username optional_param :password optional_param :tokenId optional_param :tenantName optional_param :tenantId # TODO: Add logic for when session_data is actually an OpenStack # authentication response body and not auth bootstrap information def url url = session_data[:auth_service][:host_uri] url += '/v2.0' if (URI(url).path =~ /^\/?\w+/).nil? url += "/tokens" url end def body p = if params[:tokenId] { auth: { token: { id: params[:tokenId] } } } else { auth: { passwordCredentials: { username: params[:username], password: params[:password] } } } end p[:auth][:tenantName] = params[:tenantName] if params[:tenantName] p[:auth][:tenantId] = params[:tenantId] if params[:tenantId] p end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
aviator-0.0.2 | lib/aviator/openstack/identity/v2/public/create_token.rb |