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 1og4Vg-0006F4-JP for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Oct 2022 13:32:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1og4Vf-0003yl-8j for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Oct 2022 13:32:27 +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 1og4Ve-0003yc-UL for pgsql-hackers@lists.postgresql.org; Wed, 05 Oct 2022 13:32:26 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1og4Vc-0005Iw-7n for pgsql-hackers@lists.postgresql.org; Wed, 05 Oct 2022 13:32:26 +0000 Received: by mail-wr1-x42e.google.com with SMTP id n12so6400738wrp.10 for ; Wed, 05 Oct 2022 06:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=9Sk9ApsGIVYSx7WZXF3ryBKsW6Vx0b6DdmQt/L+vpVo=; b=OcN305Q8v+xABMI705Jm/mlvOs8yBykGJWrMQT71/CNaZW6HoQ5/4ku6rE/KlqbRRv Yyh4EZyv9bdt+JrHtrcrX1tO10LZGNxHrh0HISmIy+QuYE6e7G14Wrlck1vyk8lYx7Ys FmKGLF7JpaUHh41bwiWy5VzITfXs3NWFTpbbMA2oh2Br7MxrNop1c0k7vAzJ7jM4JZN1 3pMg/JSe/sxrak5ABPfXwpK1HKeWmTKKNohfIaOLBsgt8rbrNwY7ATj+6kBtaBHfUUVZ 3CTyuKwtv/FIfwXo3HhN3rkEmf6L1Xgax7ihZLOW2ZZu72gntfoIZUr+A2o+VnP/pioN kTCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=9Sk9ApsGIVYSx7WZXF3ryBKsW6Vx0b6DdmQt/L+vpVo=; b=BiwNKPcZ7qJSCsXx/FY1I49TqTXBjRVlxe9xDkg+fodbkjGWQHkdFMzsa+XzqDywEP PaKi4k41QMP7CbcvszOoTiItpyzAaRyuXIRH5D9RRQyzgtNJCuQfUm/ANEoarhykIoE6 jJ2lM9pxEV9nYFqCOzQFfAFJNpceapzLcHwMhx5b1o9p6P2fO+zoCK+SyqaxHlkQ1/0l APLv+B1B5L664r8Z5Ps9/TTuaQ9pxk1tmq1r21iGfXKVHTXHJKo2//TroQU6gSTW0slO +aAmZwLqxkUrI3ghd1NcKWdvdfMbbgKRdi3c+1J00h4c8UJeuixOh2QAgCm6EOIjS5UY mUGA== X-Gm-Message-State: ACrzQf2LEbUZuOE4HFItoXa5F3DgWYf/F/52/n8BKUVqVnxFhfogn3DZ hionuWfHqeRHm5nM8LPUI7Sf8fOm7gMiGiQI X-Google-Smtp-Source: AMsMyM4zOF4Mm0dXNF2DxioPl3iE+q6mcH5pUztFFdiXqtzU0WEkdtA8AtizwhftjxQx9UkiBMcIbg== X-Received: by 2002:a05:6000:1c5:b0:22e:3c0b:5c8 with SMTP id t5-20020a05600001c500b0022e3c0b05c8mr9904487wrx.622.1664976742443; Wed, 05 Oct 2022 06:32:22 -0700 (PDT) Received: from [10.95.79.71] ([54.239.6.190]) by smtp.gmail.com with ESMTPSA id by15-20020a056000098f00b0022e653f5abbsm1083551wrb.69.2022.10.05.06.32.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Oct 2022 06:32:21 -0700 (PDT) Message-ID: Date: Wed, 5 Oct 2022 15:32:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: Patch proposal: make use of regular expressions for the username in pg_hba.conf Content-Language: en-US To: Michael Paquier Cc: Tom Lane , Jacob Champion , PostgreSQL Hackers References: <4177827.1662684400@sss.pgh.pa.us> <572017.1663646973@sss.pgh.pa.us> From: "Drouvot, Bertrand" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 10/5/22 9:24 AM, Michael Paquier wrote: > Something that stood out on a first review is the refactoring of > 001_password.pl that can be done independently of the main patch: Good idea, thanks for the proposal. > - test_role() -> test_conn() to be able to pass down a database name. > - reset_pg_hba() to control the host, db and user parts. The host > part does not really apply after moving the hosts checks to a more > secure location, so I guess that this had better be extended just for > the user and database, keeping host=local all the time. > I am planning to apply 0001 attached independently, 0001 looks good to me. > reducing the > footprint of 0002, which is your previous patch left untouched > (mostly!). Thanks! I'll look at it and the comments you just made up-thread. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com