Skip to content

Commit

Permalink
Added user_id property to the session object (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrakhtman authored Oct 24, 2020
1 parent e8919e5 commit ea8489c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions almdrlib/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}' " +
Expand All @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit ea8489c

Please sign in to comment.