summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Castro Leon <jose.castro.leon@cern.ch>2014-09-11 14:56:14 -0400
committerAdam Young <ayoung@redhat.com>2014-09-11 14:59:52 -0400
commitcde863efcf654a0016d325fe3d9c0a4c97ba9ebe (patch)
tree2d707fe47a65e91f3dfa40159751e73e5f68993a
parenta9367009ad3ab1da003bb5e43d1ae1e3ecfee2a3 (diff)
downloadpython-keystoneclient-cde863efcf654a0016d325fe3d9c0a4c97ba9ebe.tar.gz
Pass kwargs to auth plugins
Auth plugins must sometimes affect the Headers and other portions of the network setup. Examples: Kerberos needs to set the negotiate header. X509 to provide the client certificate. This change makes that capability available to the Auth plugins. Those plugins will live in separate repositories. There are no dependent patches for it in this repository. This was split out by Adam Young from the Kerberos Client patch written by Jose Castro Leon Change-Id: Iab7287888e4b3f199b9035c1a24ac43639b5027b
-rw-r--r--keystoneclient/auth/identity/v3.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/keystoneclient/auth/identity/v3.py b/keystoneclient/auth/identity/v3.py
index cd4f9c5..99d7562 100644
--- a/keystoneclient/auth/identity/v3.py
+++ b/keystoneclient/auth/identity/v3.py
@@ -73,9 +73,13 @@ class Auth(base.BaseIdentityPlugin):
headers = {'Accept': 'application/json'}
body = {'auth': {'identity': {}}}
ident = body['auth']['identity']
+ rkwargs = {}
for method in self.auth_methods:
- name, auth_data = method.get_auth_data(session, self, headers)
+ name, auth_data = method.get_auth_data(session,
+ self,
+ headers,
+ request_kwargs=rkwargs)
ident.setdefault('methods', []).append(name)
ident[name] = auth_data
@@ -112,7 +116,7 @@ class Auth(base.BaseIdentityPlugin):
_logger.debug('Making authentication request to %s', self.token_url)
resp = session.post(self.token_url, json=body, headers=headers,
- authenticated=False, log=False)
+ authenticated=False, log=False, **rkwargs)
try:
resp_data = resp.json()['token']