add cert pages
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user