Skip to content

fix: Apply RLS rules to Channel controller#758

Merged
filipecabaco merged 16 commits intomainfrom
fix/apply-rls-to-channel-endpoint
Jan 4, 2024
Merged

fix: Apply RLS rules to Channel controller#758
filipecabaco merged 16 commits intomainfrom
fix/apply-rls-to-channel-endpoint

Conversation

@filipecabaco
Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Apply RLS rules to Channel controller

@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
realtime-demo ⬜️ Ignored (Inspect) Visit Preview Jan 4, 2024 10:20pm

@filipecabaco filipecabaco force-pushed the fix/apply-rls-to-channel-endpoint branch from 597cb21 to 13d3917 Compare December 8, 2023 09:32
Comment thread dev/postgres/00-supabase-schema.sql Outdated
Comment thread dev/postgres/01-auth-schema.sql Outdated
Comment thread lib/realtime/tenants/repo/migrations/20231204144023_create_config.ex Outdated
Comment thread lib/realtime/tenants/authorization.ex Outdated
Comment thread lib/realtime/tenants/authorization.ex
Comment thread lib/realtime/tenants/authorization.ex
@filipecabaco filipecabaco force-pushed the fix/apply-rls-to-channel-endpoint branch from f6c5b11 to 9de45d5 Compare December 27, 2023 00:02
@filipecabaco filipecabaco marked this pull request as ready for review December 27, 2023 15:57
@filipecabaco filipecabaco requested review from a team, abc3 and chasers December 27, 2023 15:58
Comment thread test/realtime_web/plugs/rls_authorization_test.exs Outdated
Comment thread test/realtime/tenants/authorization_test.exs Outdated
Comment thread lib/realtime_web/plugs/rls_authorization.ex Outdated
Copy link
Copy Markdown

@josevalim josevalim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @filipecabaco, comments added! 🎄

@filipecabaco
Copy link
Copy Markdown
Member Author

Awesome! thank you will tackle them 🙏

@filipecabaco filipecabaco force-pushed the fix/apply-rls-to-channel-endpoint branch from a06530a to ddfeab0 Compare January 3, 2024 12:41
do $func_exists$
begin if not exists(select * from pg_proc where proname = 'role')
then
create or replace function auth.uid() returns uuid as $function_def$
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we managing auth functions exactly again? These are not our fns.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self hosting made easier basically. if we want to keep realtime as self deployable as possible we need to create them on our own if they are not present

Comment thread lib/realtime/tenants/authorization.ex
Comment thread lib/realtime_web/plugs/rls_authorization.ex
Comment thread lib/realtime_web/controllers/channels_controller.ex Outdated
Comment thread test/realtime/tenants/authorization_test.exs Outdated
@filipecabaco filipecabaco force-pushed the fix/apply-rls-to-channel-endpoint branch from 2589edd to b7fe48d Compare January 4, 2024 22:20
@filipecabaco filipecabaco merged commit e4c21c3 into main Jan 4, 2024
@filipecabaco filipecabaco deleted the fix/apply-rls-to-channel-endpoint branch January 4, 2024 22:33
@kiwicopple
Copy link
Copy Markdown
Member

🎉 This PR is included in version 2.25.55 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants