Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michaelcharles/examplemultitenancyapiwithrowlevelsecurity
An example .NET Core Web API with multi-tenancy leveraging Postgres row-level security
https://github.com/michaelcharles/examplemultitenancyapiwithrowlevelsecurity
Last synced: about 2 months ago
JSON representation
An example .NET Core Web API with multi-tenancy leveraging Postgres row-level security
- Host: GitHub
- URL: https://github.com/michaelcharles/examplemultitenancyapiwithrowlevelsecurity
- Owner: MichaelCharles
- Created: 2024-08-02T01:22:04.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-02T01:54:15.000Z (5 months ago)
- Last Synced: 2024-08-02T03:32:12.808Z (5 months ago)
- Language: C#
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Example Multi-Tenancy API with Row-Level Security
This project demonstrates a multi-tenant API that uses row-level security in PostgreSQL to ensure data isolation between tenants. The API is built with C# and .NET Core, using Entity Framework Core for database interactions. This API was prepared as a reproducible example of a problem we're facing to be submitted along with a GitHub issue.
## Key Features
- Multi-tenant architecture
- PostgreSQL database with row-level security
- Entity Framework Core ORM
- JWT-based tenant identification (simulated in this example)
- JSONB column usage for flexible data storage## Setup and Running
1. Start the database: `docker-compose up` in the root directory
2. Run the API: `dotnet run` in the root directoryThe `init.sql` file sets up the database schema, dummy data, row-level security, and users.
## GitHub Issue
https://github.com/npgsql/efcore.pg/issues/3239