summaryrefslogtreecommitdiffstats
path: root/source/spec/promise-intents.coffee
diff options
context:
space:
mode:
authorBertrand Souville <souville@docomolab-euro.com>2017-10-02 16:27:15 +0200
committerBertrand Souville <souville@docomolab-euro.com>2017-10-02 16:27:15 +0200
commita8cd506d6759833231b1b8806082d793faf0997a (patch)
treec5f83915a268f2b6d4e1f782b00ee521b9c6f1d8 /source/spec/promise-intents.coffee
parentcd8d36d83af6541dc5f313bee5758548366ff5ff (diff)
Added support for Keystone v3
JIRA: PROMISE-80 Modified Promise shim-layer as well Change-Id: I82340a6af5c3e6056e77323ca5c44ecdf4e109b6 Signed-off-by: Bertrand Souville <souville@docomolab-euro.com>
Diffstat (limited to 'source/spec/promise-intents.coffee')
-rw-r--r--source/spec/promise-intents.coffee27
1 files changed, 19 insertions, 8 deletions
diff --git a/source/spec/promise-intents.coffee b/source/spec/promise-intents.coffee
index afb0e24..4fad0b1 100644
--- a/source/spec/promise-intents.coffee
+++ b/source/spec/promise-intents.coffee
@@ -320,9 +320,19 @@ module.exports =
payload = switch input.get 'provider-type'
when 'openstack'
auth:
- tenantId: input.get 'tenant.id'
- tenantName: input.get 'tenant.name'
- passwordCredentials: input.get 'username', 'password'
+ identity:
+ methods: [ "password" ]
+ password:
+ user:
+ name: input.get 'username'
+ password: input.get 'password'
+ domain:
+ name: input.get 'user-domain-name'
+ scope:
+ project:
+ name: input.get 'project.name'
+ domain:
+ name: input.get 'project.domain-name'
unless payload?
return done 'Sorry, only openstack supported at this time'
@@ -330,7 +340,7 @@ module.exports =
url = input.get 'endpoint'
switch input.get 'strategy'
when 'keystone', 'oauth'
- url += '/tokens' unless /\/tokens$/.test url
+ url += '/auth/tokens' unless /\/tokens$/.test url
providers = @access 'promise.providers'
request
@@ -340,11 +350,12 @@ module.exports =
.end (err, res) =>
if err? or !res.ok then return done res.error
#console.log JSON.stringify res.body, null, 2
- access = res.body.access
+ console.log res.headers
+ console.log res.body.token.catalog
provider = @create 'ResourceProvider',
- token: access?.token?.id
- name: access?.token?.tenant?.name
- provider.invoke 'update', access.serviceCatalog
+ token: res.headers['x-subject-token']
+ name: res.body.token.project.name
+ provider.invoke 'update', res.body.token.catalog
.then (res) ->
res.save()
.then ->