Re: Position of ClientAuthentication hook

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Position of ClientAuthentication hook
Date: 2021-06-14 19:04:37
Message-ID: CA+TgmoZKuQO6D4zbX8HZu2xco48aW5fRMB-gLYawf-edubAGKA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 14, 2021 at 8:51 AM Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com> wrote:
> I have a doubt regarding the positioning of clientAuthentication hook
> in function ClientAuthentication. Particularly, in case of hba errors,
> i.e. cases uaReject or uaImplicitReject it errors out, leading to no
> calls to any functions attached to the authentication hook. Can't we
> process the hook function first and then error out...?

Maybe. One potential problem is that if the hook errors out, the
original error would be lost and only the error thrown by the hook
would be logged or visible to the client. Whether or not that's a
problem depends, I suppose, on what you're trying to do with the hook.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2021-06-14 19:13:21 Re: BUG #17056: Segmentation fault on altering the type of the foreign table column with a default
Previous Message Bruce Momjian 2021-06-14 18:33:33 Re: PG 14 release notes, first draft