supabase-py
supabase-py copied to clipboard
Row Level Security and Python
Hi Folks!
I am calling a python API from Vue app where an user is logged in using supabase. This Python API was created using FastAPI and I have shared the same JWT secret and algorithm so I can ensure who is calling the API. The problem is when I try to execute an insert using supabase client + anon key I am receiving a RLS error, seems that it can't identify who is calling the insert from the python client.
My RLS is:
Enable insert for authenticated users only
(role() = 'authenticated'::text)
Is it possible somehow to pass which user is calling the python API using supabase-py? I do have the access_token sent by the javascript client but I have no idea how to share it and use on supabase.table("projects").insert
related: https://github.com/supabase-community/supabase-py/issues/70
We've added full support for RLS in the Python library as of version 1.1.0.
We've added full support for RLS in the Python library as of version 1.1.0.
Can you show us how to use it? I've been looking for 1 hour, but don't know how to get RLS working with the Supabase Python Client...