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 1nNpni-0002bS-HU for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Feb 2022 05:39:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nNpnh-0002hg-5Y for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Feb 2022 05:39:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nNpng-0002hW-SL for pgsql-hackers@lists.postgresql.org; Sat, 26 Feb 2022 05:39:24 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nNpne-00022f-Pb for pgsql-hackers@postgresql.org; Sat, 26 Feb 2022 05:39:23 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3FC5F5C01D2; Sat, 26 Feb 2022 00:39:22 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 26 Feb 2022 00:39:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; bh=3lzDTAWnLDWS+/Xyzbd73bpMXnChuSJVYkDEbJ qO7+I=; b=k+ksVkkafg2W30+IYJyHvbGuLX09BVAynaW3vTScYP/GPoeHZFTqAX JNuhfRx/+kkvUsKzrwx7Yw/UKl98Wxu34fX0xL6jHdKLm3oihZbQhxc9MufMk7W4 cLmPRs4SqVzNO3qJjMfP3RhX9/AdsbXTXDds99aABk3LfgHDOGxywGtzUrZYQQ2I Kg/y2N6gjSBRmxn7XRLQaRddY5RhBmOyGqP4YGLGEVX0Vde6p3BP1XhorJjYd598 pyp8mxZgcc8MW6gLPvZW3WCaew4Q66NoCUeM2K+Jff/R3a+mt7FEydRMq3q0MDgj gtV9oqasigHxL6WDqvJxs+Q1zA5/fHNA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=3lzDTAWnLDWS+/Xyz bd73bpMXnChuSJVYkDEbJqO7+I=; b=mbzn3lLVXIY43AkhIA0/2dCvEBl2HGPIj s59hZpx5IH6oMn09p/Zs3dKLp9w5U5kwgHfDwdyUPindtOwJwYWC3EXTTEL0Rdm3 nOHF32Ni6Zk+tQZ2PxFRNzAlW3QQSx6OXKGT1eevvfPPaIhw4UetdacDgTj4HEUG NEW+PWS8eLlCy4Fyq9HoxJpvqUwZaQWYE4KNt9VY6ZeToNTnTp0Lt6ZnTZ2IQ7q6 fNXdjbidWqic3/CctCCXZW/7nK1GSiE0FdVwBjepndDpRke5EN2Shx5EpvvsXIv3 nn8KbcO+F6gRbsqufxmVJMlSN8v+l3UPPNaULlnisRKVaKbtuzuVg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrleehgdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepvdegudeuhfdtueeltedtveejheeh ieevueeigeelteegleejleeiueeiheegvefhnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Feb 2022 00:39:20 -0500 (EST) Date: Sat, 26 Feb 2022 14:39:17 +0900 From: Michael Paquier To: Andres Freund Cc: Jacob Champion , "rjuju123@gmail.com" , "pgsql-hackers@postgresql.org" , "sfrost@snowman.net" Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers Message-ID: References: <793d990837ae5c06a558d58d62de9378ab525d83.camel@vmware.com> <2e28b12b450f247d5c0994207030c862263e0297.camel@vmware.com> <20220224171538.jbf2cxzmhiwuinp4@jrouhaud> <20220225212349.gf76klktl4dmm5ah@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zaOToioJReYXqTrz" Content-Disposition: inline In-Reply-To: <20220225212349.gf76klktl4dmm5ah@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --zaOToioJReYXqTrz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Feb 25, 2022 at 01:23:49PM -0800, Andres Freund wrote: > Looks to me like authn_id isn't synchronized to parallel workers right now. So > the function will return the wrong thing when executed as part of a parallel > query. FWIW, I am not completely sure what's the use case for being able to see the authn of the current session through a trigger. We expose that when log_connections is enabled, for audit purposes. I can also get behind something more central so as one can get a full picture of the authn used by a bunch of session, particularly with complex HBA policies, but this looks rather limited to me in usability. Perhaps that's not enough to stand as an objection, though, and the patch is dead simple. > I don't think we should add further functions not prefixed with pg_. Yep. > Perhaps a few tests for less trivial authn_ids could be worthwhile? > E.g. certificate DNs. Yes, src/test/ssl would handle that just fine. Now, this stuff already looks after authn results with log_connections=on, so that feels like a duplicate. -- Michael --zaOToioJReYXqTrz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmIZvQUACgkQnvQgOdby QH1YgxAAgEEur9ugmUNj6/7SvxA536PxHwb+D29ZH7LsCfI6c/oEITgShOSWxpjc 9zzbWnFEl7P6q4Q33N4hOZlGRkkXXEUwAUzb5TKgZ4wtuyVErvtazzKq6kEc5/uJ BrEyYeblkgTLVsGREwq9z8TIsl+U+ErmAUVzmiXQtvnvlyirdx57IXwgwJ5Hu6Z7 VrLKGoMk9fMDAJYXwLUTi9SAuHy5VNd6Tjjkb0X2Ly141V6LRIYd54XNVfXG+w6a Pf6uFvgL8iMvfrw6Z5ziKRXjXFzYe1T8M/i8beDSJG/Kn1H3IcqzXJWklFxDu1YJ KmAQxg6gKHWINbWBeK+8rAzXAjGwdZu31FfD7gNcDI1dJogIXAfNsEln2Qj+QtHw BB9sSHkvwVz5ytjX7KEir0kym7/Thfvyi4Y2kz8qI/BU7JHbNYwpPgPyUxnjv8vF 1+bzox9A58SwD/H42296hjxMGbxk06Lj+dPD28f6Sgbji+USmjcCnydyOiVIYDr6 q4jgdy4njkR8rVDlOfqQTcFps/XgGfAYTmNJPSHTTZr029vJ3xf4DKSSlwJ5nBPH 01QP5h6D+2WS8hcnI37nbc3rhrvdPx5cgx/SCbvMXoIa3PMVbY1tciQyKJntoFB8 3lGTkRAovm/mWeDQWEfm/4e306vpPm97YyhigUcqyzRKk7ARFZ4= =vjjr -----END PGP SIGNATURE----- --zaOToioJReYXqTrz--