user-context-remote 0.0.85__tar.gz → 0.0.86__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {user_context_remote-0.0.85 → user_context_remote-0.0.86}/PKG-INFO +2 -2
- {user_context_remote-0.0.85 → user_context_remote-0.0.86}/setup.py +3 -3
- {user_context_remote-0.0.85 → user_context_remote-0.0.86}/user_context_remote/src/user_context.py +85 -92
- {user_context_remote-0.0.85 → user_context_remote-0.0.86}/user_context_remote.egg-info/PKG-INFO +2 -2
- {user_context_remote-0.0.85 → user_context_remote-0.0.86}/README.md +0 -0
- {user_context_remote-0.0.85 → user_context_remote-0.0.86}/pyproject.toml +0 -0
- {user_context_remote-0.0.85 → user_context_remote-0.0.86}/setup.cfg +0 -0
- {user_context_remote-0.0.85 → user_context_remote-0.0.86}/user_context_remote/src/__init__.py +0 -0
- {user_context_remote-0.0.85 → user_context_remote-0.0.86}/user_context_remote.egg-info/SOURCES.txt +0 -0
- {user_context_remote-0.0.85 → user_context_remote-0.0.86}/user_context_remote.egg-info/dependency_links.txt +0 -0
- {user_context_remote-0.0.85 → user_context_remote-0.0.86}/user_context_remote.egg-info/requires.txt +0 -0
- {user_context_remote-0.0.85 → user_context_remote-0.0.86}/user_context_remote.egg-info/top_level.txt +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: user-context-remote
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.86
|
|
4
4
|
Summary: PyPI Package for Circles User Context Local/Remote Python
|
|
5
5
|
Home-page: https://github.com/circles-zone/user-context-remote-python-package
|
|
6
6
|
Author: Circles
|
|
7
|
-
Author-email: info@
|
|
7
|
+
Author-email: info@circlez.ai
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: License :: Other/Proprietary License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
@@ -4,10 +4,10 @@ PACKAGE_NAME = "user-context-remote"
|
|
|
4
4
|
package_dir = PACKAGE_NAME.replace("-", "_")
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
|
-
name=
|
|
8
|
-
version='0.0.
|
|
7
|
+
name=PACKAGE_NAME,
|
|
8
|
+
version='0.0.86', # https://pypi.org/project/user-context-remote/
|
|
9
9
|
author="Circles",
|
|
10
|
-
author_email="info@
|
|
10
|
+
author_email="info@circlez.ai",
|
|
11
11
|
description="PyPI Package for Circles User Context Local/Remote Python",
|
|
12
12
|
long_description="This is a package for sharing common user-context-remote functions used in different repositories",
|
|
13
13
|
long_description_content_type="text/markdown",
|
{user_context_remote-0.0.85 → user_context_remote-0.0.86}/user_context_remote/src/user_context.py
RENAMED
|
@@ -3,7 +3,7 @@ from http import HTTPStatus
|
|
|
3
3
|
|
|
4
4
|
import requests
|
|
5
5
|
from language_remote.lang_code import LangCode
|
|
6
|
-
from python_sdk_remote.mini_logger import MiniLogger
|
|
6
|
+
from python_sdk_remote.mini_logger import MiniLogger as logger
|
|
7
7
|
from python_sdk_remote.utilities import our_get_env, create_return_http_headers
|
|
8
8
|
from url_remote import action_name_enum, component_name_enum, entity_name_enum
|
|
9
9
|
from url_remote.our_url import OurUrl
|
|
@@ -17,7 +17,7 @@ ENVIORNMENT_NAME = our_get_env("ENVIRONMENT_NAME")
|
|
|
17
17
|
AUTHENTICATION_API_VERSION = 1
|
|
18
18
|
DEFAULT_LANG_CODE = LangCode.ENGLISH
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
# TODO: use data class instead of getter & setters
|
|
21
21
|
class UserContext:
|
|
22
22
|
# TODO Is it a good idea to user UserContext in UserContext?
|
|
23
23
|
_instance = None
|
|
@@ -36,29 +36,27 @@ class UserContext:
|
|
|
36
36
|
self.real_profile_id = None
|
|
37
37
|
self.effective_user_id = None
|
|
38
38
|
self.effective_profile_id = None
|
|
39
|
-
self.lang_code_str: str
|
|
39
|
+
self.lang_code_str: str or None = None
|
|
40
40
|
self.real_first_name = None
|
|
41
41
|
self.real_last_name = None
|
|
42
42
|
self.real_display_name = None
|
|
43
43
|
self.subscription_id = 5 # TODO temp solution, so we can debug
|
|
44
44
|
if user_jwt:
|
|
45
|
-
|
|
45
|
+
validate_user_jwt_response = self._authenticate_by_user_jwt(user_jwt=user_jwt)
|
|
46
46
|
else:
|
|
47
|
-
# TODO identification or identifier?
|
|
48
47
|
user_identifier = user_identifier or our_get_env("PRODUCT_USER_IDENTIFIER")
|
|
49
48
|
password = password or our_get_env("PRODUCT_PASSWORD")
|
|
50
|
-
|
|
49
|
+
validate_user_jwt_response = self._authenticate_by_user_identification_and_password(
|
|
51
50
|
user_identifier=user_identifier, password=password)
|
|
52
51
|
# Populate the private data members with data we received from Authentication Local REST-API https://github.com/circles-zone/authentication-local-restapi-typescript-serverless-com/edit/dev/auth-restapi-serverless-com/src/services/auth-service/auth-service-impl.ts
|
|
53
|
-
|
|
54
|
-
self.__get_user_data_login_response(validate_user_jwt_response=user_context)
|
|
52
|
+
self.__get_user_data_login_response(validate_user_jwt_response=validate_user_jwt_response)
|
|
55
53
|
|
|
56
54
|
@staticmethod
|
|
57
55
|
# Does it support no parameters? Yes
|
|
58
56
|
def login_using_user_identification_and_password(user_identifier: str = None, password: str = None):
|
|
59
57
|
# LOGIN_USING_USER_IDENTIFICATION_AND_PASSWORD_METHOD_NAME = "login_using_user_identification_and_password"
|
|
60
58
|
# TODO Why commented? Shall we add if (DebugMode)
|
|
61
|
-
#
|
|
59
|
+
# logger.start(LOGIN_USING_USER_IDENTIFICATION_AND_PASSWORD_METHOD_NAME, object={"user_identifier": user_identifier, "password": password})
|
|
62
60
|
if UserContext._instance is None:
|
|
63
61
|
if user_identifier is None:
|
|
64
62
|
user_identifier = our_get_env("PRODUCT_USER_IDENTIFIER")
|
|
@@ -66,102 +64,98 @@ class UserContext:
|
|
|
66
64
|
password = our_get_env("PRODUCT_PASSWORD")
|
|
67
65
|
if not user_identifier or not password:
|
|
68
66
|
# To support cases with no PRODUCT_USER_IDENTIFIER and PRODUCT_PASSWORD in the deployment.
|
|
69
|
-
|
|
67
|
+
logger.warning(
|
|
70
68
|
"Warning: missing PRODUCT_USER_IDENTIFIER or PRODUCT_PASSWORD in .env file - WARNING -")
|
|
71
69
|
return None
|
|
72
70
|
UserContext._instance = UserContext(
|
|
73
71
|
user_identifier=user_identifier, password=password)
|
|
74
72
|
user = UserContext._instance
|
|
75
|
-
#
|
|
73
|
+
# logger.end(LOGIN_USING_USER_IDENTIFICATION_AND_PASSWORD_METHOD_NAME,object={"user": str(user)})
|
|
76
74
|
return user
|
|
77
75
|
|
|
78
76
|
@staticmethod
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
LOGIN_USING_USER_JWT_METHOD_NAME = "login_using_user_jwt"
|
|
84
|
-
# MiniLogger.start(LOGIN_USING_USER_JWT_METHOD_NAME ,object={"user_jwt": user_jwt})
|
|
85
|
-
# TODO What if UserContext._instance is None and user_jwt is None? - Shall we use the same code we use in login_using_user_identification_and_password() without code duplications
|
|
86
|
-
if UserContext._instance is None and user_jwt is not None:
|
|
77
|
+
def login_using_user_jwt(user_jwt: str) -> 'UserContext':
|
|
78
|
+
# LOGIN_USING_USER_JWT_METHOD_NAME = "login_using_user_jwt"
|
|
79
|
+
# logger.start(LOGIN_USING_USER_JWT_METHOD_NAME ,object={"user_jwt": user_jwt})
|
|
80
|
+
if UserContext._instance is None:
|
|
87
81
|
UserContext._instance = UserContext(user_jwt=user_jwt)
|
|
88
82
|
user = UserContext._instance
|
|
89
|
-
#
|
|
83
|
+
# logger.end(LOGIN_USING_USER_JWT_METHOD_NAME,object={"user": str(user)})
|
|
90
84
|
return user
|
|
91
85
|
|
|
92
86
|
def _set_real_user_id(self, user_id: int) -> None:
|
|
93
|
-
|
|
94
|
-
#
|
|
87
|
+
# # SET_REAL_USER_ID_METHOD_NAME = "_set_real_user_id"
|
|
88
|
+
# logger.start(SET_REAL_USER_ID_METHOD_NAME,object={"user_id": user_id})
|
|
95
89
|
self.real_user_id = user_id
|
|
96
|
-
#
|
|
90
|
+
# logger.end(SET_REAL_USER_ID_METHOD_NAME)
|
|
97
91
|
|
|
98
92
|
def _set_real_profile_id(self, profile_id: int) -> None:
|
|
99
|
-
|
|
100
|
-
#
|
|
93
|
+
# SET_REAL_PROFILE_ID_METHOD_NAME = "_set_real_profile_id"
|
|
94
|
+
# logger.start(SET_REAL_PROFILE_ID_METHOD_NAME,object={"profile_id": profile_id})
|
|
101
95
|
self.real_profile_id = profile_id
|
|
102
|
-
#
|
|
96
|
+
# logger.end(SET_REAL_PROFILE_ID_METHOD_NAME)
|
|
103
97
|
|
|
104
98
|
def get_real_user_id(self) -> int:
|
|
105
|
-
GET_REAL_USER_ID_METHOD_NAME = "get_real_user_id"
|
|
106
|
-
#
|
|
107
|
-
#
|
|
99
|
+
# GET_REAL_USER_ID_METHOD_NAME = "get_real_user_id"
|
|
100
|
+
# logger.start(GET_REAL_USER_ID_METHOD_NAME)
|
|
101
|
+
# logger.end(GET_REAL_USER_ID_METHOD_NAME,object={"user_id": self.real_user_id})
|
|
108
102
|
return self.real_user_id
|
|
109
103
|
|
|
110
104
|
def get_real_profile_id(self) -> int:
|
|
111
|
-
GET_REAL_PROFILE_ID_METHOD_NAME = "get_real_profile_id"
|
|
112
|
-
#
|
|
113
|
-
#
|
|
105
|
+
# GET_REAL_PROFILE_ID_METHOD_NAME = "get_real_profile_id"
|
|
106
|
+
# logger.start(GET_REAL_PROFILE_ID_METHOD_NAME)
|
|
107
|
+
# logger.end(GET_REAL_PROFILE_ID_METHOD_NAME,object={"user_id": self.real_profile_id})
|
|
114
108
|
return self.real_profile_id
|
|
115
109
|
|
|
116
110
|
def get_effective_profile_preferred_lang_code_string(self) -> str:
|
|
117
|
-
GET_CURENT_LANG_CODE_STRING_METHOD_NAME = "get_effective_profile_preferred_lang_code"
|
|
118
|
-
#
|
|
119
|
-
#
|
|
111
|
+
# GET_CURENT_LANG_CODE_STRING_METHOD_NAME = "get_effective_profile_preferred_lang_code"
|
|
112
|
+
# logger.start(GET_CURENT_LANG_CODE_STRING_METHOD_NAME)
|
|
113
|
+
# logger.end(GET_CURENT_LANG_CODE_STRING_METHOD_NAME,object={"lang_code_string": self.lang_code})
|
|
120
114
|
return self.lang_code_str or DEFAULT_LANG_CODE.value
|
|
121
115
|
|
|
122
116
|
def get_effective_profile_preferred_lang_code(self) -> LangCode:
|
|
123
117
|
return LangCode(self.lang_code_str or DEFAULT_LANG_CODE.value)
|
|
124
118
|
|
|
125
119
|
def _set_effective_profile_preferred_lang_code(self, lang_code: LangCode) -> None:
|
|
126
|
-
|
|
127
|
-
#
|
|
120
|
+
# SET_CURRENT_LANG_CODE_METHOD_NAME = "_set_current_lang_code"
|
|
121
|
+
# logger.start(SET_CURRENT_LANG_CODE_METHOD_NAME,object={"lang_code": lang_code.value})
|
|
128
122
|
self.lang_code_str = lang_code.value
|
|
129
|
-
#
|
|
123
|
+
# logger.end(SET_CURRENT_LANG_CODE_METHOD_NAME)
|
|
130
124
|
|
|
131
125
|
def _set_real_first_name(self, first_name: str) -> None:
|
|
132
|
-
|
|
133
|
-
#
|
|
126
|
+
# SET_REAL_FIRST_NAME_METHOD_NAME = "_set_real_first_name"
|
|
127
|
+
# logger.start(SET_REAL_FIRST_NAME_METHOD_NAME,object={"first_name": first_name})
|
|
134
128
|
self.real_first_name = first_name
|
|
135
|
-
#
|
|
129
|
+
# logger.end(SET_REAL_FIRST_NAME_METHOD_NAME)
|
|
136
130
|
|
|
137
131
|
def _set_real_last_name(self, last_name: str) -> None:
|
|
138
|
-
|
|
139
|
-
#
|
|
132
|
+
# SET_REAL_LAST_NAME_METHOD_NAME = "_set_real_last_name"
|
|
133
|
+
# logger.start(SET_REAL_LAST_NAME_METHOD_NAME,object={"first_name": last_name})
|
|
140
134
|
self.real_last_name = last_name
|
|
141
|
-
#
|
|
135
|
+
# logger.end(SET_REAL_LAST_NAME_METHOD_NAME)
|
|
142
136
|
|
|
143
137
|
def get_real_first_name(self) -> str:
|
|
144
|
-
GET_REAL_FIRST_NAME_METHOD_NAME = "get_real_first_name"
|
|
145
|
-
#
|
|
146
|
-
#
|
|
138
|
+
# GET_REAL_FIRST_NAME_METHOD_NAME = "get_real_first_name"
|
|
139
|
+
# logger.start(GET_REAL_FIRST_NAME_METHOD_NAME)
|
|
140
|
+
# logger.end(GET_REAL_FIRST_NAME_METHOD_NAME,object={"first_name": self.real_first_name})
|
|
147
141
|
return self.real_first_name
|
|
148
142
|
|
|
149
143
|
def get_real_last_name(self) -> str:
|
|
150
|
-
GET_REAL_LAST_NAME_METHOD_NAME = "get_real_last_name"
|
|
151
|
-
#
|
|
152
|
-
#
|
|
144
|
+
# GET_REAL_LAST_NAME_METHOD_NAME = "get_real_last_name"
|
|
145
|
+
# logger.start(GET_REAL_LAST_NAME_METHOD_NAME)
|
|
146
|
+
# logger.end(GET_REAL_LAST_NAME_METHOD_NAME,object={"last_name": self.real_last_name})
|
|
153
147
|
return self.real_last_name
|
|
154
148
|
|
|
155
149
|
def _set_real_name(self, name: str) -> None:
|
|
156
|
-
|
|
157
|
-
#
|
|
150
|
+
# SET_REAL_NAME_METHOD_NAME = "_set_real_name"
|
|
151
|
+
# logger.start(SET_REAL_NAME_METHOD_NAME,object={"first_name": name})
|
|
158
152
|
self.real_display_name = name
|
|
159
|
-
#
|
|
153
|
+
# logger.end(SET_REAL_NAME_METHOD_NAME)
|
|
160
154
|
|
|
161
155
|
def get_real_name(self) -> str:
|
|
162
|
-
GET_REAL_NAME_METHOD_NAME = "get_real_name"
|
|
163
|
-
#
|
|
164
|
-
#
|
|
156
|
+
# GET_REAL_NAME_METHOD_NAME = "get_real_name"
|
|
157
|
+
# logger.start(GET_REAL_NAME_METHOD_NAME)
|
|
158
|
+
# logger.end(GET_REAL_NAME_METHOD_NAME,object={"first_name": self.real_first_name})
|
|
165
159
|
return self.real_display_name
|
|
166
160
|
|
|
167
161
|
def get_user_jwt(self) -> str:
|
|
@@ -183,16 +177,16 @@ class UserContext:
|
|
|
183
177
|
self.subscription_id = subscription_id
|
|
184
178
|
|
|
185
179
|
def get_effective_subscription_id(self) -> int:
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
180
|
+
# GET_EFFECTIVE_SUBSCRIPTION_ID_METHOD_NAME = "get_effective_subscription_id"
|
|
181
|
+
# logger.warning("user-context-python-package " + GET_EFFECTIVE_SUBSCRIPTION_ID_METHOD_NAME +
|
|
182
|
+
# " Please make sure get_effective_subscription_id() subscription_id=" + str(
|
|
183
|
+
# self.subscription_id))
|
|
190
184
|
return self.subscription_id
|
|
191
185
|
|
|
192
186
|
def _authenticate_by_user_identification_and_password(self, user_identifier: str,
|
|
193
187
|
password: str) -> requests.Response:
|
|
194
|
-
|
|
195
|
-
|
|
188
|
+
AUTHENTICATE_BY_USER_IDENTIFICATION_AND_PASSWORD_METHOD_NAME = "_authenticate_by_user_identification_and_password"
|
|
189
|
+
logger.start(AUTHENTICATE_BY_USER_IDENTIFICATION_AND_PASSWORD_METHOD_NAME, object={
|
|
196
190
|
"userIdentifier": user_identifier, "password": "***"})
|
|
197
191
|
try:
|
|
198
192
|
url_circlez = OurUrl()
|
|
@@ -212,31 +206,30 @@ class UserContext:
|
|
|
212
206
|
data=json.dumps(authentication_login_request_json, separators=(",", ":")), headers=headers
|
|
213
207
|
)
|
|
214
208
|
if authentication_login_response_json.status_code != HTTPStatus.OK:
|
|
215
|
-
|
|
216
|
-
|
|
209
|
+
logger.error(AUTHENTICATE_BY_USER_IDENTIFICATION_AND_PASSWORD_METHOD_NAME +
|
|
210
|
+
" authentication_login_response_json.status_code != HTTPStatus.OK " + authentication_login_response_json.text)
|
|
217
211
|
raise Exception(authentication_login_response_json.text)
|
|
218
212
|
# Maybe there is no "data"
|
|
219
|
-
|
|
220
|
-
|
|
213
|
+
logger.info("authentication_login_response_json.json()" + str(authentication_login_response_json))
|
|
214
|
+
logger.info("authentication_login_response_json.json() with json()" + str(
|
|
221
215
|
authentication_login_response_json.json()))
|
|
222
216
|
# TODO Put this in try/except as there might be no "data" or no "userJwt"
|
|
223
217
|
self.user_jwt = authentication_login_response_json.json()["data"]["userJwt"]
|
|
224
|
-
|
|
218
|
+
logger.end(AUTHENTICATE_BY_USER_IDENTIFICATION_AND_PASSWORD_METHOD_NAME, object={
|
|
225
219
|
"user_jwt": self.user_jwt})
|
|
226
220
|
return authentication_login_response_json
|
|
227
221
|
# TODO Catch KeyError: 'data'
|
|
228
222
|
except Exception as exception:
|
|
229
|
-
|
|
223
|
+
logger.exception(
|
|
230
224
|
"Error(Exception): user-context-remote-python _authenticate() " + str(exception))
|
|
231
|
-
|
|
225
|
+
logger.end(AUTHENTICATE_BY_USER_IDENTIFICATION_AND_PASSWORD_METHOD_NAME)
|
|
232
226
|
raise
|
|
233
227
|
|
|
234
228
|
def _authenticate_by_user_jwt(self, user_jwt: str) -> requests.Response:
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
authentication_login_validate_user_jwt_url = url_circlez.endpoint_url(
|
|
229
|
+
AUTHENTICATE_BY_USER_JWT_METHOD_NAME = "_authenticate_by_user_jwt"
|
|
230
|
+
logger.start(AUTHENTICATE_BY_USER_JWT_METHOD_NAME,
|
|
231
|
+
object={"user_jwt": user_jwt})
|
|
232
|
+
authentication_login_validate_user_jwt_url = OurUrl.endpoint_url(
|
|
240
233
|
brand_name=BRAND_NAME,
|
|
241
234
|
environment_name=ENVIORNMENT_NAME,
|
|
242
235
|
component_name=component_name_enum.ComponentName.AUTHENTICATION.value,
|
|
@@ -251,12 +244,12 @@ class UserContext:
|
|
|
251
244
|
data=json.dumps(validate_user_jwt_request_json, separators=(",", ":")), headers=headers
|
|
252
245
|
)
|
|
253
246
|
if authentication_login_validate_user_jwt_response.status_code != HTTPStatus.OK:
|
|
254
|
-
|
|
247
|
+
logger.error(
|
|
255
248
|
"user-context-remote-python-package _authenticate_by_user_jwt() authentication_login_validate_user_jwt_response.status_code != HTTPStatus.OK " + authentication_login_validate_user_jwt_response.text)
|
|
256
249
|
# MiniLoger.end()
|
|
257
250
|
raise Exception(authentication_login_validate_user_jwt_response.text)
|
|
258
|
-
|
|
259
|
-
|
|
251
|
+
logger.end(AUTHENTICATE_BY_USER_JWT_METHOD_NAME,
|
|
252
|
+
object={"validate_user_jwt_response": authentication_login_validate_user_jwt_response})
|
|
260
253
|
return authentication_login_validate_user_jwt_response
|
|
261
254
|
|
|
262
255
|
# Used only in one please
|
|
@@ -268,37 +261,37 @@ class UserContext:
|
|
|
268
261
|
first_name = last_name = None
|
|
269
262
|
if "userDetails" in data_dict:
|
|
270
263
|
# TODO user_details
|
|
271
|
-
|
|
264
|
+
user_details = data_dict["userDetails"]
|
|
272
265
|
|
|
273
|
-
if "profileId" in
|
|
274
|
-
profile_id =
|
|
266
|
+
if "profileId" in user_details:
|
|
267
|
+
profile_id = user_details["profileId"]
|
|
275
268
|
self._set_real_profile_id(int(profile_id))
|
|
276
269
|
self._set_effective_profile_id(int(profile_id))
|
|
277
270
|
|
|
278
|
-
if "userId" in
|
|
279
|
-
user_id =
|
|
271
|
+
if "userId" in user_details:
|
|
272
|
+
user_id = user_details["userId"]
|
|
280
273
|
self._set_effective_user_id(int(user_id))
|
|
281
274
|
self._set_real_user_id(int(user_id))
|
|
282
275
|
|
|
283
|
-
if "profilePreferredLangCode" in
|
|
284
|
-
lang_code =
|
|
276
|
+
if "profilePreferredLangCode" in user_details:
|
|
277
|
+
lang_code = user_details["profilePreferredLangCode"]
|
|
285
278
|
if lang_code is None: # default lang_code is en
|
|
286
279
|
lang_code = "en"
|
|
287
280
|
# change to lang_code enum object
|
|
288
281
|
lang_code = LangCode(lang_code)
|
|
289
282
|
self._set_effective_profile_preferred_lang_code(lang_code)
|
|
290
283
|
|
|
291
|
-
if "firstName" in
|
|
292
|
-
first_name =
|
|
284
|
+
if "firstName" in user_details:
|
|
285
|
+
first_name = user_details["firstName"]
|
|
293
286
|
self._set_real_first_name(first_name)
|
|
294
287
|
|
|
295
|
-
if "lastName" in
|
|
296
|
-
last_name =
|
|
288
|
+
if "lastName" in user_details:
|
|
289
|
+
last_name = user_details["lastName"]
|
|
297
290
|
self._set_real_last_name(last_name)
|
|
298
291
|
|
|
299
|
-
if "subscriptionId" in
|
|
300
|
-
subscription_id =
|
|
301
|
-
|
|
292
|
+
if "subscriptionId" in user_details:
|
|
293
|
+
subscription_id = user_details["subscriptionId"]
|
|
294
|
+
logger.end(
|
|
302
295
|
_GET_USER_DATA_LOGIN_RESPONSE_METHOD_NAME + " Got subscription_id from the cloud. subscription_id=" +
|
|
303
296
|
str(subscription_id), object={"subscription_id": subscription_id})
|
|
304
297
|
self._set_effective_subscription_id(subscription_id)
|
|
@@ -307,7 +300,7 @@ class UserContext:
|
|
|
307
300
|
name = first_name + " " + last_name
|
|
308
301
|
else:
|
|
309
302
|
# If first_name and last_name are not available, use the email as the name
|
|
310
|
-
name =
|
|
303
|
+
name = user_details.get("email")
|
|
311
304
|
|
|
312
305
|
self._set_real_name(name)
|
|
313
306
|
|
{user_context_remote-0.0.85 → user_context_remote-0.0.86}/user_context_remote.egg-info/PKG-INFO
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: user-context-remote
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.86
|
|
4
4
|
Summary: PyPI Package for Circles User Context Local/Remote Python
|
|
5
5
|
Home-page: https://github.com/circles-zone/user-context-remote-python-package
|
|
6
6
|
Author: Circles
|
|
7
|
-
Author-email: info@
|
|
7
|
+
Author-email: info@circlez.ai
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: License :: Other/Proprietary License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{user_context_remote-0.0.85 → user_context_remote-0.0.86}/user_context_remote/src/__init__.py
RENAMED
|
File without changes
|
{user_context_remote-0.0.85 → user_context_remote-0.0.86}/user_context_remote.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{user_context_remote-0.0.85 → user_context_remote-0.0.86}/user_context_remote.egg-info/requires.txt
RENAMED
|
File without changes
|
{user_context_remote-0.0.85 → user_context_remote-0.0.86}/user_context_remote.egg-info/top_level.txt
RENAMED
|
File without changes
|