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 1oMUoA-0004mc-ID for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Aug 2022 13:34:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oMUo9-0006mR-Dv for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Aug 2022 13:34:37 +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 1oMUo9-0006hc-39 for pgsql-hackers@lists.postgresql.org; Fri, 12 Aug 2022 13:34:37 +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 1oMUo6-00034J-BH for pgsql-hackers@postgresql.org; Fri, 12 Aug 2022 13:34:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1660311274; x=1691847274; h=message-id:date:mime-version:subject:cc:references:from: to:in-reply-to:content-transfer-encoding; bh=6DbC35ULXZ2nzLUn0GGfg+EiFcwRnvFcIN0TFEf5NdY=; b=nuTv/iWEcEoxxUrn0hE3WbyuQ9PKEVtkg3RlUArhjqwua30BPNayELJG SZATYFtZj+zuzzdcXHCi7JM8W0Dxu/FCOnDICW6sUfV36u4ki8C/E0x3v eRh4RPhpGKkRhi85QqQuMhBsf4XljDFvi5r8Hd7/7qudn2sja4YPIjgTA g=; X-IronPort-AV: E=Sophos;i="5.93,233,1654560000"; d="scan'208";a="1043700290" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-iad-1a-b27d4a00.us-east-1.amazon.com) ([10.25.36.214]) by smtp-border-fw-9103.sea19.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2022 13:34:15 +0000 Received: from EX13D03EUC003.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1a-b27d4a00.us-east-1.amazon.com (Postfix) with ESMTPS id 4E62F811A4; Fri, 12 Aug 2022 13:34:13 +0000 (UTC) Received: from [192.168.2.147] (10.43.160.100) by EX13D03EUC003.ant.amazon.com (10.43.164.192) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Fri, 12 Aug 2022 13:34:09 +0000 Message-ID: <127bd019-04f0-313c-551c-d949cdc4ad50@amazon.com> Date: Fri, 12 Aug 2022 15:34:04 +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.2 Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers Content-Language: en-US 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> <2a1e2717-8c68-3f9e-1e02-32da71deb327@amazon.com> From: "Drouvot, Bertrand" To: Jacob Champion In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.43.160.100] X-ClientProxiedBy: EX13D42UWB004.ant.amazon.com (10.43.161.99) 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/12/22 12:28 AM, Jacob Champion wrote: > On Wed, Aug 10, 2022 at 10:48 PM Drouvot, Bertrand 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