postgresml / pgcat

PostgreSQL pooler with sharding, load balancing and failover support.
MIT License
3.12k stars 190 forks source link

Implement Address Whitelist Functionality #813

Open AndrewJackson2020 opened 2 months ago

AndrewJackson2020 commented 2 months ago

This PR adds address whitelist functionality to pgcat. This is mostly useful with trust auth where no password is required but you can still allow only specific IP's/IP ranges/addresses to access a user/database but can also be used with password authentication to provide an extra layer of security.

This PR is unit tested, does not require any changes to the dockerfile/CI. It does require a slight change in dependencies of the rust cargo dependencies but I don't think this should break anything.

One potential issue with this implementation is that I had to make the set element of the AddrSet struct public. I am open to any alternative implementations that do this in a more clean way.