Skip to content

Conversation

@Olshansk
Copy link
Contributor

@Olshansk Olshansk commented Oct 2, 2025

This is a stripped down version of #452 so it's easier to review & understand.

Reviewing - The key thing to review are the new .sql files.

Testing - cd ./portal-db; make quickstart and follow the instructions.

Demo:

Screen.Recording.2025-10-01.at.9.55.49.PM.mov

Pascal van Leeuwen and others added 30 commits September 16, 2025 19:32
@Olshansk Olshansk changed the title [WIP] Postgrest v2 [PortalDB][Attempt #2] POC PostgREST implementation with API Autogen Oct 2, 2025
@Olshansk Olshansk requested a review from fredteumer October 2, 2025 05:02
@Olshansk Olshansk self-assigned this Oct 2, 2025
@Olshansk Olshansk added this to the Portal Features milestone Oct 2, 2025
@Olshansk Olshansk changed the title [PortalDB][Attempt #2] POC PostgREST implementation with API Autogen [PortalDB][Attempt 2] POC PostgREST implementation with API Autogen Oct 2, 2025
Copy link
Contributor

@fredteumer fredteumer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments -- still struggling with the security model here.

I think we're mostly there I just want to wrap my head around the final details.

@fredteumer
Copy link
Contributor

I think this is our strategy for access:
image

Let me know if you disagree

@Olshansk Olshansk marked this pull request as ready for review October 2, 2025 17:27
@Olshansk
Copy link
Contributor Author

Olshansk commented Oct 2, 2025

@fredteumer So here's where we at:

  1. I tried to keep things ULTRA SIMPLE for v1 without limiting us in the future.
  2. I'm following best practices from postgREST regarding user switching roles (see image below): https://docs.postgrest.org/en/v12/references/auth.html
  3. The authenticator will set the role to either admin (us) or reader (keep it safer
  4. Regarding RBAC, portal-db/schema/002_postgrest_init.sql now has a baseline and we can improve it.

PTAL and lmk what you think. I'm still updating some of the docs & scripts.

Screenshot 2025-10-02 at 12 38 15 PM

@Olshansk Olshansk requested a review from fredteumer October 2, 2025 20:03
@fredteumer
Copy link
Contributor

fredteumer commented Oct 3, 2025

@Olshansk Latest changes are 🔥

  • JWT + SSL Certs to get into the DB
  • Top level roles authenticated into the DB
  • portal_db_admin and portal_db_reader for authorization/RLS
  • Portal Application roles defined within the tables

This should be a sound foundation to start iterating on top of.

Approved ✔️ and left a simple typo comment to clean up.

@Olshansk Olshansk merged commit c961b2d into main Oct 3, 2025
8 checks passed
@Olshansk Olshansk deleted the postgrest_v2 branch October 3, 2025 22:51
@Olshansk
Copy link
Contributor Author

Olshansk commented Oct 3, 2025

@fredteumer Merged.

I'm pretty sure we're going to hit some issues along the way, but will figure it out along the way.

Merging this will enable kicking off the effort here: https://github.com/buildwithgrove/infrastructure/pulls?q=sort%3Aupdated-desc+is%3Apr+is%3Aopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants