Fix content access gaps for anonymous and public document users#265
Closed
BigSimmo wants to merge 1 commit into
Closed
Fix content access gaps for anonymous and public document users#265BigSimmo wants to merge 1 commit into
BigSimmo wants to merge 1 commit into
Conversation
- Degrade invalid bearer tokens to anonymous scope instead of 401 - Allow public document read routes (list, detail, signed-url, search, images) - Align registry routes with medications/differentials auth-signal short-circuit - Let DocumentViewer load public sources without requiring sign-in - Add regression tests and update access-control expectations
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
3 tasks
Owner
Author
|
Superseded by #269 (consolidated platform fixes branch). |
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.
Summary
Reviewed the repo's content access model and fixed several gaps that blocked legitimate users from reaching public content.
Access model (current)
owner_id = auth.uid()), enforced at both API and RLS layers.owner_id IS NULL), plus curated static snapshots for services, forms, medications, and differentials.Issues found and fixed
Security preserved
owner_id IS NULLonly (no cross-tenant leakage).Verification
npm run verify:cheap(118 test files, 1060 tests passed)npm run verify:ui— DocumentViewer behavior changed; recommend UI gate before mergenpm run check:production-readiness— touches document access and auth flowsClinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)Follow-up (not in this PR)
owner_id IS NULLif anonymous search should return real indexed content (currently most uploads assign an owner).PUBLIC_WORKSPACE_OWNER_IDfor anonymous uploads (planned indocs/superpowers/plans/2026-07-04-public-anonymous-access-rate-limits.md).docs/clinical-governance.md.