ul-api-utils 7.3.2__py3-none-any.whl → 7.3.4__py3-none-any.whl
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 ul-api-utils might be problematic. Click here for more details.
- ul_api_utils/modules/api_sdk.py +7 -8
- {ul_api_utils-7.3.2.dist-info → ul_api_utils-7.3.4.dist-info}/METADATA +1 -1
- {ul_api_utils-7.3.2.dist-info → ul_api_utils-7.3.4.dist-info}/RECORD +7 -7
- {ul_api_utils-7.3.2.dist-info → ul_api_utils-7.3.4.dist-info}/LICENSE +0 -0
- {ul_api_utils-7.3.2.dist-info → ul_api_utils-7.3.4.dist-info}/WHEEL +0 -0
- {ul_api_utils-7.3.2.dist-info → ul_api_utils-7.3.4.dist-info}/entry_points.txt +0 -0
- {ul_api_utils-7.3.2.dist-info → ul_api_utils-7.3.4.dist-info}/top_level.txt +0 -0
ul_api_utils/modules/api_sdk.py
CHANGED
|
@@ -77,8 +77,7 @@ def clean_files() -> None:
|
|
|
77
77
|
files.clear()
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
def _get_error_types(response: ApiResponse) ->
|
|
81
|
-
res = []
|
|
80
|
+
def _get_error_types(response: ApiResponse) -> Optional[str]:
|
|
82
81
|
if isinstance(response, AnyJsonApiResponse) and isinstance(response.errors, (list, tuple)) and len(response.errors) > 0:
|
|
83
82
|
for err in response.errors:
|
|
84
83
|
err_t = None
|
|
@@ -87,8 +86,8 @@ def _get_error_types(response: ApiResponse) -> List[str]:
|
|
|
87
86
|
elif isinstance(err, dict):
|
|
88
87
|
err_t = err.get('error_type', None)
|
|
89
88
|
if isinstance(err_t, str):
|
|
90
|
-
|
|
91
|
-
return
|
|
89
|
+
return err_t
|
|
90
|
+
return None
|
|
92
91
|
|
|
93
92
|
|
|
94
93
|
class ApiSdk:
|
|
@@ -422,9 +421,9 @@ class ApiSdk:
|
|
|
422
421
|
res = api_resource_config.override_flask_response(res)
|
|
423
422
|
|
|
424
423
|
ri = api_resource.request_info
|
|
425
|
-
logger.info(json.dumps({
|
|
426
|
-
'user_id': str(scope_user_id),
|
|
427
|
-
'token_id': str(scope_token_id),
|
|
424
|
+
logger.info('AUDIT ' + json.dumps({
|
|
425
|
+
'user_id': str(scope_user_id) if scope_user_id else None,
|
|
426
|
+
'token_id': str(scope_token_id) if scope_token_id else None,
|
|
428
427
|
'method': request.method,
|
|
429
428
|
'url': request.url,
|
|
430
429
|
'ipv4': ri.ipv4,
|
|
@@ -433,7 +432,7 @@ class ApiSdk:
|
|
|
433
432
|
'status_code': res[1] if res is not None else 500,
|
|
434
433
|
'fn_id': fn_name,
|
|
435
434
|
'fn_mdl': fn_module,
|
|
436
|
-
'
|
|
435
|
+
'error_code': _get_error_types(result),
|
|
437
436
|
}))
|
|
438
437
|
|
|
439
438
|
return res
|
|
@@ -55,7 +55,7 @@ ul_api_utils/internal_api/__tests__/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQ
|
|
|
55
55
|
ul_api_utils/internal_api/__tests__/internal_api.py,sha256=X2iopeso6vryszeeA__lcqXQVtz3Nwt3ngH7M4OuN1U,1116
|
|
56
56
|
ul_api_utils/internal_api/__tests__/internal_api_content_type.py,sha256=mfiYPkzKtfZKFpi4RSnWAoCd6mRijr6sFsa2TF-s5t8,749
|
|
57
57
|
ul_api_utils/modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
|
-
ul_api_utils/modules/api_sdk.py,sha256=
|
|
58
|
+
ul_api_utils/modules/api_sdk.py,sha256=3MsDwfsKxzaD7ixMUeJWAI_qSgBU6h7o2QBPS0-d6ZE,21880
|
|
59
59
|
ul_api_utils/modules/api_sdk_config.py,sha256=ItTShOENf4mhZi9sOLsx7ZugDj5abDpYDeU_BN5sy8E,1761
|
|
60
60
|
ul_api_utils/modules/api_sdk_jwt.py,sha256=2XRfb0LxHUnldSL67S60v1uyoDpVPNaq4zofUtkeg88,15112
|
|
61
61
|
ul_api_utils/modules/intermediate_state.py,sha256=7ZZ3Sypbb8LaSfrVhaXaWRDnj8oyy26NUbmFK7vr-y4,1270
|
|
@@ -122,9 +122,9 @@ ul_api_utils/validators/validate_empty_object.py,sha256=3Ck_iwyJE_M5e7l6s1i88aqb
|
|
|
122
122
|
ul_api_utils/validators/validate_uuid.py,sha256=EfvlRirv2EW0Z6w3s8E8rUa9GaI8qXZkBWhnPs8NFrA,257
|
|
123
123
|
ul_api_utils/validators/__tests__/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
124
124
|
ul_api_utils/validators/__tests__/test_custom_fields.py,sha256=QLZ7DFta01Z7DOK9Z5Iq4uf_CmvDkVReis-GAl_QN48,1447
|
|
125
|
-
ul_api_utils-7.3.
|
|
126
|
-
ul_api_utils-7.3.
|
|
127
|
-
ul_api_utils-7.3.
|
|
128
|
-
ul_api_utils-7.3.
|
|
129
|
-
ul_api_utils-7.3.
|
|
130
|
-
ul_api_utils-7.3.
|
|
125
|
+
ul_api_utils-7.3.4.dist-info/LICENSE,sha256=6Qo8OdcqI8aGrswJKJYhST-bYqxVQBQ3ujKdTSdq-80,1062
|
|
126
|
+
ul_api_utils-7.3.4.dist-info/METADATA,sha256=zos--VEQ627f08JLzPgiYOI6J_uKTmCzUSrpK0J1ZJU,14371
|
|
127
|
+
ul_api_utils-7.3.4.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
128
|
+
ul_api_utils-7.3.4.dist-info/entry_points.txt,sha256=8tL3ySHWTyJMuV1hx1fHfN8zumDVOCOm63w3StphkXg,53
|
|
129
|
+
ul_api_utils-7.3.4.dist-info/top_level.txt,sha256=1XsW8iOSFaH4LOzDcnNyxHpHrbKU3fSn-aIAxe04jmw,21
|
|
130
|
+
ul_api_utils-7.3.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|