Encryptors 2.38__tar.gz → 2.39__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.
- {encryptors-2.38 → encryptors-2.39}/PKG-INFO +1 -1
- {encryptors-2.38 → encryptors-2.39}/setup.py +1 -1
- {encryptors-2.38 → encryptors-2.39}/src/Encryptors.egg-info/PKG-INFO +1 -1
- {encryptors-2.38 → encryptors-2.39}/src/Encryptors.egg-info/SOURCES.txt +0 -2
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Graphql/_Helpers/_TenantPolicy.py +1 -3
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Graphql/_Helpers/_TokenService.py +16 -1
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Messaging/AzureServiceBus.py +2 -1
- encryptors-2.39/src/Osdental/Models/Token.py +20 -0
- encryptors-2.38/src/Osdental/Models/Catalog.py +0 -19
- encryptors-2.38/src/Osdental/Models/Legacy.py +0 -52
- encryptors-2.38/src/Osdental/Models/Token.py +0 -23
- {encryptors-2.38 → encryptors-2.39}/README.md +0 -0
- {encryptors-2.38 → encryptors-2.39}/setup.cfg +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Encryptors.egg-info/dependency_links.txt +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Encryptors.egg-info/entry_points.txt +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Encryptors.egg-info/requires.txt +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Encryptors.egg-info/top_level.txt +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Cli/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Database/BaseRepository.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Database/Connection.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Database/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Decorators/Grpc.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Decorators/Retry.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Decorators/SecureResolver.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Decorators/SqlDataNormalizer.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Decorators/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Encryptor/Aes.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Encryptor/Argon2.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Encryptor/Bcrypt.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Encryptor/Jwt.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Encryptor/Rsa.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Encryptor/Sha512.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Encryptor/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Exception/ControlledException.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Exception/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Graphql/Extensions/AuditExtension.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Graphql/Extensions/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Graphql/Models/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Graphql/_Exceptions/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Graphql/_Helpers/_AuditHelper.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Graphql/_Helpers/_ExtractAuthToken.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Graphql/_Helpers/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Graphql/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Helpers/AuditDispatcher.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Helpers/KeyVaultService.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Helpers/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Http/APIClient.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Http/_Exceptions.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Http/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Messaging/Kafka.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Messaging/RabbitMQ.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Messaging/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Models/AuditConfig.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Models/Response.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Models/_Audit.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Models/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/RedisCache/Redis.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/RedisCache/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Rest/Context/RequestContext.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Rest/Context/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Rest/Middlewares/RequestContextMiddleware.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Rest/Middlewares/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Rest/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Enums/Code.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Enums/Constant.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Enums/FileType.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Enums/GrahpqlOperation.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Enums/Message.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Enums/Profile.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Enums/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Logger.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Utils/CaseConverter.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Utils/CodeGenerator.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Utils/DataNormalizer.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Utils/DataUtils.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Utils/DateUtils.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Utils/FileMetaData.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Utils/HashValidator.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Utils/Mapper.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Utils/PasswordGenerator.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Utils/QueryGenerator.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Utils/TextProcessor.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/Utils/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Shared/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Storage/AzureBlobStorage.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Storage/S3Storage.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/Storage/__init__.py +0 -0
- {encryptors-2.38 → encryptors-2.39}/src/Osdental/__init__.py +0 -0
|
@@ -46,8 +46,6 @@ src/Osdental/Messaging/Kafka.py
|
|
|
46
46
|
src/Osdental/Messaging/RabbitMQ.py
|
|
47
47
|
src/Osdental/Messaging/__init__.py
|
|
48
48
|
src/Osdental/Models/AuditConfig.py
|
|
49
|
-
src/Osdental/Models/Catalog.py
|
|
50
|
-
src/Osdental/Models/Legacy.py
|
|
51
49
|
src/Osdental/Models/Response.py
|
|
52
50
|
src/Osdental/Models/Token.py
|
|
53
51
|
src/Osdental/Models/_Audit.py
|
|
@@ -14,9 +14,7 @@ class TenantPolicy:
|
|
|
14
14
|
decrypted_payload: Dict[str, Any],
|
|
15
15
|
operation_type: str
|
|
16
16
|
) -> AuthToken:
|
|
17
|
-
|
|
18
|
-
# Set original idExternalEnterprise
|
|
19
|
-
token.base_id_external_enterprise = token.id_external_enterprise
|
|
17
|
+
|
|
20
18
|
# SUPER ADMIN / OSDEL ADMIN -> UUID 0
|
|
21
19
|
should_use_zero_uuid = (
|
|
22
20
|
token.abbreviation.startswith(("SPAU", "OSDA"))
|
|
@@ -15,7 +15,22 @@ class TokenService:
|
|
|
15
15
|
|
|
16
16
|
user_token = AES.decrypt(aes_user, encrypted_token)
|
|
17
17
|
payload = JWT.extract_payload(user_token, self.jwt_user_key)
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
token = AuthToken(
|
|
20
|
+
id_token=payload.get("idToken"),
|
|
21
|
+
id_user=payload.get("idUser"),
|
|
22
|
+
id_external_enterprise=payload.get("idExternalEnterprise"),
|
|
23
|
+
id_profile=payload.get("idProfile"),
|
|
24
|
+
id_legacy=payload.get("idLegacy"),
|
|
25
|
+
id_authorization=payload.get("idAuthorization"),
|
|
26
|
+
id_item_report=payload.get("idItemReport"),
|
|
27
|
+
id_enterprise=payload.get("idEnterprise"),
|
|
28
|
+
user_full_name=payload.get("userFullName"),
|
|
29
|
+
abbreviation=payload.get("abbreviation"),
|
|
30
|
+
aes_key_auth=payload.get("aesKeyAuth"),
|
|
31
|
+
aes_key_user=payload.get("aesKeyUser"),
|
|
32
|
+
base_id_external_enterprise=payload.get("idExternalEnterprise")
|
|
33
|
+
)
|
|
19
34
|
|
|
20
35
|
# Validate via RPC
|
|
21
36
|
paylod = {
|
|
@@ -3,6 +3,7 @@ from typing import Dict, Any
|
|
|
3
3
|
from azure.servicebus import ServiceBusMessage
|
|
4
4
|
from azure.servicebus.aio import ServiceBusClient
|
|
5
5
|
from azure.identity.aio import DefaultAzureCredential
|
|
6
|
+
from azure.servicebus.exceptions import ServiceBusError
|
|
6
7
|
from Osdental.Messaging import IMessageQueue
|
|
7
8
|
|
|
8
9
|
class AzureServiceBusQueue(IMessageQueue):
|
|
@@ -33,7 +34,7 @@ class AzureServiceBusQueue(IMessageQueue):
|
|
|
33
34
|
try:
|
|
34
35
|
await self.sender.send_messages(msg)
|
|
35
36
|
|
|
36
|
-
except
|
|
37
|
+
except ServiceBusError:
|
|
37
38
|
# recrear sender si se rompió conexión
|
|
38
39
|
await self.sender.__aexit__(None, None, None)
|
|
39
40
|
self.sender = self.client.get_queue_sender(queue_name=self.queue_name)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
|
|
4
|
+
@dataclass
|
|
5
|
+
class AuthToken:
|
|
6
|
+
id_token: str
|
|
7
|
+
id_user: str
|
|
8
|
+
id_external_enterprise: str
|
|
9
|
+
id_profile: str
|
|
10
|
+
id_legacy: str
|
|
11
|
+
id_authorization: str
|
|
12
|
+
id_item_report: str
|
|
13
|
+
id_enterprise: str
|
|
14
|
+
user_full_name: str
|
|
15
|
+
abbreviation: str
|
|
16
|
+
aes_key_auth: str
|
|
17
|
+
aes_key_user: Optional[str] = None
|
|
18
|
+
access_token: Optional[str] = None
|
|
19
|
+
base_id_external_enterprise: Optional[str] = None
|
|
20
|
+
mk_id_external_enterprise: Optional[str] = None
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
from dataclasses import dataclass
|
|
3
|
-
from typing import Dict
|
|
4
|
-
from Osdental.Shared.Utils.CaseConverter import CaseConverter
|
|
5
|
-
|
|
6
|
-
@dataclass
|
|
7
|
-
class Catalog:
|
|
8
|
-
id_catalog: str
|
|
9
|
-
name_catalog: str
|
|
10
|
-
id_detail: str
|
|
11
|
-
code: str
|
|
12
|
-
value: str
|
|
13
|
-
|
|
14
|
-
@classmethod
|
|
15
|
-
def from_db(cls, record: Dict[str,str]) -> Catalog:
|
|
16
|
-
mapped = {CaseConverter.case_to_snake(key) : value for key, value in record.items()}
|
|
17
|
-
valid_fields = cls.__dataclass_fields__.keys()
|
|
18
|
-
clean = {k: v for k, v in mapped.items() if k in valid_fields}
|
|
19
|
-
return cls(**clean)
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
from dataclasses import dataclass
|
|
3
|
-
from typing import Dict
|
|
4
|
-
from Osdental.Shared.Utils.CaseConverter import CaseConverter
|
|
5
|
-
from Osdental.Exception.ControlledException import MissingFieldException
|
|
6
|
-
from Osdental.Shared.Enums.Message import Message
|
|
7
|
-
|
|
8
|
-
@dataclass
|
|
9
|
-
class Legacy:
|
|
10
|
-
id_legacy: str
|
|
11
|
-
legacy_name: str
|
|
12
|
-
id_enterprise: str
|
|
13
|
-
refresh_token_exp_min: int
|
|
14
|
-
access_token_exp_min: int
|
|
15
|
-
public_key2: str
|
|
16
|
-
private_key1: str
|
|
17
|
-
private_key2: str
|
|
18
|
-
aes_key_user: str
|
|
19
|
-
aes_key_auth: str
|
|
20
|
-
|
|
21
|
-
def __post_init__(self):
|
|
22
|
-
if not self.legacy_name:
|
|
23
|
-
raise MissingFieldException(message=Message.LEGACY_NAME_REQUIRED_MSG)
|
|
24
|
-
|
|
25
|
-
if not self.refresh_token_exp_min:
|
|
26
|
-
raise MissingFieldException(message=Message.REFRESH_TOKEN_EXP_REQUIRED_MSG)
|
|
27
|
-
|
|
28
|
-
if not self.access_token_exp_min:
|
|
29
|
-
raise MissingFieldException(message=Message.ACCESS_TOKEN_EXP_REQUIRED_MSG)
|
|
30
|
-
|
|
31
|
-
if not self.public_key2:
|
|
32
|
-
raise MissingFieldException(message=Message.PUBLIC_KEY2_REQUIRED_MSG)
|
|
33
|
-
|
|
34
|
-
if not self.private_key1:
|
|
35
|
-
raise MissingFieldException(message=Message.PRIVATE_KEY1_REQUIRED_MSG)
|
|
36
|
-
|
|
37
|
-
if not self.private_key2:
|
|
38
|
-
raise MissingFieldException(message=Message.PRIVATE_KEY2_REQUIRED_MSG)
|
|
39
|
-
|
|
40
|
-
if not self.aes_key_user:
|
|
41
|
-
raise MissingFieldException(message=Message.AES_KEY_USER_REQUIRED_MSG)
|
|
42
|
-
|
|
43
|
-
if not self.aes_key_auth:
|
|
44
|
-
raise MissingFieldException(message=Message.AES_KEY_AUTH_REQUIRED_MSG)
|
|
45
|
-
|
|
46
|
-
@classmethod
|
|
47
|
-
def from_db(cls, record: Dict[str,str]) -> Legacy:
|
|
48
|
-
mapped = {CaseConverter.case_to_snake(key) : value for key, value in record.items()}
|
|
49
|
-
valid_fields = cls.__dataclass_fields__.keys()
|
|
50
|
-
clean = {k: v for k, v in mapped.items() if k in valid_fields}
|
|
51
|
-
return cls(**clean)
|
|
52
|
-
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from typing import Optional
|
|
2
|
-
from pydantic import BaseModel, Field
|
|
3
|
-
from Osdental.Models.Legacy import Legacy
|
|
4
|
-
|
|
5
|
-
class AuthToken(BaseModel):
|
|
6
|
-
|
|
7
|
-
id_token: str = Field(alias="idToken")
|
|
8
|
-
id_user: str = Field(alias="idUser")
|
|
9
|
-
id_external_enterprise: str = Field(alias="idExternalEnterprise")
|
|
10
|
-
id_profile: str = Field(alias="idProfile")
|
|
11
|
-
id_legacy: str = Field(alias="idLegacy")
|
|
12
|
-
id_authorization: str = Field(default=None, alias="idAuthorization")
|
|
13
|
-
id_item_report: str = Field(alias="idItemReport")
|
|
14
|
-
id_enterprise: str = Field(alias="idEnterprise")
|
|
15
|
-
user_full_name: str = Field(alias="userFullName")
|
|
16
|
-
abbreviation: str = Field(alias="abbreviation")
|
|
17
|
-
aes_key_auth: str = Field(alias="aesKeyAuth")
|
|
18
|
-
access_token: Optional[str] = Field(default=None, alias="accessToken")
|
|
19
|
-
base_id_external_enterprise: Optional[str] = Field(default=None, alias="baseIdExternalEnterprise")
|
|
20
|
-
mk_id_external_enterprise: Optional[str] = Field(default=None, alias="mkIdExternalEnterprise")
|
|
21
|
-
|
|
22
|
-
class ConfigDict:
|
|
23
|
-
populate_by_name = True
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{encryptors-2.38 → encryptors-2.39}/src/Osdental/Rest/Middlewares/RequestContextMiddleware.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
|
|
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
|