sharedkernel 2.4.0__tar.gz → 2.5.1__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.
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/PKG-INFO +8 -1
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/README.md +6 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/setup.py +2 -1
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/file_validation.py +3 -1
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/jwt_service.py +3 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel.egg-info/PKG-INFO +8 -1
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel.egg-info/requires.txt +1 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/setup.cfg +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/common.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/data_format_converter.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/database/__init__.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/database/audit_model.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/database/mongo_generic_audit_repository.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/database/mongo_generic_repository.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/database/pagination_response_dto.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/date_converter.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/diff_utils.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/enum/__init__.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/enum/error_code.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/enum/sort_order.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/exception/__init__.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/exception/exception.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/exception/exception_handlers.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/multipart_upload.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/normalizer/__init__.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/normalizer/number_normalizer.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/normalizer/phone_number_normalizer.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/normalizer/string_normalizer.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/objects/__init__.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/objects/base_document.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/objects/json_string_model.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/objects/jwt_model.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/objects/result.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/objects/user_info.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/regex_masking.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/s3_uploader.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/string_extentions.py +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel.egg-info/SOURCES.txt +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel.egg-info/dependency_links.txt +0 -0
- {sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sharedkernel
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.5.1
|
|
4
4
|
Summary: sharekernel is a shared package between all python projects
|
|
5
5
|
Author: Smilinno
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -19,6 +19,7 @@ Requires-Dist: mammoth
|
|
|
19
19
|
Requires-Dist: markdown
|
|
20
20
|
Requires-Dist: beautifulsoup4
|
|
21
21
|
Requires-Dist: deepdiff
|
|
22
|
+
Requires-Dist: kombu
|
|
22
23
|
Dynamic: author
|
|
23
24
|
Dynamic: description
|
|
24
25
|
Dynamic: description-content-type
|
|
@@ -29,6 +30,12 @@ Dynamic: summary
|
|
|
29
30
|
this is a shared kernel package
|
|
30
31
|
|
|
31
32
|
# Change Log
|
|
33
|
+
### Version 2.5.1
|
|
34
|
+
- Apply log on jwt service
|
|
35
|
+
### Version 2.5.0
|
|
36
|
+
- Implement logger
|
|
37
|
+
### Version 2.4.1
|
|
38
|
+
- Fix file validation
|
|
32
39
|
### Version 2.4.0
|
|
33
40
|
- Implement file validation
|
|
34
41
|
### Version 2.3.0
|
|
@@ -35,9 +35,10 @@ setup(
|
|
|
35
35
|
"markdown",
|
|
36
36
|
"beautifulsoup4",
|
|
37
37
|
"deepdiff",
|
|
38
|
+
"kombu",
|
|
38
39
|
],
|
|
39
40
|
# *strongly* suggested for sharing
|
|
40
|
-
version="2.
|
|
41
|
+
version="2.5.1",
|
|
41
42
|
description="sharekernel is a shared package between all python projects",
|
|
42
43
|
long_description=long_description,
|
|
43
44
|
long_description_content_type="text/markdown",
|
|
@@ -19,7 +19,9 @@ DEFAULT_ALLOWED_MIME_TYPES = (
|
|
|
19
19
|
"text/csv",
|
|
20
20
|
"audio/mpeg",
|
|
21
21
|
"audio/wav",
|
|
22
|
+
"audio/x-wav",
|
|
22
23
|
"audio/mp3",
|
|
24
|
+
"application/zip",
|
|
23
25
|
)
|
|
24
26
|
|
|
25
27
|
|
|
@@ -46,7 +48,7 @@ def validate_file_type(fileobj, allowed_mimes=None):
|
|
|
46
48
|
allowed_mimes = allowed_mimes or DEFAULT_ALLOWED_MIME_TYPES
|
|
47
49
|
mime = get_mime_type(fileobj)
|
|
48
50
|
if mime not in allowed_mimes:
|
|
49
|
-
raise ValueError(f"
|
|
51
|
+
raise ValueError(f"قالب فایل '{fileobj.name}' معتبر نیست. لطفاً یکی از قالبهای مجاز را انتخاب کنید.")
|
|
50
52
|
return mime
|
|
51
53
|
|
|
52
54
|
|
|
@@ -5,6 +5,7 @@ from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
|
|
5
5
|
from sharedkernel.exception.exception import UnAuthorizedException
|
|
6
6
|
from sharedkernel.objects import JwtModel
|
|
7
7
|
from sharedkernel.objects.user_info import current_user_info, UserInfo
|
|
8
|
+
from sharedkernel.logger.log_decorator import unified_logger
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class JWTBearer(HTTPBearer):
|
|
@@ -13,6 +14,7 @@ class JWTBearer(HTTPBearer):
|
|
|
13
14
|
self.jwt_config = jwt_config
|
|
14
15
|
super(JWTBearer, self).__init__(auto_error=auto_error)
|
|
15
16
|
|
|
17
|
+
@unified_logger(class_name="JWTBearer")
|
|
16
18
|
async def __call__(self, request: Request):
|
|
17
19
|
try:
|
|
18
20
|
if current_user_info.get(None):
|
|
@@ -33,6 +35,7 @@ class JWTBearer(HTTPBearer):
|
|
|
33
35
|
except:
|
|
34
36
|
raise UnAuthorizedException()
|
|
35
37
|
|
|
38
|
+
@unified_logger(class_name="JWTBearer")
|
|
36
39
|
def verify(self, token: str) -> dict:
|
|
37
40
|
decoded_token = jwt.decode(
|
|
38
41
|
jwt=token.replace("Bearer", "").strip(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sharedkernel
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.5.1
|
|
4
4
|
Summary: sharekernel is a shared package between all python projects
|
|
5
5
|
Author: Smilinno
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -19,6 +19,7 @@ Requires-Dist: mammoth
|
|
|
19
19
|
Requires-Dist: markdown
|
|
20
20
|
Requires-Dist: beautifulsoup4
|
|
21
21
|
Requires-Dist: deepdiff
|
|
22
|
+
Requires-Dist: kombu
|
|
22
23
|
Dynamic: author
|
|
23
24
|
Dynamic: description
|
|
24
25
|
Dynamic: description-content-type
|
|
@@ -29,6 +30,12 @@ Dynamic: summary
|
|
|
29
30
|
this is a shared kernel package
|
|
30
31
|
|
|
31
32
|
# Change Log
|
|
33
|
+
### Version 2.5.1
|
|
34
|
+
- Apply log on jwt service
|
|
35
|
+
### Version 2.5.0
|
|
36
|
+
- Implement logger
|
|
37
|
+
### Version 2.4.1
|
|
38
|
+
- Fix file validation
|
|
32
39
|
### Version 2.4.0
|
|
33
40
|
- Implement file validation
|
|
34
41
|
### Version 2.3.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/database/mongo_generic_audit_repository.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sharedkernel-2.4.0 → sharedkernel-2.5.1}/sharedkernel/normalizer/phone_number_normalizer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|