Problem/Motivation
When access workflow is in place, the fixed public / private sorage configuration is a problem:
* If site owner chooses public file storage, they suffer from PSA-2016-003
* If site owner chooses private file storage, they suffer from performance penalty. For example, on a campaign page with 50ish
anonymous-user-submitted-and-reviewed testimonial photos, serving the page needs 51 Drupal bootstraps
Proposed resolution
See File access fix as contrib POC, its README and code.
Remaining tasks
* Consent on that we want this and get Subsystem(?) Maintainer signoff
* Roll a POC
* Add tests
* Remove the "Use public / private file storage" setting on file fields (this issue is about autodetecting that)
* Review, commit, profit
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
The "public / private file storage" setting on file fields has gone. Drupal autodetects this now.
If you as developer want to adjust this, you can swap out the service or implement some hooks.
Comments
Comment #2
geek-merlinComment #3
xjmComment #4
geek-merlinLet's be prrrrrrecise.
Comment #12
prudloff commentedThis would improve the security of the Drupal ecosystem.
Because of the performance cost of private files, a lot of websites use public files by default and sometimes involuntarily expose files.
I think we should keep allowing to force public or private file storage. There are use cases where having a predictable path for files is useful (for example if files are also manipulated by another system than Drupal). It can also be useful to force private files on public entities (to be able to alter the file response headers for example).
This new behavior could be a third option on file fields.
Comment #13
prudloff commentedIs #1836080: Unpublished files should be in private storage a duplicate?
Comment #15
geek-merlinYep, setting as dup.