Secure Gaming Uploads with Expiring Download Links
Resumo
Pixel shares an architecture decision for storing gameplay reports, screenshots, chat exports, and anti-cheat evidence in private object storage. It explains how authorization checks, upload retention records, legal holds, short-lived download links, and asynchronous deletion help protect player data and verify its lifecycle.
DEV Community
Gaming Upload Retention: Private Object Storage with Expiring Download Links
Short answer: Keep gameplay reports and moderation evidence in private object storage, record retention as application data, and issue an expiring download link only after a fresh authorization check. The deciding constraint is deletion: a signed URL can expire, but it cannot prove that every copy of a player's upload has reached the end of its retention period. For a gaming service accepting screenshots, chat exports, or anti-cheat evidence, the storage decision should follow that distinction. The object store holds bytes. The application owns tenant and player authorization, retention class, legal or moderation holds, deletion state, and the audit trail. No public objects. This architecture decision record chooses a private bucket or equivalent private container, opaque object keys, short-lived download capability, and an asynchronous deletion worker. It does not choose a provider. Region availability, deletion semantics, recovery features, and operational evidence still need to be verified against the contract and documentation for the service under evaluation. Retention governance starts with an upload ledger Start with an invariant that is easy to test: knowing an object key is never sufficient to read an object. A download requires an authenticated application request, a current authorization decision for the player or moderator, and a newly issued expiring link. This keeps the game's permission model in one place instead of encoding a durable permission into a URL that can be pasted into chat or retained in browser history. Keys aren't permissions. The second invariant is less glamorous and more important: retention is a state machine, not a bucket setting. Each upload needs a stable record containing an opaque object key, tenant or game identifier, owner, content category, creation time, retention deadline, hold status, and deletion status. The database record is the control plane; object metadata may duplicate some fields for operations, but it should not become the only authorization or retention record. A useful state sequence is active -> deletion_due -> deleting -> deleted. A hold prevents the first transition. A worker claims due records, requests deletion, verifies the resulting state according to the selected store's documented semantics, and only then records completion. Retries must be safe. If the worker stops after deleting bytes but before committing deleted, the next run should reconcile the absence rather than recreate the file. There is one uncomfortable boundary: a link already issued remains a capability until it expires. Tightening a player's role or scheduling deletion does not necessarily retract that link. Keep its lifetime no longer than the product flow requires, avoid putting it in analytics or support logs, and perform authorization before every issuance. If immediate revocation is a hard requirement, route downloads through an application-controlled authorization layer rather than relying on a direct expiring link. Capabilities leak. Retention categories should come from product and policy owners, not from whatever default happens to exist on a bucket. A temporary avatar crop, a player-requested export, and moderation evidence can have different end conditions. I'm not sure a universal duration is defensible without the game's policy, jurisdictional obligations, and appeal workflow; those inputs are what resolve the decision. How should SaaS object storage protect private user files with presigned download links? Treat link creation as a privileged backend operation. The client asks for a download using the application's file identifier, never an object key. The backend loads the record in the tenant context, checks the caller's current permission, rejects a deleted or held-back item as appropriate, and asks a storage adapter for a link with a bounded expiry. The response should prevent shared caches from retaining it. Don't generate links in list endpoints: bulk issuance widens exposure ...

Powered by Readybot.io