add cert_expires_at

This commit is contained in:
2025-10-15 15:10:47 -03:00
parent 54c92b3996
commit ffa04d9b15
37 changed files with 371 additions and 230 deletions

View File

@@ -0,0 +1,28 @@
from http import HTTPStatus
from typing import Annotated
from aws_lambda_powertools.event_handler.api_gateway import Router
from aws_lambda_powertools.event_handler.openapi.params import Body
from layercake.dynamodb import (
DynamoDBPersistenceLayer,
KeyPair,
)
from api_gateway import JSONResponse
from boto3clients import dynamodb_client
from config import ENROLLMENT_TABLE
router = Router()
dyn = DynamoDBPersistenceLayer(ENROLLMENT_TABLE, dynamodb_client)
@router.patch('/<enrollment_id>/dedupwindow', compress=True)
def dedup_window(
enrollment_id: str,
lock_hash: Annotated[str, Body(embed=True)],
):
with dyn.transact_writer() as transact:
transact.delete(key=KeyPair(enrollment_id, 'LOCK'))
transact.delete(key=KeyPair('LOCK', lock_hash))
return JSONResponse(HTTPStatus.NO_CONTENT)