fix(typing): resolucion integral de advertencias de tipado, extraccion de payload con get_request_payload y limpieza de modelos

This commit is contained in:
2026-10-19 16:02:42 -03:00
parent 5ed62d5d30
commit eff5ed5ce0
13 changed files with 78 additions and 235 deletions
+4 -3
View File
@@ -28,17 +28,18 @@ class CryptoService:
return encrypted_bytes.decode('utf-8')
@classmethod
def decrypt(cls, cipher_text: str) -> str:
def decrypt(cls, cipher_text: Any) -> str:
"""Descifra un texto cifrado y retorna el texto original. Si falla, retorna vacío."""
if not cipher_text:
return ''
cipher_str = str(cipher_text)
try:
fernet = cls._get_fernet()
decrypted_bytes = fernet.decrypt(cipher_text.encode('utf-8'))
decrypted_bytes = fernet.decrypt(cipher_str.encode('utf-8'))
return decrypted_bytes.decode('utf-8')
except Exception:
# Si no era un texto cifrado con Fernet o fue alterado, retornar el texto tal cual o vacío
return cipher_text
return cipher_str
crypto_service = CryptoService()