We've released File Gate, a free and open-source Drupal module that makes a "private" file genuinely gated — for decoupled, coupled, and hybrid sites alike. It's available now on drupal.org.
Drupal grants a private-file download to anyone who can view the content that references it. Because anonymous visitors can view published content, a private:// file attached to a published page is effectively public to anyone with the link — private:// means "not sitting in a public directory," not "gated." That gap is exactly what bites lead-gen documents, gated reports, and paywalled deliverables, and it's sharpest on a headless site, where the gate (a form, a login, a purchase) lives in a different system from the file.
We hit it building the decoupled platform behind wilkesliberty.com, and rather than solve it once, we built the fix as a reusable module and gave it back to the community.
/system/files for any private file a gated field references — overriding core's permissive private-file access.File Gate requires Drupal 11.4+ and a private file system. Install it with Composer:
composer require drupal/file_gateThe current release is 1.0.0-beta1, released under the GPL-2.0-or-later license. For the full picture, read the open-source overview File Gate and the engineering whitepaper Gating Private Files in a Headless CMS.