FeatureFuel
2

Complex authorization methods implementation - Create a db_post_request Hook for Dynamic Data Masking in Supabase

Source: supabase/supabase#31314 · opened by @vargasjona
Problem Currently, there is no mechanism in Supabase to dynamically mask or manipulate output data before it is sent to the client. While Row-Level Security (RLS) and Column-Level Security (CLS) provide robust access control, certain complex authorization scenarios remain challenging to implement securely without resorting to external middleware or duplicating logic. For example, when fetching a list of users, the desired behavior might be: • For users with the role customer: - Display the email field only if the user_id matches the authenticated user. - For other users, display NULL in the email field. • For users with the role admin: - Display all email fields without restriction. Achieving this securely is challenging due to: 1. Views: While it's possible to create a masking view, an attacker with access token could potentially bypass this by querying the base table directly. 2. Custom Edge Functions: Implementing complex rules via Edge Fu…

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests