Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oM13E-0004jq-KH for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Aug 2022 05:48:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oM13C-0001hV-Ot for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Aug 2022 05:48:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oM13C-0001hL-7i for pgsql-hackers@lists.postgresql.org; Thu, 11 Aug 2022 05:48:10 +0000 Received: from smtp-fw-9103.amazon.com ([207.171.188.200]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oM139-0008QX-0Z for pgsql-hackers@postgresql.org; Thu, 11 Aug 2022 05:48:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1660196887; x=1691732887; h=message-id:date:mime-version:to:cc:references:from: in-reply-to:content-transfer-encoding:subject; bh=ZW/XLjXiffUeXqFs71ioNRRzMZ1Ta/7pOAHtv1w02Ws=; b=MeRy7tgltAE0HJAfQKpb5omWXYa64GMj2BsJn9BGb4sVpD7QbQOcH7eb 0WzY/dpDGTo7chl2IU/ViPFHM8daZVTNMZ5oB61NdUtve2n3NHBIcCS14 KPGgHtOjDZJHprLktC40Kdu9zsAm6tb3oQRX5NZeVoFixH6zZmMEVPkNC M=; X-IronPort-AV: E=Sophos;i="5.93,228,1654560000"; d="scan'208";a="1043169015" Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-pdx-2b-28a78e3f.us-west-2.amazon.com) ([10.25.36.214]) by smtp-border-fw-9103.sea19.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2022 05:47:49 +0000 Received: from EX13D03EUC003.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2b-28a78e3f.us-west-2.amazon.com (Postfix) with ESMTPS id E77F0A279B; Thu, 11 Aug 2022 05:47:48 +0000 (UTC) Received: from [192.168.6.176] (10.43.161.199) by EX13D03EUC003.ant.amazon.com (10.43.164.192) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Thu, 11 Aug 2022 05:47:43 +0000 Message-ID: <2a1e2717-8c68-3f9e-1e02-32da71deb327@amazon.com> Date: Thu, 11 Aug 2022 07:47:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.1.1 To: Jacob Champion CC: Michael Paquier , Joe Conway , Robert Haas , Tom Lane , "sfrost@snowman.net" , "rjuju123@gmail.com" , "pgsql-hackers@postgresql.org" , "andres@anarazel.de" References: <3b678314-054a-6119-b373-4574067f404e@timescale.com> <34308245-ea21-82ee-b1fd-00b4766f3527@amazon.com> Content-Language: en-US From: "Drouvot, Bertrand" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.43.161.199] X-ClientProxiedBy: EX13D38UWC003.ant.amazon.com (10.43.162.23) To EX13D03EUC003.ant.amazon.com (10.43.164.192) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 8/10/22 5:09 PM, Jacob Champion wrote: > On Tue, Aug 9, 2022 at 3:39 AM Drouvot, Bertrand 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