Include domain info when creating identity token

Include the project domain info (name and ID) when creating an identity
token that's associated with a RequestContext. This ensures the keystone
v3 auth plugin will be used whenever possible. Without the domain info,
the v2 plugin would be the only possible choice.

Closes-Bug: #1733898
Change-Id: I8b177725db71002d8eca835a7d5367d7911cf347
This commit is contained in:
Alan Bishop 2017-11-22 10:47:56 -05:00
parent ac4fc22681
commit aa0216d66e

View File

@ -172,7 +172,10 @@ class BarbicanKeyManager(key_manager.KeyManager):
return identity.Token(
auth_url=self.conf.barbican.auth_endpoint,
token=context.auth_token,
project_id=context.tenant)
project_id=context.project_id,
project_name=context.project_name,
project_domain_id=context.project_domain_id,
project_domain_name=context.project_domain_name)
else:
msg = _("context must be of type KeystonePassword, "
"KeystoneToken, or RequestContext.")