pgTap unit tests after implementing Custom Claims & Role-based Access Control (RBAC)
Hi Folks
After implementing Custom Claims & Role-based Access Control (RBAC) following https://supabase.com/docs/guides/database/postgres/custom-claims-and-role-based-access-control-rbac
I found this guide easy to follow and following this pattern suits my requirements.
It is working when testing manually using the web app though not when using pgTap tests.
I don't think I'm mocking
Is this not the same as
Edit: typo
After implementing Custom Claims & Role-based Access Control (RBAC) following https://supabase.com/docs/guides/database/postgres/custom-claims-and-role-based-access-control-rbac
I found this guide easy to follow and following this pattern suits my requirements.
It is working when testing manually using the web app though not when using pgTap tests.
I don't think I'm mocking
user_role correctly using set local request.jwt.user_role = 'driver'; Is this not the same as
auth.jwt() ->> 'user_role' that I reversed engineered from the public.authorize function.Edit: typo
Use Auth Hooks to add custom claims for managing role-based access control.
