Re: encode/decode support for base64url

From: Florents Tselai <florents(dot)tselai(at)gmail(dot)com>
To: Cary Huang <cary(dot)huang(at)highgo(dot)ca>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Przemysław Sztoch <przemyslaw(at)sztoch(dot)pl>
Subject: Re: encode/decode support for base64url
Date: 2025-03-14 18:57:40
Message-ID: CA+v5N41A=xBRKTXz388Z1jXndE9isv+fHB2LCJ61g8S+rb2xhA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 11, 2025 at 10:08 AM Florents Tselai <florents(dot)tselai(at)gmail(dot)com>
wrote:

>
>
> On Tue, Mar 11, 2025 at 12:51 AM Cary Huang <cary(dot)huang(at)highgo(dot)ca> wrote:
>
>> > Oh well - you're probably right.
>> > I guess I was blinded by my convenience.
>> > Adding a 'base64url' option there is more appropriate.
>>
>> I agree with it too. It is neater to add "base64url" as a new option for
>> encode() and decode() SQL functions in encode.c.
>>
>
> Attaching a v2 with that.
>
>>
>> In addition, you may also want to add the C versions of base64rul encode
>> and decode functions to "src/common/base64.c" as new API calls so that
>> the frontend, backend applications and extensions can also have access
>> to these base64url conversions.
>>
>>
> We could expose this in base64.c - it'll need some more checking
> A few more test cases, especially around padding, are necessary.
> I'll come back to this.
>

Here's a v3 with some (hopefully) better test cases.

Attachment Content-Type Size
v3-base64url.patch application/octet-stream 8.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-03-14 19:05:30 Re: vacuumdb changes for stats import/export
Previous Message Greg Sabino Mullane 2025-03-14 18:49:54 Re: PATCH: warn about, and deprecate, clear text passwords