python-sdk-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.
Potentially problematic release.
This version of python-sdk-remote might be problematic. Click here for more details.
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/PKG-INFO +2 -1
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote/src/utilities.py +17 -3
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote.egg-info/PKG-INFO +2 -1
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote.egg-info/requires.txt +1 -0
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/setup.py +3 -2
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/README.md +0 -0
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/pyproject.toml +0 -0
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote/src/__init__.py +0 -0
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote/src/constants.py +0 -0
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote/src/item.py +0 -0
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote/src/mini_logger.py +0 -0
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote/src/our_object.py +0 -0
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote/src/unified_json.py +0 -0
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote/src/valid_json_versions.py +0 -0
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote/src/validate_environment.py +0 -0
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote.egg-info/SOURCES.txt +0 -0
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote.egg-info/dependency_links.txt +0 -0
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote.egg-info/top_level.txt +0 -0
- {python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-sdk-remote
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.89
|
|
4
4
|
Summary: PyPI Package for Circles Python SDK Local Python
|
|
5
5
|
Home-page: https://github.com/circles-zone/python-sdk-remote-python-package
|
|
6
6
|
Author: Circles
|
|
@@ -11,5 +11,6 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
Requires-Dist: python-dotenv
|
|
13
13
|
Requires-Dist: url-remote
|
|
14
|
+
Requires-Dist: http-status-codes
|
|
14
15
|
|
|
15
16
|
This is a package for sharing common functions used in different repositories
|
|
@@ -4,6 +4,7 @@ from datetime import date, datetime, time, timedelta
|
|
|
4
4
|
from dotenv import load_dotenv
|
|
5
5
|
from url_remote.environment_name_enum import EnvironmentName
|
|
6
6
|
from urllib.parse import urlparse
|
|
7
|
+
from http_constants import status
|
|
7
8
|
|
|
8
9
|
from .mini_logger import MiniLogger as logger
|
|
9
10
|
|
|
@@ -251,14 +252,13 @@ def is_datetime_in_datetime_range(check_datetime: datetime, datetime_range: tupl
|
|
|
251
252
|
|
|
252
253
|
# Former name was create_http_headers()
|
|
253
254
|
def create_authorization_http_headers(user_jwt: str) -> dict:
|
|
254
|
-
|
|
255
|
+
return {
|
|
255
256
|
'Content-Type': 'application/json',
|
|
256
257
|
'Authorization': f'Bearer {user_jwt}',
|
|
257
258
|
}
|
|
258
|
-
return http_headers
|
|
259
259
|
|
|
260
260
|
|
|
261
|
-
def
|
|
261
|
+
def get_user_jwt_from_event(event: dict) -> str:
|
|
262
262
|
auth_header = event.get('headers', {}).get('authorization')
|
|
263
263
|
if auth_header is None:
|
|
264
264
|
auth_header = event.get('headers', {}).get('Authorization')
|
|
@@ -271,6 +271,20 @@ def create_return_http_headers() -> dict:
|
|
|
271
271
|
"Access-Control-Allow-Origin": "*",
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
def create_error_http_response(exception: Exception) -> dict:
|
|
275
|
+
return {
|
|
276
|
+
"statusCode": status.BAD_GATEWAY,
|
|
277
|
+
"headers": create_return_http_headers(),
|
|
278
|
+
"body": create_http_body({"error": str(exception)})
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
def create_ok_http_response(body: dict) -> dict:
|
|
282
|
+
return {
|
|
283
|
+
"statusCode": status.OK,
|
|
284
|
+
"headers": create_return_http_headers(),
|
|
285
|
+
"body": create_http_body(body)
|
|
286
|
+
}
|
|
287
|
+
|
|
274
288
|
|
|
275
289
|
# https://google.github.io/styleguide/jsoncstyleguide.xml?showone=Property_Name_Format#Property_Name_Format
|
|
276
290
|
def create_http_body(body: dict) -> str:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-sdk-remote
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.89
|
|
4
4
|
Summary: PyPI Package for Circles Python SDK Local Python
|
|
5
5
|
Home-page: https://github.com/circles-zone/python-sdk-remote-python-package
|
|
6
6
|
Author: Circles
|
|
@@ -11,5 +11,6 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
Requires-Dist: python-dotenv
|
|
13
13
|
Requires-Dist: url-remote
|
|
14
|
+
Requires-Dist: http-status-codes
|
|
14
15
|
|
|
15
16
|
This is a package for sharing common functions used in different repositories
|
|
@@ -7,7 +7,7 @@ package_dir = PACKAGE_NAME.replace("-", "_")
|
|
|
7
7
|
# python -m build needs pyproject.toml or setup.py
|
|
8
8
|
setuptools.setup(
|
|
9
9
|
name=PACKAGE_NAME,
|
|
10
|
-
version='0.0.
|
|
10
|
+
version='0.0.89', # https://pypi.org/project/python-sdk-remote/
|
|
11
11
|
author="Circles",
|
|
12
12
|
author_email="info@circles.life",
|
|
13
13
|
description="PyPI Package for Circles Python SDK Local Python",
|
|
@@ -24,6 +24,7 @@ setuptools.setup(
|
|
|
24
24
|
],
|
|
25
25
|
install_requires=[
|
|
26
26
|
"python-dotenv",
|
|
27
|
-
"url-remote"
|
|
27
|
+
"url-remote",
|
|
28
|
+
"http-status-codes"
|
|
28
29
|
]
|
|
29
30
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote/src/valid_json_versions.py
RENAMED
|
File without changes
|
{python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote/src/validate_environment.py
RENAMED
|
File without changes
|
{python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{python-sdk-remote-0.0.87 → python-sdk-remote-0.0.89}/python_sdk_remote.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|