Basic implementation for get secret endpoint

This commit is contained in:
Ivan Golikov 2022-12-17 16:02:09 +01:00
parent 9f46c5cd21
commit db37d04c1d

View file

@ -16,3 +16,10 @@ async def set_secret(data: Secret):
"status": "saved",
"retrieval_url": f"/secret/{new_key}",
}
@app.get("/secret/{secret_key}", response_model=Secret)
async def get_secret(secret_key):
return {
"data": await redis.get(secret_key),
}