Urgent.News

What's breaking now, across thousands of outlets.

Tech

Node.js Secure Direct Browser Uploads for Generic Gaming Files (Object Storage at Scale)

Large product-image batches change this decision: the browser should send bytes to storage, while the Node.js application issues narrow, tenant-scoped permission and stays out of the data path. Short answer: generic object storage with signed access is usually the simplest secure choice for direct browser uploads when the job is private file storage and export generation, not a permanent public…

For secure direct browser uploads of generic gaming files, utilize Node.js as the intermediary between the browser and object storage. The Node.js application should issue narrow, tenant-scoped permissions to handle data flow while the browser transfers bytes directly to storage. This approach minimizes the Node.js server's involvement in the upload process and optimizes throughput for large-file transfers.

Bypass direct uploads that involve the Node.js server as the primary data pathway, as it can become a bottleneck for large file transfers. Instead, opt for a design where Node.js authorizes the object key and the browser transfers the data to storage. Measure both paths with identical files and client connections to determine the most efficient option.

When implementing the solution, use a short-lived signed operation, a private object, and a key chosen by the trusted application. The browser should first request permission from Node.js to upload a named object, then send the file directly to the URL provided. The application must not share its storage credentials with the browser, and the browser should not attach these credentials to the signed URL.

Avoid having the browser choose the full object key; instead, let the server derive it from authenticated context such as tenants/{tenantId}/products/{productId}/{fileId}-{safeName}. This approach ensures proper operational functionality and efficient metadata searches. Implement the signing call on the server side using TypeScript, with the signing function handling authorization on the server and processing response bodies on failure.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Human as a Tool: The Agent Pattern Where You Work for the Machine

There's an agent design pattern with an uncomfortable premise: the agent is the orchestrator, and you are one of its tools.

  • Human-as-a-tool pattern treats humans as integral components of machine operation.
  • Implementation involves simple tool definition with human operator response to specific questions.

The Budget Guard Refunded Twice, So the Batch Outlived Its Cap

The short version: my token budget guard refunded the same reservation on every retry. The counter drifted upward, the batch ran past its cap, and half the shards died at the worst moment.

  • Budget guard refunded the same reservation on every retry
  • Batch capacity exceeded, causing half of the shards to fail
  • Counter replaced with append-only event log for debugging

I Replaced My Vector Database With Boring Algorithms

I recently removed a vector database from a few parts of my software. Not because vector databases are bad. Not because embeddings stopped being useful. And definitely not because I suddenly decided that AI infrastructure is overhyped. The reason was much more boring: I was using the wrong tool for some of the jobs.

Give Your Coding Agent Scripts, Not Prose: Build a Tool-Contract Doctor First

A coding agent with a folder of scripts and a contract test will outrun one with a gorgeous instruction file. Not because scripts are clever — because scripts fail loudly, and prose doesn't. I keep reading AGENTS.md files that read like onboarding docs for a new hire. Pleasant, sure.

  • Scripts fail loudly, while prose does not
  • Contract defines three failure classes and one JSON shape
  • Doctor validates tool interfaces before handing to agent

More from Sunday 8 November →