storage: owner SELECT policies for public buckets (audio, card-images) #82
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Status/Abandoned
Status/Blocked
Status/Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
project-halkyon/halkyon-infra!82
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/82/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
storage-api creates objects with INSERT ... RETURNING *, and Postgres
applies the SELECT policies' USING expression to the returned new row.
With zero SELECT policies on a bucket that is a default deny, so every
authenticated upload failed with 42501 'new row violates row-level
security policy' even though the INSERT policy passed - the reason all
1683 card-images uploads of an Anki deck import 400'd and the bucket
never accepted an object. audio had the same latent gap.
Owner-scoped SELECT (same shape as the private buckets) fixes uploads;
public rendering still goes through /object/public/... which does not
consult RLS. Applied to the live DB and verified with a real
authenticated upload + public read-back + delete through the storage
API.
Signed-off-by: Tizian 「ティツィアーン」 raisondetredev@pm.me