Re: [PoC] Federated Authn/z with OAUTHBEARER - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: [PoC] Federated Authn/z with OAUTHBEARER
Date
Msg-id 2C38E99A-9DD9-4E19-894E-C0905505074C@yesql.se
Whole thread Raw
In response to Re: [PoC] Federated Authn/z with OAUTHBEARER  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
> On 4 Nov 2024, at 06:00, jian he <jian.universality@gmail.com> wrote:

> + if (cnt != 1)
> + {
> + /*
> + * Either the lexer screwed up or our assumption above isn't true, and
> + * either way a developer needs to take a look.
> + */
> + Assert(cnt == 1);
> + return 1; /* don't fall through in release builds */
> + }

> The above Assert looks very wrong to me.

I think the point is to fail hard in development builds to ensure whatever
caused the disconnect between the json lexer and sscanf parsing is looked at.
It should probably be changed to Assert(false); which is the common pattern for
erroring out like this.

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Clear padding in PgStat_HashKey keys
Next
From: Laurenz Albe
Date:
Subject: Re: proposal: schema variables