اضافه شدن قابلیت share و نگهداری بلندمدت
Verify / test (push) Failing after 22s

This commit is contained in:
2026-11-09 14:55:36 +03:30
والد a4e8f0c6c0
کامیت 19824bd180
27فایلهای تغییر یافته به همراه267 افزوده شده و 51 حذف شده
+15
مشاهده پرونده
@@ -0,0 +1,15 @@
"""Link expiry policy. -1 is a persistent no-expiry sentinel, not a timestamp."""
from fastapi import HTTPException
from .config import settings
NEVER_EXPIRES = -1
def expiration(expires_in, now):
if expires_in == NEVER_EXPIRES:
return NEVER_EXPIRES
ttl = settings().link_ttl if expires_in is None else expires_in
if ttl <= 0 or ttl > settings().link_ttl:
raise HTTPException(422, {'code': 'invalid_expiry',
'message': 'expires_in must be -1 (no expiry) or positive seconds within the configured lifetime'})
return now + ttl