UW-Macrostrat / macrostrat

A geological data platform for exploration, integration, and analysis
Apache License 2.0
2 stars 0 forks source link

Declarative management for PostgreSQL roles #46

Open davenquinn opened 2 months ago

davenquinn commented 2 months ago

We're increasingly encoding access control in PostgreSQL roles. This is great, but means we need to have good ways to manage/apply these roles on database startup and changes (e.g., migrations).

Here's an example of some role configuration for PostgREST: https://github.com/UW-Macrostrat/macrostrat/blob/main/cli/macrostrat/cli/subsystems/knowledge_graph/fixtures/roles.sql

We need to figure out how to centralize and generalize this, in tandem with defining finer-grained roles and potentially row-level security for data access management.

Context:

davenquinn commented 1 month ago

@brianaydemir we can worry more about this later, but this is a lane in which I feel there must be some existing software solution? Keeping a set of roles consistent seems like a really general problem for postgres-based systems...