add docseal

This commit is contained in:
2025-11-03 18:10:17 -03:00
parent d6c26df63b
commit eca3ac42dc
11 changed files with 205 additions and 8 deletions

View File

@@ -17,7 +17,6 @@ from config import (
BUCKET_NAME,
COURSE_TABLE,
ENROLLMENT_TABLE,
ESIGN_URI,
PAPERFORGE_API,
)
@@ -57,7 +56,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
if cert.get('exp_interval', 0) > 0
else None
)
s3_uri = _gen_cert(
s3_uri = _generate_cert(
enrollment_id,
cert=cert,
user=new_image['user'],
@@ -112,7 +111,7 @@ User = TypedDict('User', {'name': str, 'cpf': str})
Cert = TypedDict('Cert', {'s3_uri': NotRequired[str]})
def _gen_cert(
def _generate_cert(
id: str,
*,
score: int | float,
@@ -135,7 +134,6 @@ def _gen_cert(
data=json.dumps(
{
'template_uri': cert['s3_uri'],
'sign_uri': ESIGN_URI,
'args': {
'name': user['name'],
'cpf': _cpffmt(user['cpf']),
@@ -150,7 +148,7 @@ def _gen_cert(
},
},
),
timeout=5,
timeout=6,
)
r.raise_for_status()