From: Drouvot, Bertrand <bdrouvot@amazon.com>
To: Jacob Champion <jchampion@timescale.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Joe Conway <mail@joeconway.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: sfrost@snowman.net <sfrost@snowman.net>
Cc: rjuju123@gmail.com <rjuju123@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: andres@anarazel.de <andres@anarazel.de>
Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers
Date: Fri, 12 Aug 2022 15:34:04 +0200
Message-ID: <127bd019-04f0-313c-551c-d949cdc4ad50@amazon.com> (raw)
In-Reply-To: <CAAWbhmiRZMBLCKjJV43skOxiBM71P82O2KMJf-n97t4zUtdqDw@mail.gmail.com>
References: <CAAWbhmhfzt+hYiTXi3f0V_E5E+E_mmzd_x+p9zjs_NvBpJ36pA@mail.gmail.com>
<CA+TgmoZmRAkOgNzSqRxzJ=Kok_NYHZ57X2ZKRh=cfoCukp4f_Q@mail.gmail.com>
<CAAWbhmjPu2VNS8MhwDp=+hu61EsJ3zf_rTRtyZ8Qw08eAhg_pA@mail.gmail.com>
<f98e0b81-96cb-b0d8-c483-e99563cc44b4@amazon.com>
<3b678314-054a-6119-b373-4574067f404e@timescale.com>
<cc8aaffb-1008-eaf6-090e-2461cbe6e1cf@amazon.com>
<Yu4JhEvh1V0sGWXv@paquier.xyz>
<af85ae52-de60-6a98-d69e-7d410aee752d@joeconway.com>
<Yu9slCBp0WWD4Qx1@paquier.xyz>
<d25a412e-9686-d37f-3bd1-63b821f67a51@amazon.com>
<YvImQ0sl1dV4TBNg@paquier.xyz>
<34308245-ea21-82ee-b1fd-00b4766f3527@amazon.com>
<CAAWbhmi4OHmk0EVBuQrYcwbotF8uFayDVgkL-H-gqrK0XmeSeg@mail.gmail.com>
<2a1e2717-8c68-3f9e-1e02-32da71deb327@amazon.com>
<CAAWbhmiRZMBLCKjJV43skOxiBM71P82O2KMJf-n97t4zUtdqDw@mail.gmail.com>
Hi,
On 8/12/22 12:28 AM, Jacob Champion wrote:
> On Wed, Aug 10, 2022 at 10:48 PM Drouvot, Bertrand <bdrouvot@amazon.com> wrote:
>> What do you think about adding a second field in ClientConnectionInfo
>> for the auth method (as suggested by Michael upthread)?
> Sure -- without a followup patch, it's not really tested, though.
>
> v2 adjusts set_authn_id() to copy the auth_method over as well. It
> "passes tests" but is otherwise unexercised.
Thank you!
To help with the testing I've just provided a new version (aka
v2-0004-system_user-implementation.patch) of the SYSTEM_USER patch in
[1] that can be applied on top of
"v2-0001-Allow-parallel-workers-to-read-authn_id.patch".
But for this to work, the first comment below on your patch needs to be
addressed.
Once the first comment is addressed and the new SYSTEM_USER patch
applied (that adds new tap tests) then we can test the propagation to
the parallel workers with:
make -C src/test/kerberos check PROVE_TESTS=t/001_auth.pl PROVE_FLAGS=-v
and
make -C src/test/authentication check PROVE_TESTS=t/001_password.pl
PROVE_FLAGS=-v
Both are currently successful.
Regarding the comments on
v2-0001-Allow-parallel-workers-to-read-authn_id.patch:
1)
This is the one to be applied before adding the new SYSTEM_USER one on top:
+typedef struct
+{
+ /*
+ * Authenticated identity. The meaning of this identifier is
dependent on
has to be replaced by:
+typedef struct ClientConnectionInfo
+{
+ /*
+ * Authenticated identity. The meaning of this identifier is
dependent on
2)
+ * Authenticated identity. The meaning of this identifier is
dependent on
There is one extra space before "The"
3)
+SerializeClientConnectionInfo(Size maxsize, char *start_address)
+{
+ /*
+ * First byte is an indication of whether or not authn_id has
been set to
+ * non-NULL, to differentiate that case from the empty string.
+ */
is authn_id being an empty string possible?
4)
+ */
+
+ClientConnectionInfo MyClientConnectionInfo;
+
+/*
+ * Calculate the space needed to serialize MyClientConnectionInfo.
+ */
+Size
+EstimateClientConnectionInfoSpace(void)
From a coding style point of view, shouldn't "ClientConnectionInfo
MyClientConnectionInfo;" be moved to the top of the file?
[1]: https://commitfest.postgresql.org/39/3703/
Regards,
--
Bertrand Drouvot
Amazon Web Services: https://aws.amazon.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: bdrouvot@amazon.com, jchampion@timescale.com, michael@paquier.xyz, mail@joeconway.com, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, sfrost@snowman.net, rjuju123@gmail.com, andres@anarazel.de
Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers
In-Reply-To: <127bd019-04f0-313c-551c-d949cdc4ad50@amazon.com>
References: <CAAWbhmhfzt+hYiTXi3f0V_E5E+E_mmzd_x+p9zjs_NvBpJ36pA@mail.gmail.com> <CA+TgmoZmRAkOgNzSqRxzJ=Kok_NYHZ57X2ZKRh=cfoCukp4f_Q@mail.gmail.com> <CAAWbhmjPu2VNS8MhwDp=+hu61EsJ3zf_rTRtyZ8Qw08eAhg_pA@mail.gmail.com> <f98e0b81-96cb-b0d8-c483-e99563cc44b4@amazon.com> <3b678314-054a-6119-b373-4574067f404e@timescale.com> <cc8aaffb-1008-eaf6-090e-2461cbe6e1cf@amazon.com> <Yu4JhEvh1V0sGWXv@paquier.xyz> <af85ae52-de60-6a98-d69e-7d410aee752d@joeconway.com> <Yu9slCBp0WWD4Qx1@paquier.xyz> <d25a412e-9686-d37f-3bd1-63b821f67a51@amazon.com> <YvImQ0sl1dV4TBNg@paquier.xyz> <34308245-ea21-82ee-b1fd-00b4766f3527@amazon.com> <CAAWbhmi4OHmk0EVBuQrYcwbotF8uFayDVgkL-H-gqrK0XmeSeg@mail.gmail.com> <2a1e2717-8c68-3f9e-1e02-32da71deb327@amazon.com> <CAAWbhmiRZMBLCKjJV43skOxiBM71P82O2KMJf-n97t4zUtdqDw@mail.gmail.com> <127bd019-04f0-313c-551c-d949cdc4ad50@amazon.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox