Re: Parametrization minimum password lenght

From: Tomas Vondra <tomas(at)vondra(dot)me>
To: Emanuele Musella <emamuse86(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Parametrization minimum password lenght
Date: 2024-11-12 13:48:28
Message-ID: 5702ea42-3599-4062-bd15-3e3c7cc67e6e@vondra.me
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 11/12/24 14:41, Emanuele Musella wrote:
> The goal about this patch is to parameterize the minimum password lenght
> on users database and apply it on the general code.
> The patch is applicable to the master branch.
> We already tested it: it build and works as expected and nothing is
> found broken,
>
> Settings in postgresql.conf parametrization like following:
>
> shared_preload_libraries = 'passwordcheck'
> min_password_lenght = 12
>
> example:
>
> postgres=# create user prova with password 'eftghaki';
> ERROR:  password is too short
> postgres=# create user prova with password 'eftghaki1234';
> CREATE ROLE
>
>
> In attach the file patch.
>

Thanks for the patch, seems like a useful feature. Please add the patch
to the next commitfest (2025-01) at https://commitfest.postgresql.org/

A couple comments:

1) The proper spelling is "length" (not "lenght").

2) The GUC should be added to the "passwordcheck" extension, not to the
core GUC file. See how auto_explain defines options in _PG_init() using
DefineCustomIntVariable.

3) It might be a good idea to add a test to passwordcheck.sql.

regards

--
Tomas Vondra

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2024-11-12 13:51:49 Re: Commit Timestamp and LSN Inversion issue
Previous Message Emanuele Musella 2024-11-12 13:41:00 Parametrization minimum password lenght