insightautomate
BABetter Auth
•Created by oof2win2 on 2/10/2025 in #help
integrating with postgres rls (supabase)
Nice. Do you have any details on how it is likely be implemented?
63 replies
BABetter Auth
•Created by oof2win2 on 2/10/2025 in #help
integrating with postgres rls (supabase)
In what way does it expose it to abuse? With the right RLS (and CLS if necessary) you can lock things down pretty tightly
63 replies
BABetter Auth
•Created by oof2win2 on 2/10/2025 in #help
integrating with postgres rls (supabase)
@sebastian the supabase client with RLS allows us to skip out on building an API layer as well as utilising things like realtime (more important for us). To be honest I'm not the biggst fan of the supabase library and might end up switching out to setting up an API with an ORM but the realtime features are more interesting albeit requiring a slightly different setup.
63 replies
BABetter Auth
•Created by oof2win2 on 2/10/2025 in #help
integrating with postgres rls (supabase)
I think with supabase's recent third-party auth support there is likely a better way to do it via jwt but I haven't dug too deep into that. Hopefully the official integration will do that
63 replies
BABetter Auth
•Created by oof2win2 on 2/10/2025 in #help
integrating with postgres rls (supabase)
@umang In short this is my initial implementation
1. Create database functions to get/set the current user ID in PostgreSQL session variables:
2. Enable RLS on your table and create a policy:
3. Create RLS-enabled client utilities that automatically set the user ID:
4. Use the RLS client instead of the standard client for all database queries:
63 replies
BABetter Auth
•Created by insightautomate on 5/9/2025 in #help
Hashing script to seed database
which can be called with
4 replies
BABetter Auth
•Created by insightautomate on 5/9/2025 in #help
Hashing script to seed database
For anyone else who comes across this I solved it by having to run a separate node script that the python references.
4 replies
BABetter Auth
•Created by oof2win2 on 2/10/2025 in #help
integrating with postgres rls (supabase)
@bekacru any idea on timings for the supabase integrration? I've just gone through manually implementing RLS via postgres functions and middleware, was not exactly a smooth experience so would be great to see a closer integration.
63 replies