add send cert reporting
This commit is contained in:
@@ -8,8 +8,10 @@ COURSE_TABLE: str = os.getenv('COURSE_TABLE') # type: ignore
|
||||
BUCKET_NAME: str = os.getenv('BUCKET_NAME') # type: ignore
|
||||
|
||||
EMAIL_SENDER = ('EDUSEG®', 'noreply@eduseg.com.br')
|
||||
|
||||
PAPERFORGE_API = 'https://paperforge.saladeaula.digital'
|
||||
SIGNATURE_URI = 's3://saladeaula.digital/signatures/ecnpj_2025.pfx'
|
||||
CERT_REPORTING_URI = 's3://saladeaula.digital/certs/reporting.html'
|
||||
ESIGN_URI = 's3://saladeaula.digital/esigns/ecnpj_2025.pfx'
|
||||
|
||||
|
||||
DBNAME: str = os.getenv('POSTGRES_DB') # type: ignore
|
||||
|
||||
@@ -64,14 +64,6 @@ def enroll(
|
||||
# Post-migration: uncomment the following line
|
||||
# | ({'org_id': org['org_id']} if org else {}),
|
||||
)
|
||||
transact.put(
|
||||
item={
|
||||
'id': enrollment.id,
|
||||
'sk': 'METADATA#COURSE',
|
||||
'created_at': now_,
|
||||
**course.model_dump(include={'cert', 'access_period'}),
|
||||
}
|
||||
)
|
||||
|
||||
# Relationships between this enrollment and its related entities
|
||||
for parent_entity in linked_entities:
|
||||
|
||||
@@ -34,6 +34,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
order = order_layer.collection.get_items(
|
||||
TransactKey(order_id) + SortKey('0') + SortKey('items', path_spec='items'),
|
||||
)
|
||||
# Post-migration: rename `tenant_id` to `org_id`
|
||||
org_id = order['tenant_id']
|
||||
items = {
|
||||
item['id']: int(item['quantity'])
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
import os
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import pytz
|
||||
from aws_lambda_powertools import Logger
|
||||
from aws_lambda_powertools.utilities.data_classes import (
|
||||
EventBridgeEvent,
|
||||
event_source,
|
||||
)
|
||||
from aws_lambda_powertools.utilities.typing import LambdaContext
|
||||
from glom import glom
|
||||
from layercake.dateutils import fromisoformat, now, ttl
|
||||
from layercake.dynamodb import DynamoDBPersistenceLayer
|
||||
from layercake.funcs import pick
|
||||
|
||||
from boto3clients import dynamodb_client
|
||||
from config import ENROLLMENT_TABLE
|
||||
|
||||
logger = Logger(__name__)
|
||||
dyn = DynamoDBPersistenceLayer(ENROLLMENT_TABLE, dynamodb_client)
|
||||
tz = os.getenv('TZ', 'UTC')
|
||||
|
||||
|
||||
@event_source(data_class=EventBridgeEvent)
|
||||
@logger.inject_lambda_context
|
||||
def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool | None:
|
||||
new_image = event.detail['new_image']
|
||||
expires_at = glom(new_image, 'cert.expires_at', default=None)
|
||||
|
||||
if not expires_at:
|
||||
return None
|
||||
|
||||
enrollment_id = new_image['id']
|
||||
org_id = new_image['org_id']
|
||||
expires_at: datetime = fromisoformat(expires_at).replace(tzinfo=pytz.timezone(tz)) # type: ignore
|
||||
# The reporting month is the month before the certificate expires
|
||||
month_start = (expires_at.replace(day=1) - timedelta(days=1)).replace(day=1)
|
||||
now_ = now()
|
||||
pk = f'CERT#REPORTING#ORG#{org_id}'
|
||||
sk = 'MONTH#{}'.format(expires_at.strftime('%Y-%m'))
|
||||
|
||||
if now_ > expires_at:
|
||||
return None
|
||||
|
||||
try:
|
||||
with dyn.transact_writer() as transact:
|
||||
transact.put(
|
||||
item={
|
||||
'id': pk,
|
||||
'sk': 'MONTH#{}#SCHEDULE#SEND_REPORT_EMAIL'.format(
|
||||
month_start.strftime('%Y-%m')
|
||||
),
|
||||
'target_month': expires_at.strftime('%Y-%m'),
|
||||
'ttl': ttl(start_dt=month_start),
|
||||
}
|
||||
)
|
||||
|
||||
transact.put(
|
||||
item={
|
||||
'id': pk,
|
||||
'sk': f'{sk}#ENROLLMENT#{enrollment_id}',
|
||||
'enrollment_id': new_image['id'],
|
||||
'user': pick(('id', 'name'), new_image['user']),
|
||||
'course': pick(('id', 'name'), new_image['course']),
|
||||
'enrolled_at': new_image['created_at'],
|
||||
'expires_at': expires_at, # type: ignore
|
||||
'completed_at': new_image['completed_at'],
|
||||
'created_at': now_,
|
||||
},
|
||||
cond_expr='attribute_not_exists(sk)',
|
||||
exc_cls=EnrollmentConflictError,
|
||||
)
|
||||
except EnrollmentConflictError:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
class EnrollmentConflictError(Exception): ...
|
||||
@@ -0,0 +1,146 @@
|
||||
import json
|
||||
from datetime import date, datetime
|
||||
from email.mime.application import MIMEApplication
|
||||
|
||||
import requests
|
||||
from aws_lambda_powertools import Logger
|
||||
from aws_lambda_powertools.shared.json_encoder import Encoder
|
||||
from aws_lambda_powertools.utilities.data_classes import (
|
||||
EventBridgeEvent,
|
||||
event_source,
|
||||
)
|
||||
from aws_lambda_powertools.utilities.typing import LambdaContext
|
||||
from layercake.dateutils import now
|
||||
from layercake.dynamodb import DynamoDBPersistenceLayer, KeyPair
|
||||
from layercake.email_ import Message
|
||||
|
||||
from boto3clients import dynamodb_client, sesv2_client
|
||||
from config import (
|
||||
CERT_REPORTING_URI,
|
||||
EMAIL_SENDER,
|
||||
ENROLLMENT_TABLE,
|
||||
PAPERFORGE_API,
|
||||
USER_TABLE,
|
||||
)
|
||||
|
||||
SUBJECT = 'Certificados que vencerão em {month} na EDUSEG®'
|
||||
REPLY_TO = ('Carolina Brand', 'carolina@somosbeta.com.br')
|
||||
BCC = [
|
||||
'sergio@somosbeta.com.br',
|
||||
'carolina@somosbeta.com.br',
|
||||
'tiago@somosbeta.com.br',
|
||||
]
|
||||
MESSAGE = """
|
||||
Oi, tudo bem?<br/><br/>
|
||||
|
||||
Em anexo você encontra os certificados que vencerão em <strong>{month}</strong>.
|
||||
<br/><br/>
|
||||
|
||||
Qualquer dúvida, estamos à disposição.
|
||||
"""
|
||||
|
||||
|
||||
logger = Logger(__name__)
|
||||
enrollment_layer = DynamoDBPersistenceLayer(ENROLLMENT_TABLE, dynamodb_client)
|
||||
user_layer = DynamoDBPersistenceLayer(USER_TABLE, dynamodb_client)
|
||||
|
||||
|
||||
@event_source(data_class=EventBridgeEvent)
|
||||
@logger.inject_lambda_context
|
||||
def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
old_image = event.detail['old_image']
|
||||
# Key pattern `CERT#REPORTING#ORG#{org_id}`
|
||||
*_, org_id = old_image['id'].split('#')
|
||||
event_name = old_image['sk']
|
||||
target_month = datetime.strptime(old_image['target_month'], '%Y-%m').date()
|
||||
month = _monthfmt(target_month)
|
||||
now_ = now()
|
||||
|
||||
result = enrollment_layer.collection.query(
|
||||
KeyPair(
|
||||
pk=old_image['id'],
|
||||
sk='MONTH#{}#ENROLLMENT'.format(target_month.strftime('%Y-%m')),
|
||||
),
|
||||
limit=150,
|
||||
)
|
||||
|
||||
json_data = json.dumps(
|
||||
{
|
||||
'template_uri': CERT_REPORTING_URI,
|
||||
'args': {
|
||||
'month': month,
|
||||
'items': result['items'],
|
||||
},
|
||||
},
|
||||
cls=Encoder,
|
||||
)
|
||||
# Send template URI and data to Paperforge API to generate a PDF
|
||||
r = requests.post(PAPERFORGE_API, data=json_data)
|
||||
r.raise_for_status()
|
||||
|
||||
emailmsg = Message(
|
||||
from_=EMAIL_SENDER,
|
||||
to=_get_admin_emails(org_id),
|
||||
subject=SUBJECT.format(month=month),
|
||||
)
|
||||
emailmsg.add_alternative(MESSAGE.format(month=month))
|
||||
attachment = MIMEApplication(r.content)
|
||||
attachment.add_header(
|
||||
'Content-Disposition',
|
||||
'attachment',
|
||||
filename='{}.pdf'.format(target_month.strftime('%Y-%m')),
|
||||
)
|
||||
emailmsg.attach(attachment)
|
||||
|
||||
try:
|
||||
sesv2_client.send_email(
|
||||
Content={
|
||||
'Raw': {
|
||||
'Data': emailmsg.as_bytes(),
|
||||
},
|
||||
}
|
||||
)
|
||||
enrollment_layer.put_item(
|
||||
item={
|
||||
'id': old_image['id'],
|
||||
'sk': f'{event_name}#EXECUTED',
|
||||
'created_at': now_,
|
||||
}
|
||||
)
|
||||
logger.info('Email sent')
|
||||
except Exception as exc:
|
||||
logger.exception(exc)
|
||||
enrollment_layer.put_item(
|
||||
item={
|
||||
'id': old_image['id'],
|
||||
'sk': f'{event_name}#FAILED',
|
||||
'created_at': now_,
|
||||
}
|
||||
)
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
def _get_admin_emails(org_id: str) -> list[tuple[str, str]]:
|
||||
# Post-migration: rename `admins` to `ADMIN`
|
||||
r = user_layer.collection.query(KeyPair(org_id, 'admins'))
|
||||
return [(x['name'], x['email']) for x in r['items']]
|
||||
|
||||
|
||||
def _monthfmt(dt: date) -> str:
|
||||
months = [
|
||||
'Janeiro',
|
||||
'Fevereiro',
|
||||
'Março',
|
||||
'Abril',
|
||||
'Maio',
|
||||
'Junho',
|
||||
'Julho',
|
||||
'Agosto',
|
||||
'Setembro',
|
||||
'Outubro',
|
||||
'Novembro',
|
||||
'Dezembro',
|
||||
]
|
||||
return f'{months[dt.month - 1]} de {dt.year}'
|
||||
@@ -16,8 +16,8 @@ from config import (
|
||||
BUCKET_NAME,
|
||||
COURSE_TABLE,
|
||||
ENROLLMENT_TABLE,
|
||||
ESIGN_URI,
|
||||
PAPERFORGE_API,
|
||||
SIGNATURE_URI,
|
||||
)
|
||||
|
||||
logger = Logger(__name__)
|
||||
@@ -38,12 +38,12 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
sk=SortKey('0', path_spec='cert', rename_key='cert'),
|
||||
),
|
||||
raise_on_error=False,
|
||||
default=False,
|
||||
default=None,
|
||||
)
|
||||
|
||||
if not cert:
|
||||
logger.debug('Certificate not found')
|
||||
# There is no certificate to issue from metadata
|
||||
# There is no certificate to issue from course
|
||||
return False
|
||||
|
||||
started_at: datetime = fromisoformat(new_image['started_at']) # type: ignore
|
||||
@@ -62,7 +62,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
data=json.dumps(
|
||||
{
|
||||
'template_uri': cert['s3_uri'],
|
||||
'sign_uri': SIGNATURE_URI,
|
||||
'sign_uri': ESIGN_URI,
|
||||
'args': {
|
||||
'name': new_image['user']['name'],
|
||||
'cpf': _cpffmt(new_image['user']['cpf']),
|
||||
@@ -106,10 +106,10 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
pk=enrollment_id,
|
||||
sk='0',
|
||||
),
|
||||
update_expr='SET issued_cert = :issued_cert, updated_at = :now',
|
||||
update_expr='SET cert = :cert, updated_at = :now',
|
||||
expr_attr_values={
|
||||
':now': now_,
|
||||
':issued_cert': {
|
||||
':cert': {
|
||||
'issued_at': now_,
|
||||
}
|
||||
| ({'expires_at': cert_expires_at} if cert_expires_at else {})
|
||||
|
||||
@@ -21,10 +21,10 @@ dyn = DynamoDBPersistenceLayer(ENROLLMENT_TABLE, dynamodb_client)
|
||||
def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
old_image = event.detail['old_image']
|
||||
now_ = now()
|
||||
issued_cert = dyn.collection.get_item(
|
||||
cert = dyn.collection.get_item(
|
||||
KeyPair(
|
||||
pk=old_image['id'],
|
||||
sk=SortKey('0', path_spec='issued_cert'),
|
||||
sk=SortKey('0', path_spec='cert'),
|
||||
),
|
||||
raise_on_error=False,
|
||||
default={},
|
||||
@@ -37,12 +37,11 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
pk=old_image['id'],
|
||||
sk='0',
|
||||
),
|
||||
update_expr='SET issued_cert = :issued_cert, \
|
||||
updated_at = :now',
|
||||
update_expr='SET cert = :cert, updated_at = :now',
|
||||
cond_expr='#status = :completed',
|
||||
expr_attr_names={'#status': 'status'},
|
||||
expr_attr_values={
|
||||
':issued_cert': issued_cert | {'expired': True},
|
||||
':cert': cert | {'expired': True},
|
||||
':completed': 'COMPLETED',
|
||||
':now': now_,
|
||||
},
|
||||
|
||||
@@ -26,7 +26,7 @@ Globals:
|
||||
Architectures:
|
||||
- x86_64
|
||||
Layers:
|
||||
- !Sub arn:aws:lambda:sa-east-1:336641857101:layer:layercake:97
|
||||
- !Sub arn:aws:lambda:sa-east-1:336641857101:layer:layercake:98
|
||||
Environment:
|
||||
Variables:
|
||||
TZ: America/Sao_Paulo
|
||||
@@ -140,7 +140,7 @@ Resources:
|
||||
Type: EventBridgeRule
|
||||
Properties:
|
||||
Pattern:
|
||||
resources: [betaeducacao-prod-orders]
|
||||
resources: [!Ref OrderTable]
|
||||
detail-type: [INSERT]
|
||||
detail:
|
||||
new_image:
|
||||
@@ -331,3 +331,64 @@ Resources:
|
||||
status: [COMPLETED]
|
||||
old_image:
|
||||
status: [IN_PROGRESS]
|
||||
|
||||
EventCertReportingAppendIssuedCertFunction:
|
||||
Type: AWS::Serverless::Function
|
||||
Properties:
|
||||
Handler: events.cert_reporting.append_issued_cert.lambda_handler
|
||||
LoggingConfig:
|
||||
LogGroup: !Ref EventLog
|
||||
Policies:
|
||||
- DynamoDBCrudPolicy:
|
||||
TableName: !Ref EnrollmentTable
|
||||
Events:
|
||||
DynamoDBEvent:
|
||||
Type: EventBridgeRule
|
||||
Properties:
|
||||
Pattern:
|
||||
resources: [!Ref EnrollmentTable]
|
||||
detail:
|
||||
keys:
|
||||
sk: ["0"]
|
||||
new_image:
|
||||
status: [COMPLETED]
|
||||
cert:
|
||||
exists: true
|
||||
org_id:
|
||||
exists: true
|
||||
old_image:
|
||||
cert:
|
||||
exists: false
|
||||
|
||||
EventCertReportingSendReportEmailFunction:
|
||||
Type: AWS::Serverless::Function
|
||||
Properties:
|
||||
Handler: events.cert_reporting.send_report_email.lambda_handler
|
||||
LoggingConfig:
|
||||
LogGroup: !Ref EventLog
|
||||
Policies:
|
||||
- DynamoDBReadPolicy:
|
||||
TableName: !Ref EnrollmentTable
|
||||
- DynamoDBReadPolicy:
|
||||
TableName: !Ref UserTable
|
||||
- Version: 2012-10-17
|
||||
Statement:
|
||||
- Effect: Allow
|
||||
Action:
|
||||
- ses:SendRawEmail
|
||||
Resource:
|
||||
- !Sub arn:aws:ses:${AWS::Region}:${AWS::AccountId}:identity/eduseg.com.br
|
||||
- !Sub arn:aws:ses:${AWS::Region}:${AWS::AccountId}:configuration-set/tracking
|
||||
Events:
|
||||
DynamoDBEvent:
|
||||
Type: EventBridgeRule
|
||||
Properties:
|
||||
Pattern:
|
||||
resources: [!Ref EnrollmentTable]
|
||||
detail-type: [EXPIRE]
|
||||
detail:
|
||||
keys:
|
||||
id:
|
||||
- prefix: CERT#REPORTING#ORG
|
||||
sk:
|
||||
- suffix: SCHEDULE#SEND_REPORT_EMAIL
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
from datetime import timedelta
|
||||
|
||||
import app.events.cert_reporting.append_issued_cert as app
|
||||
from aws_lambda_powertools.utilities.typing import LambdaContext
|
||||
from layercake.dateutils import now
|
||||
from layercake.dynamodb import (
|
||||
DynamoDBPersistenceLayer,
|
||||
SortKey,
|
||||
TransactKey,
|
||||
)
|
||||
|
||||
|
||||
def test_append_issued_cert(
|
||||
seeds,
|
||||
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
|
||||
lambda_context: LambdaContext,
|
||||
):
|
||||
expires_at = now() + timedelta(days=360)
|
||||
event = {
|
||||
'detail': {
|
||||
'new_image': {
|
||||
'id': 'e45019d8-be7a-4a82-9b37-12a01f0127bb',
|
||||
'sk': '0',
|
||||
'course': {
|
||||
'id': '431',
|
||||
'name': 'How to Sing Better',
|
||||
},
|
||||
'cert': {
|
||||
# 'expires_at': '2026-02-10T20:14:42.880991',
|
||||
'expires_at': expires_at.isoformat(),
|
||||
},
|
||||
'user': {
|
||||
'id': '1234',
|
||||
'name': 'Tobias Summit',
|
||||
},
|
||||
'org_id': '1e2eaf0e-e319-49eb-ab33-1ddec156dc94',
|
||||
'created_at': '2025-01-01T00:00:00-03:06',
|
||||
'completed_at': '2025-01-10T00:00:00-03:06',
|
||||
}
|
||||
}
|
||||
}
|
||||
assert app.lambda_handler(event, lambda_context) # type: ignore
|
||||
|
||||
# The reporting month is the month before the certificate expires
|
||||
month_start = (expires_at.replace(day=1) - timedelta(days=1)).replace(day=1)
|
||||
report_sk = 'MONTH#{}#SCHEDULE#SEND_REPORT_EMAIL'.format(
|
||||
month_start.strftime('%Y-%m')
|
||||
)
|
||||
|
||||
r = dynamodb_persistence_layer.collection.get_items(
|
||||
TransactKey('CERT#REPORTING#ORG#1e2eaf0e-e319-49eb-ab33-1ddec156dc94')
|
||||
+ SortKey(
|
||||
sk=report_sk,
|
||||
rename_key='report_email',
|
||||
)
|
||||
+ SortKey(
|
||||
sk='MONTH#{}#ENROLLMENT#e45019d8-be7a-4a82-9b37-12a01f0127bb'.format(
|
||||
expires_at.strftime('%Y-%m')
|
||||
),
|
||||
rename_key='enrollment',
|
||||
),
|
||||
flatten_top=False,
|
||||
)
|
||||
|
||||
assert 'course' in r['enrollment']
|
||||
assert 'ttl' in r['report_email']
|
||||
@@ -0,0 +1,25 @@
|
||||
import app.events.cert_reporting.send_report_email as app
|
||||
from aws_lambda_powertools.utilities.typing import LambdaContext
|
||||
from layercake.dynamodb import (
|
||||
DynamoDBPersistenceLayer,
|
||||
)
|
||||
|
||||
|
||||
def test_send_report_email(
|
||||
monkeypatch,
|
||||
seeds,
|
||||
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
|
||||
lambda_context: LambdaContext,
|
||||
):
|
||||
event = {
|
||||
'detail': {
|
||||
'old_image': {
|
||||
'id': 'CERT#REPORTING#ORG#00237409-9384-4692-9be5-b4443a41e1c4',
|
||||
'sk': 'MONTH#2025-06#SCHEDULE#SEND_REPORT_EMAIL',
|
||||
'target_month': '2025-07',
|
||||
},
|
||||
}
|
||||
}
|
||||
monkeypatch.setattr(app.sesv2_client, 'send_email', lambda *args, **kwargs: ...)
|
||||
|
||||
assert app.lambda_handler(event, lambda_context) # type: ignore
|
||||
@@ -35,4 +35,4 @@ def test_issue_cert(
|
||||
key=KeyPair('1ee108ae-67d4-4545-bf6d-4e641cdaa4e0', '0')
|
||||
)
|
||||
|
||||
assert 'issued_cert' in r
|
||||
assert 'cert' in r
|
||||
|
||||
@@ -29,7 +29,7 @@ def test_set_cert_expired(
|
||||
)
|
||||
assert r['status'] == 'COMPLETED'
|
||||
assert 'executed' in r
|
||||
assert 'issued_cert' in r
|
||||
assert 'cert' in r
|
||||
|
||||
|
||||
def test_existing_issued_cert(
|
||||
@@ -50,4 +50,4 @@ def test_existing_issued_cert(
|
||||
r = dynamodb_persistence_layer.collection.get_items(
|
||||
TransactKey('1ee108ae-67d4-4545-bf6d-4e641cdaa4e0') + SortKey('0')
|
||||
)
|
||||
assert 's3_uri' in r['issued_cert']
|
||||
assert 's3_uri' in r['cert']
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
{"id": "6437a282-6fe8-4e4d-9eb0-da1007238007", "sk": "0", "status": "IN_PROGRESS", "progress": 10}
|
||||
{"id": "845fe390-e3c3-4514-97f8-c42de0566cf0", "sk": "0", "status": "COMPLETED", "progress": 100}
|
||||
|
||||
{"id": "1ee108ae-67d4-4545-bf6d-4e641cdaa4e0", "sk": "0", "status": "COMPLETED", "score": 100, "course": {"id": "123", "name": "CIPA Grau de Risco 1"}, "user": {"name": "Kurt Cobain"}, "issued_cert": {"s3_uri": "s3://saladeaula.digital/issuedcerts/1ee108ae-67d4-4545-bf6d-4e641cdaa4e0.pdf"}}
|
||||
{"id": "1ee108ae-67d4-4545-bf6d-4e641cdaa4e0", "sk": "0", "status": "COMPLETED", "score": 100, "course": {"id": "123", "name": "CIPA Grau de Risco 1"}, "user": {"name": "Kurt Cobain"}, "cert": {"s3_uri": "s3://saladeaula.digital/issuedcerts/1ee108ae-67d4-4545-bf6d-4e641cdaa4e0.pdf"}}
|
||||
{"id": "1ee108ae-67d4-4545-bf6d-4e641cdaa4e0", "sk": "STARTED", "started_at": "2025-08-24T01:44:42.703012-03:06"}
|
||||
{"id": "1ee108ae-67d4-4545-bf6d-4e641cdaa4e0", "sk": "COMPLETED", "completed_at": "2025-08-31T21:59:10.842467-03:00"}
|
||||
|
||||
@@ -37,3 +37,10 @@
|
||||
{"id": "294e9864-8284-4287-b153-927b15d90900", "sk": "konviva", "class_id": 34, "user_id": 26943, "created_at": "2025-09-09T09:11:29.315247-03:00", "enrollment_id": 244488}
|
||||
{"id": "294e9864-8284-4287-b153-927b15d90900", "sk": "tenant", "org_id": "123", "name": "EDUSEG", "create_date": "2025-09-12T17:11:00.556907-03:00"}
|
||||
|
||||
// Certificate reporting
|
||||
{"id": "CERT#REPORTING#ORG#00237409-9384-4692-9be5-b4443a41e1c4", "sk": "MONTH#2025-07#ENROLLMENT#ba4d48e6-3671-4060-988a-d6cf97dd0ea4", "completed_at": "2025-01-10T00:00:00-03:06", "enrolled_at": "2025-01-01T00:00:00-03:06", "expires_at": "2026-02-10T20:14:42.880991", "course": {"name": "How to Sing Better", "id": "431"}, "created_at": "2025-10-11T23:39:12.194344-03:00", "user": {"name": "Tobias Summit", "id": "1234"}, "enrollment_id": "e45019d8-be7a-4a82-9b37-12a01f0127bb"}
|
||||
|
||||
// Org
|
||||
{"id": "1e2eaf0e-e319-49eb-ab33-1ddec156dc94", "sk": "0", "name": "pytest"}
|
||||
// Org admins
|
||||
{"id": "00237409-9384-4692-9be5-b4443a41e1c4", "sk": "admins#1234", "email": "sergio@somosbeta.com.br", "name": "Sérgio R Siqueira"}
|
||||
|
||||
10
enrollments-events/uv.lock
generated
10
enrollments-events/uv.lock
generated
@@ -31,14 +31,14 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "authlib"
|
||||
version = "1.6.1"
|
||||
version = "1.6.5"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "cryptography" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/8e/a1/d8d1c6f8bc922c0b87ae0d933a8ed57be1bef6970894ed79c2852a153cd3/authlib-1.6.1.tar.gz", hash = "sha256:4dffdbb1460ba6ec8c17981a4c67af7d8af131231b5a36a88a1e8c80c111cdfd", size = 159988, upload-time = "2025-07-20T07:38:42.834Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/cd/3f/1d3bbd0bf23bdd99276d4def22f29c27a914067b4cf66f753ff9b8bbd0f3/authlib-1.6.5.tar.gz", hash = "sha256:6aaf9c79b7cc96c900f0b284061691c5d4e61221640a948fe690b556a6d6d10b", size = 164553, upload-time = "2025-10-02T13:36:09.489Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/f9/58/cc6a08053f822f98f334d38a27687b69c6655fb05cd74a7a5e70a2aeed95/authlib-1.6.1-py2.py3-none-any.whl", hash = "sha256:e9d2031c34c6309373ab845afc24168fe9e93dc52d252631f52642f21f5ed06e", size = 239299, upload-time = "2025-07-20T07:38:39.259Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f8/aa/5082412d1ee302e9e7d80b6949bc4d2a8fa1149aaab610c5fc24709605d6/authlib-1.6.5-py2.py3-none-any.whl", hash = "sha256:3e0e0507807f842b02175507bdee8957a1d5707fd4afb17c32fb43fee90b6e3a", size = 243608, upload-time = "2025-10-02T13:36:07.637Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -501,7 +501,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "layercake"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
source = { directory = "../layercake" }
|
||||
dependencies = [
|
||||
{ name = "arnparse" },
|
||||
@@ -529,7 +529,7 @@ dependencies = [
|
||||
[package.metadata]
|
||||
requires-dist = [
|
||||
{ name = "arnparse", specifier = ">=0.0.2" },
|
||||
{ name = "authlib", specifier = ">=1.6.1" },
|
||||
{ name = "authlib", specifier = ">=1.6.5" },
|
||||
{ name = "aws-lambda-powertools", extras = ["all"], specifier = ">=3.18.0" },
|
||||
{ name = "dictdiffer", specifier = ">=0.9.0" },
|
||||
{ name = "ftfy", specifier = ">=6.3.1" },
|
||||
|
||||
Reference in New Issue
Block a user