Authentication
When a client connection is established Supavisor needs to verify the credentials of the connection.
Credential verification is done either via user records or an auth_query.
Tenant User Record
If no auth_query exists on the tenant record credentials will be looked up
from a user and verified against the client connection string credentials.
There must be one or more user records for a tenant where is_manager is false.
Authentication Query
If the user in the client connection is not found for a tenant it will use
the user where is_manager is true and the auth_query on the tenant to
return matching credentials from the tenant database.
A simple auth_query can be:
1 | |
Alternatively, create a function to return a username and password for a user:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
Update the auth_query on the tenant and it will use this query to match
against client connection credentials.
1 | |