From: | "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com> |
---|---|
To: | Michael Paquier <michael(at)paquier(dot)xyz> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: [PATCH] Add peer authentication TAP test |
Date: | 2022-09-30 17:51:29 |
Message-ID: | 05056cfa-50d9-502d-4c4c-4725c6fb9943@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
On 9/30/22 2:00 AM, Michael Paquier wrote:
> On Wed, Sep 28, 2022 at 04:24:44PM +0900, Michael Paquier wrote:
>> Hmm, indeed. It would be more reliable to rely on the contents
>> returned by getpeereid()/getpwuid() after one successful peer
>> connection, then use it in the map. I was wondering whether using
>> stuff like getpwuid() in the perl script itself would be better, but
>> it sounds less of a headache in terms of portability to just rely on
>> authn_id via SYSTEM_USER to generate the contents of the correct map.
>
> By the way, on an extra read I have found a few things that can be
> simplified
> - I think that test_role() should be reworked so as the log patterns
> expected are passed down to connect_ok() and connect_fails() rather
> than involving find_in_log(). You still need find_in_log() to skip
> properly the case where peer is not supported by the platform, of
> course.
> - get_log_size() is not necessary. You should be able to get the same
> information with "-s $self->logfile".
> - Nit: a newline should be added at the end of 003_peer.pl.
> --
Agree that it could be simplified, thanks for the hints!
Attached a simplified version.
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Attachment | Content-Type | Size |
---|---|---|
v2-0001-peer-authentication-tap-test.patch | text/plain | 3.3 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2022-09-30 17:58:06 | Re: Tracking last scan time |
Previous Message | Robert Haas | 2022-09-30 17:43:10 | Re: disfavoring unparameterized nested loops |