Encryptors 2.72__tar.gz → 2.74__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.72 → encryptors-2.74}/PKG-INFO +1 -1
- {encryptors-2.72 → encryptors-2.74}/setup.py +2 -2
- {encryptors-2.72 → encryptors-2.74}/src/Encryptors.egg-info/PKG-INFO +1 -1
- {encryptors-2.72 → encryptors-2.74}/src/Encryptors.egg-info/SOURCES.txt +1 -1
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Decorators/SecureResolver.py +13 -6
- encryptors-2.74/src/Osdental/Services/GrpcConnection.py +60 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Services/__init__.py +2 -1
- encryptors-2.72/src/Osdental/Helpers/GrpcConnection.py +0 -24
- {encryptors-2.72 → encryptors-2.74}/README.md +0 -0
- {encryptors-2.72 → encryptors-2.74}/setup.cfg +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Encryptors.egg-info/dependency_links.txt +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Encryptors.egg-info/entry_points.txt +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Encryptors.egg-info/requires.txt +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Encryptors.egg-info/top_level.txt +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Cache/Redis.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Cache/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Cli/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Constants/Constant.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Constants/Message.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Constants/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Context/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Database/BaseRepository.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Database/Connection.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Database/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Decorators/Grpc.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Decorators/Retry.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Decorators/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Encryptor/Aes.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Encryptor/Argon2.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Encryptor/Bcrypt.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Encryptor/Jwt.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Encryptor/Rsa.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Encryptor/Sha512.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Encryptor/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Enums/AuditType.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Enums/CipherType.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Enums/FileType.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Enums/GrahpqlOperation.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Enums/GrpcStatusCode.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Enums/Profile.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Enums/ResultType.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Enums/Secret.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Enums/StatusCode.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Enums/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Exception/ControlledException.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Exception/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Helpers/AuditHelper.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Helpers/AuditQueue.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Helpers/AuthTokenProcessor.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Helpers/AzureClassifier.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Helpers/CipherHelper.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Helpers/JwtTokenHelper.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Helpers/Resilience.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Helpers/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Http/APIClient.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Http/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Messaging/AzureServiceBus.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Messaging/Kafka.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Messaging/RabbitMQ.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Messaging/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Models/ApiResponse.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Models/AuditContext.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Models/Graphql.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Models/Notification.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Models/Response.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Models/Token.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Models/TokenClaims.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Models/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Secrets/AzureKeyVaultProvider.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Secrets/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Services/JwtAuthTokenService.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Services/ServiceBusAuditEmitter.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Services/WebsocketClient.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Storage/AzureBlobStorage.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Storage/S3Storage.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Storage/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Utils/CaseConverter.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Utils/CodeGenerator.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Utils/DataNormalizer.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Utils/DataUtils.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Utils/DateUtils.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Utils/FileMetaData.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Utils/HashValidator.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Utils/Mapper.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Utils/PasswordGenerator.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Utils/QueryGenerator.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Utils/RsaUtils.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Utils/TextProcessor.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/Utils/__init__.py +0 -0
- {encryptors-2.72 → encryptors-2.74}/src/Osdental/__init__.py +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from setuptools import setup, find_packages
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
setup(
|
|
4
4
|
name="Encryptors",
|
|
5
|
-
version="2.
|
|
5
|
+
version="2.74",
|
|
6
6
|
author="OSDental LLC",
|
|
7
7
|
author_email="support@osdental.ai",
|
|
8
8
|
description="End-to-end algorithm library",
|
|
@@ -45,7 +45,6 @@ src/Osdental/Helpers/AuditQueue.py
|
|
|
45
45
|
src/Osdental/Helpers/AuthTokenProcessor.py
|
|
46
46
|
src/Osdental/Helpers/AzureClassifier.py
|
|
47
47
|
src/Osdental/Helpers/CipherHelper.py
|
|
48
|
-
src/Osdental/Helpers/GrpcConnection.py
|
|
49
48
|
src/Osdental/Helpers/JwtTokenHelper.py
|
|
50
49
|
src/Osdental/Helpers/Resilience.py
|
|
51
50
|
src/Osdental/Helpers/__init__.py
|
|
@@ -65,6 +64,7 @@ src/Osdental/Models/TokenClaims.py
|
|
|
65
64
|
src/Osdental/Models/__init__.py
|
|
66
65
|
src/Osdental/Secrets/AzureKeyVaultProvider.py
|
|
67
66
|
src/Osdental/Secrets/__init__.py
|
|
67
|
+
src/Osdental/Services/GrpcConnection.py
|
|
68
68
|
src/Osdental/Services/JwtAuthTokenService.py
|
|
69
69
|
src/Osdental/Services/ServiceBusAuditEmitter.py
|
|
70
70
|
src/Osdental/Services/WebsocketClient.py
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
import asyncio
|
|
2
3
|
from functools import wraps
|
|
3
4
|
from typing import Callable
|
|
4
5
|
from graphql import GraphQLResolveInfo
|
|
@@ -124,8 +125,10 @@ def resolver(public: bool = False, action=None):
|
|
|
124
125
|
raise TypeError("Resolver must return a Response instance")
|
|
125
126
|
|
|
126
127
|
# ── 7. AUDITAR ÉXITO ──────────────────────
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
_ = asyncio.create_task(
|
|
129
|
+
container.audit_emitter.emit(
|
|
130
|
+
_build_success_payload(audit_ctx, result)
|
|
131
|
+
)
|
|
129
132
|
)
|
|
130
133
|
|
|
131
134
|
return result
|
|
@@ -133,8 +136,10 @@ def resolver(public: bool = False, action=None):
|
|
|
133
136
|
except OSDException as e:
|
|
134
137
|
logger.warning(f"Business error: {str(e)}")
|
|
135
138
|
if audit_ctx:
|
|
136
|
-
|
|
137
|
-
|
|
139
|
+
_ = asyncio.create_task(
|
|
140
|
+
container.audit_emitter.emit(
|
|
141
|
+
_build_error_payload(audit_ctx, e)
|
|
142
|
+
)
|
|
138
143
|
)
|
|
139
144
|
return Response(
|
|
140
145
|
status=e.status_code,
|
|
@@ -144,8 +149,10 @@ def resolver(public: bool = False, action=None):
|
|
|
144
149
|
except Exception as e:
|
|
145
150
|
logger.exception(f"Unexpected error: {str(e)}")
|
|
146
151
|
if audit_ctx:
|
|
147
|
-
|
|
148
|
-
|
|
152
|
+
_ = asyncio.create_task(
|
|
153
|
+
container.audit_emitter.emit(
|
|
154
|
+
_build_unexpected_payload(audit_ctx, e)
|
|
155
|
+
)
|
|
149
156
|
)
|
|
150
157
|
return Response(
|
|
151
158
|
status=StatusCode.INTERNAL_SERVER_ERROR,
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import grpc
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
class GrpcConnection:
|
|
6
|
+
|
|
7
|
+
DEFAULT_OPTIONS = (
|
|
8
|
+
("grpc.keepalive_time_ms", 30000),
|
|
9
|
+
("grpc.keepalive_timeout_ms", 10000),
|
|
10
|
+
("grpc.keepalive_permit_without_calls", True),
|
|
11
|
+
("grpc.http2.max_pings_without_data", 0),
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
def __init__(
|
|
15
|
+
self,
|
|
16
|
+
host: str,
|
|
17
|
+
secure: bool = True,
|
|
18
|
+
options=None,
|
|
19
|
+
):
|
|
20
|
+
self.options = options or self.DEFAULT_OPTIONS
|
|
21
|
+
self.host = host
|
|
22
|
+
self.secure = secure
|
|
23
|
+
self._channel: Optional[grpc.aio.Channel] = None
|
|
24
|
+
self._lock = asyncio.Lock()
|
|
25
|
+
|
|
26
|
+
async def connect(self):
|
|
27
|
+
|
|
28
|
+
if self._channel:
|
|
29
|
+
return self._channel
|
|
30
|
+
|
|
31
|
+
async with self._lock:
|
|
32
|
+
|
|
33
|
+
if self._channel:
|
|
34
|
+
return self._channel
|
|
35
|
+
|
|
36
|
+
if self.secure:
|
|
37
|
+
creds = grpc.ssl_channel_credentials()
|
|
38
|
+
|
|
39
|
+
self._channel = grpc.aio.secure_channel(
|
|
40
|
+
self.host,
|
|
41
|
+
creds,
|
|
42
|
+
options=self.options,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
else:
|
|
46
|
+
|
|
47
|
+
self._channel = grpc.aio.insecure_channel(
|
|
48
|
+
self.host,
|
|
49
|
+
options=self.options,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
await self._channel.channel_ready()
|
|
53
|
+
|
|
54
|
+
return self._channel
|
|
55
|
+
|
|
56
|
+
async def close(self) -> None:
|
|
57
|
+
|
|
58
|
+
if self._channel is not None:
|
|
59
|
+
await self._channel.close()
|
|
60
|
+
self._channel = None
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from abc import ABC, abstractmethod
|
|
2
2
|
from typing import Protocol, Any, Dict
|
|
3
|
+
from datetime import datetime
|
|
3
4
|
from Osdental.Models.Notification import Notification
|
|
4
5
|
|
|
5
6
|
class INotificationPublisher(ABC):
|
|
@@ -22,7 +23,7 @@ class IAuthTokenService(ABC):
|
|
|
22
23
|
async def generate_token(
|
|
23
24
|
self,
|
|
24
25
|
claims: AccessTokenClaims | UserTokenClaims | ActionTokenClaims,
|
|
25
|
-
|
|
26
|
+
expires_at: datetime,
|
|
26
27
|
) -> str:
|
|
27
28
|
pass
|
|
28
29
|
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import grpc
|
|
2
|
-
from typing import Optional
|
|
3
|
-
|
|
4
|
-
class GrpcConnection:
|
|
5
|
-
|
|
6
|
-
def __init__(self, host: str, secure: bool = True):
|
|
7
|
-
self.host = host
|
|
8
|
-
self.secure = secure
|
|
9
|
-
self._channel: Optional[grpc.aio.Channel] = None
|
|
10
|
-
|
|
11
|
-
def connect(self):
|
|
12
|
-
if not self._channel:
|
|
13
|
-
if self.secure:
|
|
14
|
-
creds = grpc.ssl_channel_credentials()
|
|
15
|
-
self._channel = grpc.aio.secure_channel(self.host, creds)
|
|
16
|
-
else:
|
|
17
|
-
self._channel = grpc.aio.insecure_channel(self.host)
|
|
18
|
-
|
|
19
|
-
return self._channel
|
|
20
|
-
|
|
21
|
-
async def close(self) -> None:
|
|
22
|
-
if self._channel is not None:
|
|
23
|
-
await self._channel.close()
|
|
24
|
-
self._channel = None
|
|
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
|
|
File without changes
|