Validar fiel en todos los procesos

This commit is contained in:
El Mau 2022-02-09 22:17:00 -06:00
commit b1b73dae9f
3 changed files with 12 additions and 11 deletions

View File

@ -1,6 +1,11 @@
# Lista de cambios
## v 0.5.1 [09-Feb-22]
---
* Fix - Validar fiel en cada proceso.
## v 0.5.0 [06-Feb-22]
---
* Se cambia la lógica para evitar el error de token caducado.

View File

@ -1 +1 @@
0.5.0
0.5.1

View File

@ -221,14 +221,12 @@ def _validate_verificar_args(args):
if not result:
return False, {}
if not data['path_enc'].is_file():
msg = f"No se encontró la FIEL encriptada. \nRuta: {data['path_enc']}"
if not data['path_enc'].is_file() and not data['path_pem'].is_file():
msg = f"No se encontró la FIEL [enc|pem].\nRuta: {data['path_enc']}"
log.error(msg)
return False, {}
cer = data['path_cer'].read_bytes()
key = data['path_enc'].read_bytes()
cert = SATCertificate(cer, key)
cert = _get_cert(data)
if not cert.is_valid_time:
msg = 'La FIEL no es vigente'
@ -251,14 +249,12 @@ def _validate_download_args(args):
if not result:
return False, {}
if not data['path_enc'].is_file():
msg = f"No se encontró la FIEL encriptada. \nRuta: {data['path_enc']}"
if not data['path_enc'].is_file() and not data['path_pem'].is_file():
msg = f"No se encontró la FIEL [enc|pem].\nRuta: {data['path_enc']}"
log.error(msg)
return False, {}
cer = data['path_cer'].read_bytes()
key = data['path_enc'].read_bytes()
cert = SATCertificate(cer, key)
cert = _get_cert(data)
if not cert.is_valid_time:
msg = 'La FIEL no es vigente'