Thread: [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

From
Célestin Matte
Date:
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
itdoesn't exist in pglister.
 

-- 
Célestin Matte
Attachment
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

On Tue, Dec 19, 2023 at 5:51 PM Célestin Matte <celestin.matte@cmatte.me> 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
asit 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/



> 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
isonly used for auth.py)
 

-- 
Célestin Matte

Attachment