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 1pSBwr-0002CO-FV for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Feb 2023 07:11:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pSBwq-0004Cz-Da for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Feb 2023 07:11:24 +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 1pSBwq-0004Cq-2p for pgsql-hackers@lists.postgresql.org; Wed, 15 Feb 2023 07:11:24 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pSBwn-0000x5-7e for pgsql-hackers@lists.postgresql.org; Wed, 15 Feb 2023 07:11:23 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 5A20F3200931; Wed, 15 Feb 2023 02:11:16 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 15 Feb 2023 02:11:17 -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; t=1676445075; x=1676531475; bh=rYKaHIIoOX w5ZvtC330Z0+l0c+QVMzSIWqWLIr14Faw=; b=f4RKA0sTx67j4iWLtbzTcSUnHV gixCer0pPb+0+ePiIY0wunCKndCZRB6KTtmKnMPApiy68ajySatQ9VZBuGtXvfM+ pfI0aWwO1U9Ot+jW73xXtQUTuf8MQiBut6v+/lQikFEv2Lry7BvbR4QS8N7vGsjL 5cOcBBBJjJVzu0p5nNbhSAEm/iNLhg+Q4WX1pu6F29AbnwpFPL5OJNfHG/Ai8CZj fL+3tybOV3HM1UCoDIeAM7p/8XvWYA+8GJoVCIv8YPkiSsE53W71hESaJOdD/+Wy Yvv8GLseEgof74wtsh1JwMAF99tCNqFBhYCndJzAJhn7zSjprKI8nQs+BSrA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id: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= fm1; t=1676445075; x=1676531475; bh=rYKaHIIoOXw5ZvtC330Z0+l0c+QV MzSIWqWLIr14Faw=; b=KrrAoBitK+1ta0GpFXaEgnCoVLLd3dDbBs5Y5tNJxDfE 9LRLjE6pSNtdvEzTzH8zYzRmxCBFkviEcDmYRiU7NV7qUDfUWJeYJRKAIOl1keh0 SLnK9ZSBozQhAli+COT4wRgFMzZbREZ+wPoOKDMWifUoVWMXMhHCdA90UELFPKTt 8AgXn9aChOFGt0E++MldXoIKfpFmNz1LeqrGatMLzXVANVvpubn+IziqKl2WxSLD 1AP/dHn6wRn0DYM+Pz0wx8QNkxWm0hZHFhIK+PAOKdVu90Cg89kCXP35w86w60g9 0dhGOuWR2MgL5EoAdbpM+ljVoKcq66yrCf0L4whmhQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeigedguddtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculddvfedmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreer tddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlse hprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeegffejvefgveduvdejtddv tdeijeehudeuledvudeftdfgfeejvdekveekiedvvdenucffohhmrghinhepphhoshhtgh hrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 15 Feb 2023 02:11:13 -0500 (EST) Date: Wed, 15 Feb 2023 16:11:08 +0900 From: Michael Paquier To: Jelte Fennema Cc: Pavel Luzanov , Jelte Fennema , "isaac.morland@gmail.com" , "pgsql-hackers@lists.postgresql.org" , Nathan Bossart , Andrew Dunstan Subject: Re: [EXTERNAL] Re: [PATCH] Support using "all" for the db user in pg_ident.conf Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="s9bzwfoXXqgLuDsI" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --s9bzwfoXXqgLuDsI Content-Type: multipart/mixed; boundary="0Lx/PKXfiRU35P3g" Content-Disposition: inline --0Lx/PKXfiRU35P3g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 13, 2023 at 03:13:04PM +0100, Jelte Fennema wrote: > On Mon, 13 Feb 2023 at 15:06, Pavel Luzanov wr= ote: >> Does it make sense to reflect changes to the PG-USERNAME field in the >> pg_ident.conf.sample file? >> >> The same relates to the regexp supportin the DATABASE and USER fieldsof >> the pg_hba.conf.sample file(8fea8683). Which comes down to blame me for both of them. > That definitely makes sense to me. When writing the patch I didn't > realise that there was also documentation in those files. >=20 > I think it also makes sense to include usage of (some of) the features > in the example files here: > https://www.postgresql.org/docs/devel/auth-username-maps.html Hmm, I am not sure that adding more examples in the sample files is worth the duplication with the docs. So, please find attached a patch to close the gap the sample files, for both things, with descriptions of all the field values they can use. What do you think? -- Michael --0Lx/PKXfiRU35P3g Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="sample-descriptions.patch" diff --git a/src/backend/libpq/pg_hba.conf.sample b/src/backend/libpq/pg_hba.conf.sample index 095e3b4cc0..fc448b5b7e 100644 --- a/src/backend/libpq/pg_hba.conf.sample +++ b/src/backend/libpq/pg_hba.conf.sample @@ -31,14 +31,15 @@ # - "hostnogssenc" is a TCP/IP socket that is not GSSAPI-encrypted # # DATABASE can be "all", "sameuser", "samerole", "replication", a -# database name, or a comma-separated list thereof. The "all" -# keyword does not match "replication". Access to replication -# must be enabled in a separate record (see example below). +# database name, a regular expression (if it starts with a slash (/)) +# or a comma-separated list thereof. The "all" keyword does not match +# "replication". Access to replication must be enabled in a separate +# record (see example below). # -# USER can be "all", a user name, a group name prefixed with "+", or a -# comma-separated list thereof. In both the DATABASE and USER fields -# you can also write a file name prefixed with "@" to include names -# from a separate file. +# USER can be "all", a user name, a group name prefixed with "+", a +# regular expression (if it starts with a slash (/)) or a comma-separated +# list thereof. In both the DATABASE and USER fields you can also write +# a file name prefixed with "@" to include names from a separate file. # # ADDRESS specifies the set of hosts the record matches. It can be a # host name, or it is made up of an IP address and a CIDR mask that is diff --git a/src/backend/libpq/pg_ident.conf.sample b/src/backend/libpq/pg_ident.conf.sample index 5d32684b28..f5225f26cd 100644 --- a/src/backend/libpq/pg_ident.conf.sample +++ b/src/backend/libpq/pg_ident.conf.sample @@ -29,6 +29,10 @@ # will be substituted for \1 (backslash-one) if present in # PG-USERNAME. # +# PG-USERNAME can be "all", a user name, a group name prefixed with "+", or +# a regular expression (if it starts with a slash (/)). If it is a regular +# expression, the substring matching with \1 has no effect. +# # Multiple maps may be specified in this file and used by pg_hba.conf. # # No map names are defined in the default configuration. If all --0Lx/PKXfiRU35P3g-- --s9bzwfoXXqgLuDsI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmPshYwACgkQnvQgOdby QH30VA/9Gpq+7LLVrHLJCrVvHo1FHM4Lx1gvFwImaETWqhiPb5P5hZ6xhHuRLgcx 7u4J8C3Tcf76wLeXn0jcMKiqRxdOBk9p1M3PGLTpebxDXbuvjg9n3becD7G8QWHO M7Q6eGBOzqn2ZQr5IknCfo7yOq1+25tVlNOJNLbzmcxD2mioAzLEFgaJ6kbJN6us Q2RycSp/9cK8cYNCmcbcgXngwVGanW6WSFgCD3lZ8rOiqWn4ZkTc+JhJh7uL1mXH zkJJnt/rfJGKV5GHvWLMzjUpCVkYbDHLVNzxGJlyBal0QI4s9sPnPq/6OCkDbPJ7 U6VMNv3BTHeQLQ7YYre6O+LKo99uWtZQjMNlROVKcH1y7732adsCtIztZmKAFu81 LPW1JcETM/S6+I3o0o77sVCoLZHcOx2Jc7gnZArxqfs5Au2nxIIP6rZuv3O0/pJh /8feKolKIKh7qlbW+uV1yi4/RVkGx3znibL511lg1aSDDwmvTmHwwpbTL7D1D0RT 8gOWhpqFdcXCxykK4V7DWh8dVa2YL5Vfmm0wEwwm9IDmRVCJkDWj6aKU9l3JN8eg 1P/UEiQGi45GTzC7gArgU1i+GPwUBEjdFSvDCqAlr6JT2VIB8HeEowsLVPLJq69v TewaHm8MH+kX/dqCSO+OSVSAZpipNVg6g3lY/2/mjyMVZBgB4T0= =Zfh+ -----END PGP SIGNATURE----- --s9bzwfoXXqgLuDsI--