This is a demo of how to implement multi-user authentication on Postgres with Row-Level Security.
It showcases how to:
- Create users for each role
- Create a table with RLS enabled
- Create policies to manage access to the table based on the user's role
- Clone the repo
- Run
docker-compose up --build
- To run the test,
npx tsx test.ts
Disclaimer: This is an educational demo to understand RLS concepts. Don't use this code in production as it lacks proper security measures, connection pooling optimizations, and other essential features.