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.
Files changed (89) hide show
  1. {encryptors-2.76 → encryptors-2.78}/PKG-INFO +1 -1
  2. {encryptors-2.76 → encryptors-2.78}/setup.py +1 -1
  3. {encryptors-2.76 → encryptors-2.78}/src/Encryptors.egg-info/PKG-INFO +1 -1
  4. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Decorators/SecureResolver.py +18 -8
  5. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/AuditQueue.py +5 -2
  6. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/Graphql.py +1 -0
  7. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/TokenClaims.py +19 -0
  8. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Services/__init__.py +3 -2
  9. {encryptors-2.76 → encryptors-2.78}/README.md +0 -0
  10. {encryptors-2.76 → encryptors-2.78}/setup.cfg +0 -0
  11. {encryptors-2.76 → encryptors-2.78}/src/Encryptors.egg-info/SOURCES.txt +0 -0
  12. {encryptors-2.76 → encryptors-2.78}/src/Encryptors.egg-info/dependency_links.txt +0 -0
  13. {encryptors-2.76 → encryptors-2.78}/src/Encryptors.egg-info/entry_points.txt +0 -0
  14. {encryptors-2.76 → encryptors-2.78}/src/Encryptors.egg-info/requires.txt +0 -0
  15. {encryptors-2.76 → encryptors-2.78}/src/Encryptors.egg-info/top_level.txt +0 -0
  16. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Cache/Redis.py +0 -0
  17. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Cache/__init__.py +0 -0
  18. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Cli/__init__.py +0 -0
  19. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Constants/Constant.py +0 -0
  20. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Constants/Message.py +0 -0
  21. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Constants/__init__.py +0 -0
  22. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Context/__init__.py +0 -0
  23. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Database/BaseRepository.py +0 -0
  24. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Database/Connection.py +0 -0
  25. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Database/__init__.py +0 -0
  26. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Decorators/Grpc.py +0 -0
  27. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Decorators/Retry.py +0 -0
  28. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Decorators/__init__.py +0 -0
  29. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Encryptor/Aes.py +0 -0
  30. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Encryptor/Argon2.py +0 -0
  31. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Encryptor/Bcrypt.py +0 -0
  32. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Encryptor/Jwt.py +0 -0
  33. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Encryptor/Rsa.py +0 -0
  34. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Encryptor/Sha512.py +0 -0
  35. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Encryptor/__init__.py +0 -0
  36. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/AuditType.py +0 -0
  37. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/CipherType.py +0 -0
  38. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/FileType.py +0 -0
  39. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/GrahpqlOperation.py +0 -0
  40. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/GrpcStatusCode.py +0 -0
  41. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/Profile.py +0 -0
  42. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/ResultType.py +0 -0
  43. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/Secret.py +0 -0
  44. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/StatusCode.py +0 -0
  45. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Enums/__init__.py +0 -0
  46. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Exception/ControlledException.py +0 -0
  47. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Exception/__init__.py +0 -0
  48. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/AuditHelper.py +0 -0
  49. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/AuthTokenProcessor.py +0 -0
  50. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/AzureClassifier.py +0 -0
  51. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/CipherHelper.py +0 -0
  52. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/JwtTokenHelper.py +0 -0
  53. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/Resilience.py +0 -0
  54. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Helpers/__init__.py +0 -0
  55. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Http/APIClient.py +0 -0
  56. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Http/__init__.py +0 -0
  57. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Messaging/AzureServiceBus.py +0 -0
  58. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Messaging/Kafka.py +0 -0
  59. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Messaging/RabbitMQ.py +0 -0
  60. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Messaging/__init__.py +0 -0
  61. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/ApiResponse.py +0 -0
  62. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/AuditContext.py +0 -0
  63. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/Notification.py +0 -0
  64. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/Response.py +0 -0
  65. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/Token.py +0 -0
  66. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Models/__init__.py +0 -0
  67. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Secrets/AzureKeyVaultProvider.py +0 -0
  68. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Secrets/__init__.py +0 -0
  69. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Services/GrpcConnection.py +0 -0
  70. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Services/JwtAuthTokenService.py +0 -0
  71. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Services/ServiceBusAuditEmitter.py +0 -0
  72. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Services/WebsocketClient.py +0 -0
  73. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Storage/AzureBlobStorage.py +0 -0
  74. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Storage/S3Storage.py +0 -0
  75. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Storage/__init__.py +0 -0
  76. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/CaseConverter.py +0 -0
  77. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/CodeGenerator.py +0 -0
  78. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/DataNormalizer.py +0 -0
  79. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/DataUtils.py +0 -0
  80. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/DateUtils.py +0 -0
  81. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/FileMetaData.py +0 -0
  82. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/HashValidator.py +0 -0
  83. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/Mapper.py +0 -0
  84. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/PasswordGenerator.py +0 -0
  85. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/QueryGenerator.py +0 -0
  86. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/RsaUtils.py +0 -0
  87. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/TextProcessor.py +0 -0
  88. {encryptors-2.76 → encryptors-2.78}/src/Osdental/Utils/__init__.py +0 -0
  89. {encryptors-2.76 → encryptors-2.78}/src/Osdental/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Encryptors
3
- Version: 2.76
3
+ Version: 2.78
4
4
  Summary: End-to-end algorithm library
5
5
  Author: OSDental LLC
6
6
  Author-email: support@osdental.ai
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="Encryptors",
5
- version="2.76",
5
+ version="2.78",
6
6
  author="OSDental LLC",
7
7
  author_email="support@osdental.ai",
8
8
  description="End-to-end algorithm library",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Encryptors
3
- Version: 2.76
3
+ Version: 2.78
4
4
  Summary: End-to-end algorithm library
5
5
  Author: OSDental LLC
6
6
  Author-email: support@osdental.ai
@@ -28,7 +28,11 @@ from Osdental.Context import _ctx
28
28
  logger = logging.getLogger(__name__)
29
29
 
30
30
 
31
- def resolver(public: bool = False, action=None):
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
- _build_success_payload(audit_ctx, result),
131
- settings.is_auditable,
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
- _build_error_payload(audit_ctx, e),
143
- settings.is_auditable,
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
- _build_unexpected_payload(audit_ctx, e),
157
- settings.is_auditable,
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
- payload = await self._queue.get()
30
+ item = await self._queue.get()
31
31
 
32
32
  try:
33
- await self._worker(payload)
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")
@@ -10,4 +10,5 @@ class BaseGraphQLContext:
10
10
  container: Any
11
11
  access_token: str | None = None
12
12
  access_token_claims: AccessTokenClaims | None = None
13
+ user_token: str | None = None
13
14
  token: AuthToken | None = None
@@ -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
- AccessTokenClaims, UserTokenClaims, ActionTokenClaims
19
+ BaseClaims, AccessTokenClaims,
20
+ UserTokenClaims, ActionTokenClaims
20
21
  )
21
22
 
22
23
  @abstractmethod
23
24
  async def generate_token(
24
25
  self,
25
- claims: AccessTokenClaims | UserTokenClaims | ActionTokenClaims,
26
+ claims: BaseClaims,
26
27
  expires_at: datetime,
27
28
  ) -> str:
28
29
  pass
File without changes
File without changes