Commit 351d48ea authored by SIMONIN Matthieu's avatar SIMONIN Matthieu

Merge branch 'defaultuser' into 'master'

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

See merge request !3
parents 96269849 2b36e852
Pipeline #120174 passed with stage
in 2 minutes and 56 seconds
......@@ -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