Re: [PATCH] Expose port->authn_id to extensions and triggers

From: "Drouvot, Bertrand" <bdrouvot(at)amazon(dot)com>
To: Jacob Champion <jchampion(at)timescale(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Joe Conway <mail(at)joeconway(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "sfrost(at)snowman(dot)net" <sfrost(at)snowman(dot)net>, "rjuju123(at)gmail(dot)com" <rjuju123(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>
Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers
Date: 2022-08-11 05:47:39
Message-ID: 2a1e2717-8c68-3f9e-1e02-32da71deb327@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 8/10/22 5:09 PM, Jacob Champion wrote:
> On Tue, Aug 9, 2022 at 3:39 AM Drouvot, Bertrand <bdrouvot(at)amazon(dot)com> wrote:
>> Agree that it makes sense to work on those patches in this particular
>> order then.
> Sounds good. The ClientConnectionInfo patch (previously 0002) is
> attached, with the SQL function removed.

Thanks for the patch!

Looking at:

+typedef struct
+{
+    /*
+     * Authenticated identity.  The meaning of this identifier is
dependent on
+     * hba->auth_method; it is the identity (if any) that the user
presented
+     * during the authentication cycle, before they were assigned a
database
+     * role.  (It is effectively the "SYSTEM-USERNAME" of a pg_ident
usermap
+     * -- though the exact string in use may be different, depending on
pg_hba
+     * options.)
+     *
+     * authn_id is NULL if the user has not actually been
authenticated, for
+     * example if the "trust" auth method is in use.
+     */
+    const char *authn_id;
+} ClientConnectionInfo;

What do you think about adding a second field in ClientConnectionInfo
for the auth method (as suggested by Michael upthread)?

That will be needed by the SYSTEM_USER patch (that its current version
implements as "auth_method:identity").

Thanks,

--
Bertrand Drouvot
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-08-11 06:10:08 Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns
Previous Message Sergey Dudoladov 2022-08-11 05:42:04 Re: Stats collector's idx_blks_hit value is highly misleading in practice