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.
Comments
Similar requests
Implementing custom auth for edge functions
1 vote · 0 comments
OAuth server: an existing grant auto-approves and returns no client details, leaving no room for an account-confirmation step
1 vote · 0 comments
Add a 'Post User Creation' auth hook (or 'After User Creation')
8 votes · 0 comments
Allow querying enabled login methods from Management API
2 votes · 0 comments
Include resource field in OAuth authorization details response
1 vote · 0 comments
No comments yet.