Commit 2b36e852 authored by BERTOT Luke's avatar BERTOT Luke

Users can now specify the default user when using an SSL client certificate.

parent 96269849
......@@ -63,6 +63,7 @@ class Grid5000(object):
session=None,
sslcert=None,
sslkey=None,
ssluser='anonymous',
**kwargs
):
self._uri = uri
......@@ -75,6 +76,7 @@ class Grid5000(object):
self.client_cert = None
if sslcert is not None:
self.client_ssl = True
self.default_ssl_user = ssluser
if sslkey is not None:
self.client_cert = (sslcert, sslkey)
else:
......@@ -161,8 +163,8 @@ class Grid5000(object):
request_headers["X-Api-User-CN"] = user_id
request_headers["X-Remote-Ident"] = user_id
else:
request_headers["X-Api-User-CN"] = "anonymous"
request_headers["X-Remote-Ident"] = "anonymous"
request_headers["X-Api-User-CN"] = self.default_ssl_user
request_headers["X-Remote-Ident"] = self.default_ssl_user
else:
res["auth"] = self._http_auth
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment