Pass target insecure flag to msitral service
In case of mistral client shall use insecure https connection towards cloud then other OpenStack clients shall use insecure connection towards target cloud. To complete that mistralclient shall pass the X-Target-Insecure header to the mistral service. Change-Id: Idf93d968d81ae6748f89ebdf304f4db7f79a4503
This commit is contained in:
parent
c3a78c1972
commit
a7bf138e71
@ -35,6 +35,7 @@ TARGET_AUTH_TOKEN = 'target_auth_token'
|
||||
TARGET_AUTH_URI = 'target_auth_url'
|
||||
TARGET_PROJECT_ID = 'target_project_id'
|
||||
TARGET_USER_ID = 'target_user_id'
|
||||
TARGET_INSECURE = 'target_insecure'
|
||||
TARGET_SERVICE_CATALOG = 'target_service_catalog'
|
||||
TARGET_REGION_NAME = 'target_region_name'
|
||||
TARGET_USER_DOMAIN_NAME = 'target_user_domain_name'
|
||||
@ -70,6 +71,7 @@ class HTTPClient(object):
|
||||
self.target_project_id = kwargs.get(TARGET_PROJECT_ID)
|
||||
self.target_service_catalog = kwargs.get(TARGET_SERVICE_CATALOG)
|
||||
self.target_region_name = kwargs.get(TARGET_REGION_NAME)
|
||||
self.target_insecure = kwargs.get(TARGET_INSECURE)
|
||||
self.target_user_domain_name = kwargs.get(TARGET_USER_DOMAIN_NAME)
|
||||
self.target_project_domain_name = kwargs.get(
|
||||
TARGET_PROJECT_DOMAIN_NAME
|
||||
@ -158,6 +160,9 @@ class HTTPClient(object):
|
||||
if self.target_user_id:
|
||||
headers['X-Target-User-Id'] = self.target_user_id
|
||||
|
||||
if self.target_insecure:
|
||||
headers['X-Target-Insecure'] = self.target_insecure
|
||||
|
||||
if self.target_region_name:
|
||||
headers['X-Target-Region-Name'] = self.target_region_name
|
||||
|
||||
|
@ -139,6 +139,7 @@ class HTTPClientTest(base.BaseTestCase):
|
||||
target_user_id = 'target_user'
|
||||
target_project_id = 'target_project'
|
||||
target_service_catalog = 'this should be there'
|
||||
target_insecure = 'target insecure'
|
||||
target_region = 'target region name'
|
||||
target_user_domain_name = 'target user domain name'
|
||||
target_project_domain_name = 'target project domain name'
|
||||
@ -155,7 +156,8 @@ class HTTPClientTest(base.BaseTestCase):
|
||||
target_service_catalog=target_service_catalog,
|
||||
target_region_name=target_region,
|
||||
target_user_domain_name=target_user_domain_name,
|
||||
target_project_domain_name=target_project_domain_name
|
||||
target_project_domain_name=target_project_domain_name,
|
||||
target_insecure=target_insecure
|
||||
)
|
||||
|
||||
target_client.get(API_URL)
|
||||
@ -166,6 +168,7 @@ class HTTPClientTest(base.BaseTestCase):
|
||||
|
||||
headers["X-Target-Auth-Uri"] = target_auth_url
|
||||
headers["X-Target-Auth-Token"] = target_auth_token
|
||||
headers["X-Target-Insecure"] = target_insecure
|
||||
headers["X-Target-User-Id"] = target_user_id
|
||||
headers["X-Target-Project-Id"] = target_project_id
|
||||
headers["X-Target-Region-Name"] = target_region
|
||||
|
Loading…
Reference in New Issue
Block a user