Signed URLs¶
Generate short-lived signed URLs for previews and downloads. Share access without exposing your JWT or creating long-lived public links.
How it works¶
- Request a signed URL — Call
POST /api/entries/signed-urlwithpathandaction("preview"or"download"). Requires a valid JWT. - Response — The API returns a full URL with
path,exp(expiry timestamp), andsig(HMAC signature) as query parameters. - Use the URL — Anyone with the URL can preview or download the file until it expires. No JWT needed.
Security¶
- HMAC-SHA256 — The signature is computed over
action,path, andexpusing the JWT secret. Tampering invalidates the link. - Expiry — Links expire after 5 minutes by default. The backend rejects expired links.
- Action binding — A link signed for
previewcannot be used fordownload, and vice versa.
Example¶
POST /api/entries/signed-url
{"path": "documents/report.pdf", "action": "preview"}
→ {"url": "/api/entries/preview?path=documents%2Freport.pdf&exp=1736940900&sig=..."}