News for hackers. Stuff that matters.
Re:Talking to Postgres Through Java 16 Unix-Domain Socket Ch... by avi_vallarapu on Friday February 05, 2021 @08:27AM (#26036044)
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.
Re:Talking to Postgres Through Java 16 Unix-Domain Socket Ch... by matthewaveryusa on Friday February 05, 2021 @09:16AM (#26036517)
This 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/ge...