4 ms·
If you trust your local connections over a socket, you may also map the OS user with which the App is running locally to the postgres database user in the pg_id
by avi_vallarapu 6y ago
If you trust your local connections over a socket, you may also map the OS user with which the App is running locally to the postgres database user in the pg_ident.conf. We could use that map through peer authentication mode for local connections through that App OS User. What i meant to say is, it is not limited to md5 or other modes no that it doesn't work with peer.
- matthewaveryusa 6y agoThis was a recent discovery for me -- you can verify not only the peer uid/gid but also the pid using getsockopt so_peercred. It's very neat indeed (and this is what postgres uses in the pg_ident.conf): https://github.com/postgres/postgres/blob/master/src/port/getpeereid.c#L42-L46 https://github.com/postgres/postgres/blob/master/src/port/ge...