user-context-remote 0.0.87__tar.gz → 0.0.89__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.87 → user_context_remote-0.0.89}/PKG-INFO +1 -1
- {user_context_remote-0.0.87 → user_context_remote-0.0.89}/setup.py +1 -1
- {user_context_remote-0.0.87 → user_context_remote-0.0.89}/user_context_remote/src/user_context.py +13 -9
- {user_context_remote-0.0.87 → user_context_remote-0.0.89}/user_context_remote.egg-info/PKG-INFO +1 -1
- {user_context_remote-0.0.87 → user_context_remote-0.0.89}/README.md +0 -0
- {user_context_remote-0.0.87 → user_context_remote-0.0.89}/pyproject.toml +0 -0
- {user_context_remote-0.0.87 → user_context_remote-0.0.89}/setup.cfg +0 -0
- {user_context_remote-0.0.87 → user_context_remote-0.0.89}/user_context_remote/src/__init__.py +0 -0
- {user_context_remote-0.0.87 → user_context_remote-0.0.89}/user_context_remote.egg-info/SOURCES.txt +0 -0
- {user_context_remote-0.0.87 → user_context_remote-0.0.89}/user_context_remote.egg-info/dependency_links.txt +0 -0
- {user_context_remote-0.0.87 → user_context_remote-0.0.89}/user_context_remote.egg-info/requires.txt +0 -0
- {user_context_remote-0.0.87 → user_context_remote-0.0.89}/user_context_remote.egg-info/top_level.txt +0 -0
|
@@ -5,7 +5,7 @@ package_dir = PACKAGE_NAME.replace("-", "_")
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name=PACKAGE_NAME,
|
|
8
|
-
version='0.0.
|
|
8
|
+
version='0.0.89', # https://pypi.org/project/user-context-remote/
|
|
9
9
|
author="Circles",
|
|
10
10
|
author_email="info@circlez.ai",
|
|
11
11
|
description="PyPI Package for Circles User Context Local/Remote Python",
|
{user_context_remote-0.0.87 → user_context_remote-0.0.89}/user_context_remote/src/user_context.py
RENAMED
|
@@ -4,7 +4,8 @@ from http import HTTPStatus
|
|
|
4
4
|
import requests
|
|
5
5
|
from language_remote.lang_code import LangCode
|
|
6
6
|
from python_sdk_remote.mini_logger import MiniLogger as logger
|
|
7
|
-
from python_sdk_remote.utilities import our_get_env
|
|
7
|
+
from python_sdk_remote.utilities import our_get_env
|
|
8
|
+
from python_sdk_remote.http_response import create_return_http_headers
|
|
8
9
|
from url_remote import action_name_enum, component_name_enum, entity_name_enum
|
|
9
10
|
from url_remote.our_url import OurUrl
|
|
10
11
|
|
|
@@ -183,14 +184,13 @@ class UserContext:
|
|
|
183
184
|
# self.subscription_id))
|
|
184
185
|
return self.subscription_id
|
|
185
186
|
|
|
186
|
-
def _authenticate_by_user_identification_and_password(
|
|
187
|
-
|
|
187
|
+
def _authenticate_by_user_identification_and_password(
|
|
188
|
+
self, user_identifier: str, password: str) -> requests.Response:
|
|
188
189
|
AUTHENTICATE_BY_USER_IDENTIFICATION_AND_PASSWORD_METHOD_NAME = "_authenticate_by_user_identification_and_password"
|
|
189
190
|
logger.start(AUTHENTICATE_BY_USER_IDENTIFICATION_AND_PASSWORD_METHOD_NAME, object={
|
|
190
191
|
"userIdentifier": user_identifier, "password": "***"})
|
|
191
192
|
try:
|
|
192
|
-
|
|
193
|
-
authentication_login_enpoint_url = url_circlez.endpoint_url(
|
|
193
|
+
authentication_login_enpoint_url = OurUrl.endpoint_url(
|
|
194
194
|
brand_name=BRAND_NAME,
|
|
195
195
|
environment_name=ENVIORNMENT_NAME,
|
|
196
196
|
component_name=component_name_enum.ComponentName.AUTHENTICATION.value,
|
|
@@ -198,12 +198,12 @@ class UserContext:
|
|
|
198
198
|
version=AUTHENTICATION_API_VERSION,
|
|
199
199
|
action_name=action_name_enum.ActionName.LOGIN.value
|
|
200
200
|
)
|
|
201
|
-
|
|
201
|
+
authentication_login_request_dict = {"userIdentifier": user_identifier, "password": password}
|
|
202
202
|
# TOOD Please use get_http_headers() from Python-SDK
|
|
203
203
|
headers = create_return_http_headers()
|
|
204
204
|
authentication_login_response_json = requests.post(
|
|
205
205
|
url=authentication_login_enpoint_url,
|
|
206
|
-
data=json.dumps(
|
|
206
|
+
data=json.dumps(authentication_login_request_dict, separators=(",", ":")), headers=headers
|
|
207
207
|
)
|
|
208
208
|
if authentication_login_response_json.status_code != HTTPStatus.OK:
|
|
209
209
|
logger.error(AUTHENTICATE_BY_USER_IDENTIFICATION_AND_PASSWORD_METHOD_NAME +
|
|
@@ -256,11 +256,11 @@ class UserContext:
|
|
|
256
256
|
version=AUTHENTICATION_API_VERSION,
|
|
257
257
|
action_name=action_name_enum.ActionName.VALIDATE_USER_JWT.value
|
|
258
258
|
)
|
|
259
|
-
|
|
259
|
+
validate_user_jwt_request_dict = {"userJwt": user_jwt}
|
|
260
260
|
headers = create_return_http_headers()
|
|
261
261
|
authentication_login_validate_user_jwt_response = requests.post(
|
|
262
262
|
url=authentication_login_validate_user_jwt_url,
|
|
263
|
-
data=json.dumps(
|
|
263
|
+
data=json.dumps(validate_user_jwt_request_dict, separators=(",", ":")), headers=headers
|
|
264
264
|
)
|
|
265
265
|
if authentication_login_validate_user_jwt_response.status_code != HTTPStatus.OK:
|
|
266
266
|
logger.error(
|
|
@@ -279,6 +279,10 @@ class UserContext:
|
|
|
279
279
|
response_json = validate_user_jwt_response.json()
|
|
280
280
|
data_dict = response_json.get('data')
|
|
281
281
|
first_name = last_name = None
|
|
282
|
+
if not data_dict:
|
|
283
|
+
logger.error(_GET_USER_DATA_LOGIN_RESPONSE_METHOD_NAME + " data from validate_user_jwt_response",
|
|
284
|
+
object={"validate_user_jwt_response": validate_user_jwt_response.text})
|
|
285
|
+
raise Exception("Can't get data from validate_user_jwt_response: " + validate_user_jwt_response.text)
|
|
282
286
|
if "userDetails" in data_dict:
|
|
283
287
|
# TODO user_details
|
|
284
288
|
user_details: dict = data_dict.get("userDetails")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{user_context_remote-0.0.87 → user_context_remote-0.0.89}/user_context_remote/src/__init__.py
RENAMED
|
File without changes
|
{user_context_remote-0.0.87 → user_context_remote-0.0.89}/user_context_remote.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{user_context_remote-0.0.87 → user_context_remote-0.0.89}/user_context_remote.egg-info/requires.txt
RENAMED
|
File without changes
|
{user_context_remote-0.0.87 → user_context_remote-0.0.89}/user_context_remote.egg-info/top_level.txt
RENAMED
|
File without changes
|