SShortSingh.
Back to feed

Private PDF Exports in Next.js: Two Signed Storage Link Architectures

0
·4 views

The article recommends generating PDFs in a Next.js API route or background job, storing them in a private bucket, and issuing short-lived signed download URLs only after confirming the object exists. It argues the choice between an app-mediated design and a provider-direct design concerns system shape rather than PDF libraries, with the app-mediated approach suited to strict per-tenant access rules. The author favors keeping authorization in the application, accepting an extra API hop in exchange for easier inspection. Key invariants include unguessable tenant-scoped object keys and re-checking user, tenant membership, and export status before every download link is issued. Links are kept short-lived and created on demand, since permanent direct links are inappropriate when storage lacks public ACLs.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Five Ways to Turn Video into GIFs on iPhone in 2026, Compared

A developer-authored comparison evaluates five methods for converting videos or screen recordings into GIFs on iPhone as of late 2026. It weighs watermark policies, maximum frame rates, seamless looping, iMessage integration, and privacy. The author, who builds the MemePouch app, discloses this conflict of interest at the outset. The piece identifies MemePouch as its top pick for iMessage and WhatsApp sticker use, and GIFit as a free option that saves to Photos. It also explains technical constraints such as iMessage's attachment size limits and the difficulty of achieving seamless loops.

0
ProgrammingDEV Community ·

How arrays store data in memory and what each operation costs

An array keeps all its elements in one contiguous memory block of equal-sized items, so the address of any index can be computed directly. Because of this, reading or writing an element by index takes constant time, while searching an unsorted array takes linear time. Inserting or deleting in the middle is costly because later elements must shift to keep the block in order. Dynamic arrays make appends amortised constant time through spare capacity and occasional resizing. The article also notes that a few one-pass array patterns solve many common interview problems.

0
ProgrammingDEV Community ·

Five npm packages reach 7,799 combined downloads, with 232 gained in one day

The developer reported 232 new downloads across five packages in a single day, bringing the combined total to 7,799 toward a 10,000 goal. The most-downloaded package, plumber-linter, gained 171 downloads and reached 2,339 total, while hexlens, environmental-peek, react-dismiss, and @parasraju/plumber-mcp also grew more modestly. Recent releases included plumber-mcp v1.3.0 with a new configuration scanning tool and plumber-linter v1.5.0 with five new GitLab CI rules. The developer noted no shipping activity on the day due to an exam, and plans to release hexlens v0.7.1 the following day.

0
ProgrammingDEV Community ·

Google Releases Gemini 4 Neon, a Mid-Tier Model Aimed at Everyday Developer Coding

Google launched Gemini 4 Neon on November 18, positioning it as the middle tier of its Gemini 4 family, between the frontier Carbon model and the faster Hydrogen model. The model is designed for frequent, complex coding tasks, analytical reasoning, and enterprise workflows. It ranks third on the Artificial Analysis Intelligence Index at maximum thinking and second on the Vals Index, and scored second on the new Agent Arena Index across more than 4,200 real-world agent sessions. Neon offers a 1-million-token context window with multimodal input support. The article argues that its lower cost and latency make it practical for routine developer work, though the claims are drawn from the source's own analysis of pricing and benchmark results.