DataCater / datacater

The developer-friendly ETL platform for transforming data in real-time. Based on Apache Kafka® and Kubernetes®.
https://datacater.io
Other
82 stars 4 forks source link

feat(#23) working example of how rls can be implemented #80

Closed HknLof closed 1 year ago

HknLof commented 1 year ago

This is a follow up to pull request https://github.com/DataCater/datacater/pull/77. The process to implement RLS for datacater is as follows:

  1. Initialise tables and user role datacater via migartions. For now init-db.sql.
  2. Define a @MappedSuperClass, which fills in the tenant automatically. [Static for validating approach]
  3. On Read queries set the current tenant as a pg param via SET datacater.tenant = $tenant. [Static for validating approach]

Refs

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

84.0% 84.0% Coverage
0.0% 0.0% Duplication