Handle local connection type on HbaRecordForRole model
We modify the interface.HostConnectionInfo to also handle local connection for that the HostConnectionInfo is renamed to ConnectionInfo and two validators are added:
- one to check the address or netmask is undefined when using 'local' connection type. It also verifies address or netmaks is set when using another connection type ;
- a second one to set the connection type to 'local' when no connection information are defined (this ensure compatibility with the previous behaviour).
This simplifies the serialization and deserialization logic in pglift.hba. There might be room for improvement in how the type and conntype fields are handled, by using serialize_by_alias, though I wasn't successful in using that feature.
Overall, this commit try to align the logic for the local connection type more closely with the model and use the same logic than for other type.