Encryptors 2.71__tar.gz → 2.72__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.71 → encryptors-2.72}/PKG-INFO +1 -1
- {encryptors-2.71 → encryptors-2.72}/setup.py +1 -1
- {encryptors-2.71 → encryptors-2.72}/src/Encryptors.egg-info/PKG-INFO +1 -1
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Helpers/AuthTokenProcessor.py +6 -1
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Helpers/JwtTokenHelper.py +2 -9
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Services/JwtAuthTokenService.py +3 -2
- {encryptors-2.71 → encryptors-2.72}/README.md +0 -0
- {encryptors-2.71 → encryptors-2.72}/setup.cfg +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Encryptors.egg-info/SOURCES.txt +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Encryptors.egg-info/dependency_links.txt +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Encryptors.egg-info/entry_points.txt +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Encryptors.egg-info/requires.txt +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Encryptors.egg-info/top_level.txt +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Cache/Redis.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Cache/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Cli/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Constants/Constant.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Constants/Message.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Constants/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Context/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Database/BaseRepository.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Database/Connection.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Database/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Decorators/Grpc.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Decorators/Retry.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Decorators/SecureResolver.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Decorators/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Encryptor/Aes.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Encryptor/Argon2.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Encryptor/Bcrypt.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Encryptor/Jwt.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Encryptor/Rsa.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Encryptor/Sha512.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Encryptor/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Enums/AuditType.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Enums/CipherType.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Enums/FileType.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Enums/GrahpqlOperation.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Enums/GrpcStatusCode.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Enums/Profile.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Enums/ResultType.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Enums/Secret.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Enums/StatusCode.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Enums/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Exception/ControlledException.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Exception/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Helpers/AuditHelper.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Helpers/AuditQueue.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Helpers/AzureClassifier.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Helpers/CipherHelper.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Helpers/GrpcConnection.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Helpers/Resilience.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Helpers/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Http/APIClient.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Http/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Messaging/AzureServiceBus.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Messaging/Kafka.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Messaging/RabbitMQ.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Messaging/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Models/ApiResponse.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Models/AuditContext.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Models/Graphql.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Models/Notification.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Models/Response.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Models/Token.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Models/TokenClaims.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Models/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Secrets/AzureKeyVaultProvider.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Secrets/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Services/ServiceBusAuditEmitter.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Services/WebsocketClient.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Services/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Storage/AzureBlobStorage.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Storage/S3Storage.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Storage/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Utils/CaseConverter.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Utils/CodeGenerator.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Utils/DataNormalizer.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Utils/DataUtils.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Utils/DateUtils.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Utils/FileMetaData.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Utils/HashValidator.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Utils/Mapper.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Utils/PasswordGenerator.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Utils/QueryGenerator.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Utils/RsaUtils.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Utils/TextProcessor.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/Utils/__init__.py +0 -0
- {encryptors-2.71 → encryptors-2.72}/src/Osdental/__init__.py +0 -0
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
# ANDERSON REVISAR EL CACHE LOCAL DEL KEYVAULT PARA VALIDAR SI FUNCIONA
|
|
3
3
|
setup(
|
|
4
4
|
name="Encryptors",
|
|
5
|
-
version="2.
|
|
5
|
+
version="2.72",
|
|
6
6
|
author="OSDental LLC",
|
|
7
7
|
author_email="support@osdental.ai",
|
|
8
8
|
description="End-to-end algorithm library",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from typing import Dict, Any
|
|
3
3
|
from uuid import UUID
|
|
4
|
+
from datetime import datetime, timezone, timedelta
|
|
4
5
|
from graphql import OperationType
|
|
5
6
|
from starlette.datastructures import Headers
|
|
6
7
|
from Osdental.Encryptor.Aes import AES
|
|
@@ -111,4 +112,8 @@ def get_current_aes_key(context: BaseGraphQLContext):
|
|
|
111
112
|
if context.access_token_claims:
|
|
112
113
|
return context.access_token_claims.aes_key
|
|
113
114
|
|
|
114
|
-
return None
|
|
115
|
+
return None
|
|
116
|
+
|
|
117
|
+
def get_token_exp(exp_minutes: int) -> datetime:
|
|
118
|
+
now = datetime.now(timezone.utc)
|
|
119
|
+
return now + timedelta(minutes=exp_minutes)
|
|
@@ -25,7 +25,7 @@ class JwtTokenHelper:
|
|
|
25
25
|
def generate_token(
|
|
26
26
|
self,
|
|
27
27
|
claims: dict,
|
|
28
|
-
|
|
28
|
+
expires_at: datetime,
|
|
29
29
|
) -> str:
|
|
30
30
|
|
|
31
31
|
now = datetime.now(timezone.utc)
|
|
@@ -34,14 +34,7 @@ class JwtTokenHelper:
|
|
|
34
34
|
**claims,
|
|
35
35
|
"iat": int(now.timestamp()),
|
|
36
36
|
"nbf": int(now.timestamp()),
|
|
37
|
-
"exp": int(
|
|
38
|
-
(
|
|
39
|
-
now
|
|
40
|
-
+ timedelta(
|
|
41
|
-
minutes=expiration_minutes
|
|
42
|
-
)
|
|
43
|
-
).timestamp()
|
|
44
|
-
),
|
|
37
|
+
"exp": int(expires_at.timestamp()),
|
|
45
38
|
}
|
|
46
39
|
|
|
47
40
|
# 1. Firmar → JWS (inner JWT)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
+
from datetime import datetime
|
|
2
3
|
from Osdental.Models.TokenClaims import (
|
|
3
4
|
BaseClaims, AccessTokenClaims, UserTokenClaims,
|
|
4
5
|
ActionTokenClaims, TokenValidationOptions
|
|
@@ -59,7 +60,7 @@ class JwtAuthTokenService(IAuthTokenService):
|
|
|
59
60
|
async def generate_token(
|
|
60
61
|
self,
|
|
61
62
|
claims: BaseClaims,
|
|
62
|
-
|
|
63
|
+
expires_at: datetime,
|
|
63
64
|
) -> str:
|
|
64
65
|
|
|
65
66
|
await self._ensure_initialized()
|
|
@@ -71,7 +72,7 @@ class JwtAuthTokenService(IAuthTokenService):
|
|
|
71
72
|
}
|
|
72
73
|
return self._jwt.generate_token(
|
|
73
74
|
claims=claims,
|
|
74
|
-
|
|
75
|
+
expires_at=expires_at,
|
|
75
76
|
)
|
|
76
77
|
|
|
77
78
|
|
|
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
|
|
File without changes
|