add cert pages

This commit is contained in:
2025-11-12 08:49:18 -03:00
parent fa87cf3e07
commit 850f620f78
16 changed files with 271 additions and 203 deletions

View File

@@ -1,6 +1,11 @@
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 USER_TABLE
@@ -15,3 +20,14 @@ def get_admins(org_id: str):
KeyPair(org_id, 'admins#'),
limit=100,
)
@router.delete('/<org_id>/admins')
def revoke(org_id: str, user_id: Annotated[str, Body(embed=True)]):
with dyn.transact_writer() as transact:
transact.delete(
# Post-migration: rename `admins` to `ADMIN`
key=KeyPair(org_id, f'admins#{user_id}'),
)
return JSONResponse(status_code=HTTPStatus.NO_CONTENT)