[PATCH] pgweb: auth.py: make it possible to customize email address in error message

Поиск
Список
Период
Сортировка
Искать

[PATCH] pgweb: auth.py: make it possible to customize email address in error message

От:
Célestin Matte <celestin.matte@cmatte.me>
Дата:
Вложения:
auth.py contains an error message with an hardcoded @postgresql.org email address.
This patch makes it possible to change it using a variable in the settings.
I used ADMINS because it already exists in pgweb with the correct value (and pgarchives), but that can be discussed as it doesn't exist in pglister.

-- 
Célestin Matte

Re: [PATCH] pgweb: auth.py: make it possible to customize email address in error message

От:
Akshat Jaimini <destrex271@gmail.com>
Дата:
We actually have a new tool that tests all the functionalities in the website. So just wanted to run it through that before.

I'll run the tests against your gitlab mirror.



Regards,
Akshat Jaimini

On Wed, 20 Dec, 2023, 20:11 Célestin Matte, <celestin.matte@cmatte.me> wrote:
Hello,

Not sure what you're asking — I don't have access to the pgweb repo
Do you mean a pull request?
My local copy is on gitlab: https://gitlab.com/cmatte/pgweb/-/tree/auth_email?ref_type=heads

Regards,

On 20/12/2023 14:32, Akshat Jaimini wrote:
> Hi!
> It would be great if we could test this patch with the testing harness to confirm that nothing would break(although I am sure nothing would but there's no harm in testing).
>
> Is it possible to setup a develop/testing branch on the pgweb repo from where the harness can pull it?
>
> Regards,
> Akshat Jaimini
>
> On Tue, 19 Dec, 2023, 22:21 Célestin Matte, <celestin.matte@cmatte.me <mailto:celestin.matte@cmatte.me>> wrote:
>
>     auth.py contains an error message with an hardcoded @postgresql.org <http://postgresql.org> email address.
>     This patch makes it possible to change it using a variable in the settings.
>     I used ADMINS because it already exists in pgweb with the correct value (and pgarchives), but that can be discussed as it doesn't exist in pglister.
>
>     --
>     Célestin Matte
>

--
Célestin Matte

Re: [PATCH] pgweb: auth.py: make it possible to customize email address in error message

От:
Magnus Hagander <magnus@hagander.net>
Дата:
On Tue, Dec 19, 2023 at 5:51 PM Célestin Matte  wrote:
>
> auth.py contains an error message with an hardcoded @postgresql.org email address.
> This patch makes it possible to change it using a variable in the settings.
> I used ADMINS because it already exists in pgweb with the correct value (and pgarchives), but that can be discussed as it doesn't exist in pglister.

Maybe the correct choice is to actually add it to pglister?

That said, having a fallback is probably still a good idea since we
have loads of servers that run this auth.py plugin, but for the
pglister specific thing I think that would be a reasonable thing to
expect?

-- 
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/


Re: [PATCH] pgweb: auth.py: make it possible to customize email address in error message

От:
Célestin Matte <celestin.matte@cmatte.me>
Дата:
Вложения:
> Maybe the correct choice is to actually add it to pglister?

Alright, patched for pglister attached.
Also attached a patch for pgarchives, because while ADMINS is defined, there is no default value. (Note: this variable is only used for auth.py)

-- 
Célestin Matte

Re: [PATCH] pgweb: auth.py: make it possible to customize email address in error message

От:
Magnus Hagander <magnus@hagander.net>
Дата:


On Thu, 21 Dec 2023 at 18:39, Célestin Matte <celestin.matte@cmatte.me> wrote:
> Maybe the correct choice is to actually add it to pglister?

Alright, patched for pglister attached.
Also attached a patch for pgarchives, because while ADMINS is defined, there is no default value. (Note: this variable is only used for auth.py)

Once again sorry to be ridiculously late :)

Realizing that this auth.py code is shared along basically all postgresql.org properties, I think the conditional way is the right way to do it. I don't think we should prepopulate a  value of webmaster@postgresql.org into the ADMIN values in the configs -- but we should add an empty one. so I've pushed that change for now.

//Magnus

FAQ