get verify option from session secure option

Change-Id: If1bed7f76d6c77c0bb08f5831e67291362bb2704
This commit is contained in:
Eyal 2017-07-13 15:56:58 +03:00
parent 4906f4c749
commit 989a0419cc
1 changed files with 3 additions and 1 deletions

View File

@ -95,8 +95,10 @@ class VitrageKeycloakPlugin(plugin.BaseAuthPlugin):
self.endpoint = endpoint
self.auth_url = auth_url
self.client_id = openid_client_id
self.verify = True
def get_headers(self, session, **kwargs):
self.verify = session.verify
return {'X-Auth-Token': self._authenticate_keycloak(),
'x-user-id': self.username,
'x-project-id': self.realm_name}
@ -118,7 +120,7 @@ class VitrageKeycloakPlugin(plugin.BaseAuthPlugin):
resp = requests.post(keycloak_endpoint,
data=body,
verify=True)
verify=self.verify)
try:
resp.raise_for_status()