From ea8489c2b2ad6ceb4ec0ff470e71bae482fc1561 Mon Sep 17 00:00:00 2001 From: Pavel Trakhtman Date: Sat, 24 Oct 2020 07:52:04 -0500 Subject: [PATCH] Added user_id property to the session object (#87) --- almdrlib/session.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/almdrlib/session.py b/almdrlib/session.py index dedb910..63bc9fb 100644 --- a/almdrlib/session.py +++ b/almdrlib/session.py @@ -153,6 +153,7 @@ def _authenticate(self): self._token = "" self._account_id = "" self._account_name = "" + self._user_id = "" return logger.info( f"Authenticating '{self._access_key_id}' " + @@ -167,6 +168,7 @@ def _authenticate(self): auth_info = response.json() account_info = auth_info["authentication"]["account"] self._token = auth_info["authentication"]["token"] + self._user_id = auth_info["authentication"]["user"]["id"] logger.info(f'Authenticated user {auth_info["authentication"]["user"]["id"]}') except requests.exceptions.HTTPError as e: @@ -359,3 +361,7 @@ def global_endpoint_url(self): @property def token(self): return self._token + + @property + def user_id(self): + return self._user_id