Merge pull request 'Basic implementation for get secret endpoint' (#4) from get-secret-endpoint into main

This commit is contained in:
ivnglkv 2022-12-17 18:03:17 +03:00
commit d2babe2567

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),
}