Encryptors 2.76__tar.gz → 2.78__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.76 → encryptors-2.78}/PKG-INFO +1 -1
- {encryptors-2.76 → encryptors-2.78}/setup.py +1 -1
- {encryptors-2.76 → encryptors-2.78}/src/Encryptors.egg-info/PKG-INFO +1 -1
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Decorators/SecureResolver.py +18 -8
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/AuditQueue.py +5 -2
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/Graphql.py +1 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/TokenClaims.py +19 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Services/__init__.py +3 -2
- {encryptors-2.76 → encryptors-2.78}/README.md +0 -0
- {encryptors-2.76 → encryptors-2.78}/setup.cfg +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Encryptors.egg-info/SOURCES.txt +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Encryptors.egg-info/dependency_links.txt +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Encryptors.egg-info/entry_points.txt +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Encryptors.egg-info/requires.txt +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Encryptors.egg-info/top_level.txt +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Cache/Redis.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Cache/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Cli/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Constants/Constant.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Constants/Message.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Constants/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Context/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Database/BaseRepository.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Database/Connection.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Database/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Decorators/Grpc.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Decorators/Retry.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Decorators/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Encryptor/Aes.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Encryptor/Argon2.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Encryptor/Bcrypt.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Encryptor/Jwt.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Encryptor/Rsa.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Encryptor/Sha512.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Encryptor/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/AuditType.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/CipherType.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/FileType.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/GrahpqlOperation.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/GrpcStatusCode.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/Profile.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/ResultType.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/Secret.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/StatusCode.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Exception/ControlledException.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Exception/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/AuditHelper.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/AuthTokenProcessor.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/AzureClassifier.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/CipherHelper.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/JwtTokenHelper.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/Resilience.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Http/APIClient.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Http/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Messaging/AzureServiceBus.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Messaging/Kafka.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Messaging/RabbitMQ.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Messaging/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/ApiResponse.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/AuditContext.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/Notification.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/Response.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/Token.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Secrets/AzureKeyVaultProvider.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Secrets/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Services/GrpcConnection.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Services/JwtAuthTokenService.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Services/ServiceBusAuditEmitter.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Services/WebsocketClient.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Storage/AzureBlobStorage.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Storage/S3Storage.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Storage/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/CaseConverter.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/CodeGenerator.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/DataNormalizer.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/DataUtils.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/DateUtils.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/FileMetaData.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/HashValidator.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/Mapper.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/PasswordGenerator.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/QueryGenerator.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/RsaUtils.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/TextProcessor.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/__init__.py +0 -0
- {encryptors-2.76 → encryptors-2.78}/src/Osdental/__init__.py +0 -0
|
@@ -28,7 +28,11 @@ from Osdental.Context import _ctx
|
|
|
28
28
|
logger = logging.getLogger(__name__)
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
def resolver(
|
|
31
|
+
def resolver(
|
|
32
|
+
public: bool = False,
|
|
33
|
+
skip_token_validation: bool = False,
|
|
34
|
+
action=None
|
|
35
|
+
):
|
|
32
36
|
|
|
33
37
|
def decorator(func: Callable):
|
|
34
38
|
func._is_public = public
|
|
@@ -51,7 +55,7 @@ def resolver(public: bool = False, action=None):
|
|
|
51
55
|
|
|
52
56
|
# ── 1. AUTENTICACIÓN ──────────────────────────────
|
|
53
57
|
token_service: IAuthTokenService = container.auth_token_service
|
|
54
|
-
if not public:
|
|
58
|
+
if not public and not skip_token_validation:
|
|
55
59
|
user_token = extract_bearer_token(headers)
|
|
56
60
|
claims = await token_service.validate_internal_access_token(
|
|
57
61
|
user_token
|
|
@@ -127,8 +131,10 @@ def resolver(public: bool = False, action=None):
|
|
|
127
131
|
# ── 7. AUDITAR ÉXITO ──────────────────────
|
|
128
132
|
_ = asyncio.create_task(
|
|
129
133
|
container.audit_emitter.emit(
|
|
130
|
-
|
|
131
|
-
|
|
134
|
+
{
|
|
135
|
+
"payload": _build_success_payload(audit_ctx, result),
|
|
136
|
+
"is_auditable": settings.is_auditable,
|
|
137
|
+
}
|
|
132
138
|
)
|
|
133
139
|
)
|
|
134
140
|
|
|
@@ -139,8 +145,10 @@ def resolver(public: bool = False, action=None):
|
|
|
139
145
|
if audit_ctx:
|
|
140
146
|
_ = asyncio.create_task(
|
|
141
147
|
container.audit_emitter.emit(
|
|
142
|
-
|
|
143
|
-
|
|
148
|
+
{
|
|
149
|
+
"payload": _build_error_payload(audit_ctx, e),
|
|
150
|
+
"is_auditable": settings.is_auditable,
|
|
151
|
+
}
|
|
144
152
|
)
|
|
145
153
|
)
|
|
146
154
|
return Response(
|
|
@@ -153,8 +161,10 @@ def resolver(public: bool = False, action=None):
|
|
|
153
161
|
if audit_ctx:
|
|
154
162
|
_ = asyncio.create_task(
|
|
155
163
|
container.audit_emitter.emit(
|
|
156
|
-
|
|
157
|
-
|
|
164
|
+
{
|
|
165
|
+
"payload": _build_unexpected_payload(audit_ctx, e),
|
|
166
|
+
"is_auditable": settings.is_auditable,
|
|
167
|
+
}
|
|
158
168
|
)
|
|
159
169
|
)
|
|
160
170
|
return Response(
|
|
@@ -27,10 +27,13 @@ class AuditQueue:
|
|
|
27
27
|
|
|
28
28
|
async def _consume(self):
|
|
29
29
|
while True:
|
|
30
|
-
|
|
30
|
+
item = await self._queue.get()
|
|
31
31
|
|
|
32
32
|
try:
|
|
33
|
-
await self._worker(
|
|
33
|
+
await self._worker(
|
|
34
|
+
item["payload"],
|
|
35
|
+
item["is_auditable"],
|
|
36
|
+
)
|
|
34
37
|
|
|
35
38
|
except Exception:
|
|
36
39
|
logger.exception("Error processing audit")
|
|
@@ -77,4 +77,23 @@ class ActionTokenClaims(BaseClaims):
|
|
|
77
77
|
return cls(
|
|
78
78
|
sub=claims["sub"],
|
|
79
79
|
action=claims["action"],
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@dataclass(frozen=True, slots=True)
|
|
84
|
+
class ExternalTokenClaims(BaseClaims):
|
|
85
|
+
|
|
86
|
+
user_key: str
|
|
87
|
+
password: str
|
|
88
|
+
enterprise_key: str
|
|
89
|
+
id_authorization: str
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_dict(cls, claims: dict):
|
|
93
|
+
|
|
94
|
+
return cls(
|
|
95
|
+
user_key=claims["user_key"],
|
|
96
|
+
password=claims["password"],
|
|
97
|
+
enterprise_key=claims["enterprise_key"],
|
|
98
|
+
id_authorization=claims["id_authorization"],
|
|
80
99
|
)
|
|
@@ -16,13 +16,14 @@ class INotificationPublisher(ABC):
|
|
|
16
16
|
class IAuthTokenService(ABC):
|
|
17
17
|
|
|
18
18
|
from Osdental.Models.TokenClaims import (
|
|
19
|
-
|
|
19
|
+
BaseClaims, AccessTokenClaims,
|
|
20
|
+
UserTokenClaims, ActionTokenClaims
|
|
20
21
|
)
|
|
21
22
|
|
|
22
23
|
@abstractmethod
|
|
23
24
|
async def generate_token(
|
|
24
25
|
self,
|
|
25
|
-
claims:
|
|
26
|
+
claims: BaseClaims,
|
|
26
27
|
expires_at: datetime,
|
|
27
28
|
) -> str:
|
|
28
29
|
pass
|
|
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
|
|
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
|