From 5698eda65d99786a9668bd00e49b5a158be90c35 Mon Sep 17 00:00:00 2001 From: Bertrand Souville Date: Mon, 2 Oct 2017 16:27:15 +0200 Subject: Added support for Keystone v3 JIRA: PROMISE-80 Modified Promise shim-layer as well Change-Id: I82340a6af5c3e6056e77323ca5c44ecdf4e109b6 Signed-off-by: Bertrand Souville (cherry picked from commit a8cd506d6759833231b1b8806082d793faf0997a) --- source/spec/promise-intents.coffee | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'source/spec') 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 -> -- cgit 1.2.3-korg