diff --git a/src/rectes/main.py b/src/rectes/main.py index 0609776..5e23523 100644 --- a/src/rectes/main.py +++ b/src/rectes/main.py @@ -1,21 +1,12 @@ from fastapi import FastAPI -from pydantic import BaseModel +from rectes.models import Secret, SecretSaveResult from rectes.redis_db import redis from rectes.utils import get_new_key app = FastAPI() -class Secret(BaseModel): - data: str - - -class SecretSaveResult(BaseModel): - status: str - retrieval_url: str - - @app.post("/secret", response_model=SecretSaveResult) async def set_secret(data: Secret): new_key = await get_new_key() diff --git a/src/rectes/models.py b/src/rectes/models.py new file mode 100644 index 0000000..c51f16d --- /dev/null +++ b/src/rectes/models.py @@ -0,0 +1,10 @@ +from pydantic import BaseModel + + +class Secret(BaseModel): + data: str + + +class SecretSaveResult(BaseModel): + status: str + retrieval_url: str