Re: [PATCH] Support older Pythons in oauth_server.py - Mailing list pgsql-hackers

From Jacob Champion
Subject Re: [PATCH] Support older Pythons in oauth_server.py
Date
Msg-id CAOYmi+nh3sWi5K=ZM=ymoOtPwrDRC+qHhc4--L0CRhnF-esMcQ@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Support older Pythons in oauth_server.py  (Jelte Fennema-Nio <postgres@jeltef.nl>)
List pgsql-hackers
On Tue, Apr 22, 2025 at 3:17 PM Jelte Fennema-Nio <postgres@jeltef.nl> wrote:
> The way you replaced this does not have the same behaviour in the case
> where the prefix/suffix is not part of the string. removeprefix/suffix
> will not remove any characters in that case, but your code will always
> remove the number of characters that the suffix/prefix is long. Maybe
> your other checks and definition of the OAuth spec ensure that these
> prefixes/suffixes are present when you remove them

Correct. Directly above the changed code are the prefix checks, which
set self._alt_issuer/_parameterized.

Thanks!
--Jacob



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: AIO v2.5
Next
From: Jacob Champion
Date:
Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER