will / crystal-pg

a postgres driver for crystal
BSD 3-Clause "New" or "Revised" License
462 stars 77 forks source link

Add config setting auth_methods #220

Closed straight-shoota closed 3 years ago

straight-shoota commented 3 years ago

This adds a auth_methods config setting which allows to configure which auth methods the client should accept.

The settings value is a list of comma separated values. The default is scram-sha-256,md5. cleartext needs to be explicitly enabled.

Is there any place where documentation can be added?

I didn't do anything about OK authentication frame. A safe default should also fail if the server just passes you through without a credential check. But this is more complicated because it is fine with SSL client certificate for example. So it needs more work. For now I'm just posting this patch.

Superseeds #218 cf crystal-lang/crystal-db#141

straight-shoota commented 3 years ago

I think this is ready to merge. As you said, further improvements can follow later.

will commented 3 years ago

I think this is ready to merge. As you said, further improvements can follow later.

Sounds good, I'll do this tomorrow.

will commented 3 years ago

Thank you! Going to wrap up a few other things then do a release soon.