Repository navigation
Add public asset house rules - #3
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Team feedback: public read on
directus_filesexposes every file through/filesand/assets. The skills had the folder-scoped recipe and the trap, but not the house rules around it, and they didn't say what happens on the core tier.What
directus-access-control (recipes, router trap)
/assetsso image bytes don't go through, and get billed on, the frontend server.publicfolder, with subfolders at most two levels deep. The rule now covers the folder and its direct children:{"_or":[{"folder":{"_eq":"<id>"}},{"folder":{"parent":{"_eq":"<id>"}}}]}. Match the folder by id.id,title,description,type,filesize,width,height).*exposesuploaded_by,filename_disk, andmetadata, and photo EXIF can include GPS.directus-content-modeling
options.folderto thepublicfolder (thefile,file-image, andfilesinterfaces all support it), so uploads don't 403 on the live site.directus
/assetsnote points to the scoped recipe.Changeset: minor.
Verified against v12.5.1
directus_files.folder→directus_foldersanddirectus_folders.parent→directus_folders(packages/system-data/src/relations/relations.yaml)./assetschecks read access on the file and serves it with any allowed field list (api/src/services/assets.ts).file,file-image, andfilesinterfaces.node scripts/validate.mjs --strict: 0 errors, 0 warnings.The two-level folder rule couldn't be exercised end to end here: the eval instance is unlicensed, and core rejects custom rules.