-
-
Notifications
You must be signed in to change notification settings - Fork 131
fix(rbac): block preview public channels #2713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
749e0f2
fix(rbac): block preview public channels
riderx ca093f8
Merge branch 'main' into codex/guard-app-preview-public-channel
riderx a887bb7
Merge branch 'main' into codex/guard-app-preview-public-channel
riderx cfe3ea5
fix(rbac): restamp preview public channel guard and block updates
riderx 1ee7330
fix(rbac): require app settings to publicize via UPDATE RLS
riderx 99cbf75
Merge branch 'main' into codex/guard-app-preview-public-channel
cursoragent fc43c48
fix(rbac): gate public channel flips with transition trigger
cursoragent 4104e2f
fix(rbac): restamp public channel guard past main migrations
cursoragent 8a88f6d
Merge branch 'main' into codex/guard-app-preview-public-channel
cursoragent bac5bf4
fix(admin): satisfy drizzle execute row constraint for onboarding met…
cursoragent 948d403
test(db): bump channels RLS pgTAP plan for public guard asserts
cursoragent 445c437
fix(rbac): only require app settings when publicizing a channel
cursoragent bc2f9f8
test(db): add behavioral coverage for public channel guard
cursoragent 70f8ddb
fix(db): detect request role for public channel guard
cursoragent 3684d36
ci: retrigger tests after unrelated Cloudflare flake
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
36 changes: 36 additions & 0 deletions
36
supabase/migrations/20260717133500_app_preview_public_channel_guard.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| -- A public/default channel changes app delivery settings. App-preview keys may | ||
| -- bootstrap private channels, but must not make a newly created channel public. | ||
| -- Keep this in INSERT RLS because `channel add --default` writes the table | ||
| -- directly; the channel endpoint performs the matching guard for its raw SQL | ||
| -- create-and-promote transaction. | ||
| DROP POLICY IF EXISTS "Allow RBAC channels insert" ON public.channels; | ||
| CREATE POLICY "Allow RBAC channels insert" | ||
| ON public.channels | ||
| FOR INSERT | ||
| TO anon, authenticated | ||
| WITH CHECK ( | ||
| public.rbac_check_permission_request( | ||
| public.rbac_perm_app_create_channel(), | ||
| owner_org, | ||
| app_id, | ||
| NULL::bigint | ||
| ) | ||
| AND ( | ||
| "public" IS FALSE | ||
| OR public.rbac_check_permission_request( | ||
| public.rbac_perm_app_update_settings(), | ||
| owner_org, | ||
| app_id, | ||
| NULL::bigint | ||
| ) | ||
| ) | ||
| AND ( | ||
| (version IS NULL AND rollout_version IS NULL) | ||
| OR public.rbac_check_permission_request( | ||
| public.rbac_perm_channel_promote_bundle(), | ||
| owner_org, | ||
| app_id, | ||
| NULL::bigint | ||
| ) | ||
| ) | ||
| ); |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.