SpacetimeDB icon indicating copy to clipboard operation
SpacetimeDB copied to clipboard

Adding the system table for row level security

Open mamcx opened this issue 1 year ago • 1 comments

Description of Changes

Add a new system table st_row_level_security to store the SQL queries for row-level security.

This is a first step to add support for authorization. This PR doesn't validate that the queries are valid, that will done when #1602 is implemented.

Closes #1600.

Expected complexity level and risk

2: It adds a new system table and because we haven't yet migrated support for them, it needs a recreate of the db.

Testing

  • [x] Add extra test for RLS
  • [x] Because we don't have any RLS in the initial bootstrap I also add a test for reload after creating one
  • [x] Check using the SQL cli the new table

mamcx avatar Sep 26 '24 16:09 mamcx

It seems to me that arbitrary changes to row-level security can be performed automatically.

If we need to check the validity of the sql then probably not.

mamcx avatar Oct 02 '24 15:10 mamcx

My main questions are:

  1. Can we get rid of the name column? I believe we can.
  2. Do we need a primary key column? I believe we don't.

Yes, is already done

mamcx avatar Oct 11 '24 15:10 mamcx