Skip to content

Add db_post_request Hook for Dynamic Data Masking in PostgREST - Complex authorization methods implementation #3832

Answered by wolfgangwalther
jonra1993 asked this question in Q&A
Discussion options

You must be logged in to vote

A couple of thoughts:

  • PostgREST is the wrong layer to solve this at, imho. Access control should really be handled inside the database, not here.
  • We'd really need a proper combination of row level security and column level grants in upstream PostgreSQL. Column-specific Row Level Security policies. That would be great - but we don't have it.
  • You could possibly use https://labs.dalibo.com/postgresql_anonymizer or https://github.com/rjuju/pg_anonymize to do the masking you want to do via SECURITY LABELs.

All of that being said, PostgREST does have a way to influence the output, too: You could implement a custom aggregate to override the built-in media type handler for json: https://docs.po…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jonra1993
Comment options

Answer selected by wolfgangwalther
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3830 on December 25, 2024 11:11.