hotfix: Actually using getdel function

This commit is contained in:
Ivan Golikov 2025-01-08 23:03:12 +01:00
parent 0644d260de
commit fc77407379
2 changed files with 3 additions and 3 deletions

View file

@ -8,7 +8,7 @@ from redis.asyncio import Redis
from pssecret_server.fernet import get_fernet from pssecret_server.fernet import get_fernet
from pssecret_server.models import Secret, SecretSaveResult from pssecret_server.models import Secret, SecretSaveResult
from pssecret_server.redis_db import get_redis from pssecret_server.redis_db import get_redis
from pssecret_server.utils import decrypt_secret, encrypt_secret, save_secret from pssecret_server.utils import decrypt_secret, encrypt_secret, getdel, save_secret
app = FastAPI() app = FastAPI()
@ -49,7 +49,7 @@ async def set_secret(
async def get_secret( async def get_secret(
secret_key: str, redis: RedisDep, fernet: FernetDep secret_key: str, redis: RedisDep, fernet: FernetDep
) -> dict[str, bytes]: ) -> dict[str, bytes]:
data: bytes | None = await redis.getdel(secret_key) data: bytes | None = await getdel(redis, secret_key)
if data is None: if data is None:
raise HTTPException(404) raise HTTPException(404)

View file

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "pssecret-server" name = "pssecret-server"
version = "1.1.0" version = "1.1.1"
description = "API service for secrets sharing over network" description = "API service for secrets sharing over network"
authors = ["Ivan Golikov <root@ivnglkv.me>"] authors = ["Ivan Golikov <root@ivnglkv.me>"]
license = "BSD-3-Clause" license = "BSD-3-Clause"