Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 2b36e852 authored by Luke Bertot's avatar Luke Bertot
Browse files

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

parent 96269849
No related branches found
No related tags found
1 merge request!3Users can now specify the default user when using an SSL client certificate.
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment