pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jacob Champion <pchampion@vmware.com>
To: andres@anarazel.de <andres@anarazel.de>
Cc: sfrost@snowman.net <sfrost@snowman.net>
Cc: rjuju123@gmail.com <rjuju123@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: tgl@sss.pgh.pa.us <tgl@sss.pgh.pa.us>
Cc: michael@paquier.xyz <michael@paquier.xyz>
Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers
Date: Wed, 30 Mar 2022 16:02:09 +0000
Message-ID: <214737816b45c29d4aea01ba161f0a2d7876432e.camel@vmware.com> (raw)
In-Reply-To: <20220329235332.z4q5hgv7jsmcavzv@alap3.anarazel.de>
References: <60ce6b04f2e4049d04700730f1c439e325731dc4.camel@vmware.com>
	<2886824.1648076428@sss.pgh.pa.us>
	<8a480a78f24a10a83f58e1ce5d462b0a93412a99.camel@vmware.com>
	<20220323235436.2fx2d67s6gztlb2p@alap3.anarazel.de>
	<94c53220cb1e8a7a9c411fd14bfc64ff3b65d68d.camel@vmware.com>
	<Yj6wU9DZ7c6MHfTb@paquier.xyz>
	<20220326171550.ywohmkvngh4qc2fo@alap3.anarazel.de>
	<88926.1648317459@sss.pgh.pa.us>
	<20220326183637.eopabpewkhpjyx5k@alap3.anarazel.de>
	<1add3bbf7790214c5a240edbb09b2632e402efb5.camel@vmware.com>
	<20220329235332.z4q5hgv7jsmcavzv@alap3.anarazel.de>

On Tue, 2022-03-29 at 16:53 -0700, Andres Freund wrote:
> > We'd also need to guess whether the GUC system's serialization of NULL
> > as an empty string is likely to cause problems for any future auth
> > methods.
> 
> You can't represent a NULL in a postgres 'text' datum, independent of
> parallelism. So the current definition of pg_session_authn_id() already
> precludes that (and set_authn_id() and ...).  Honestly, I can't see a reason
> why we should ever allow authn_id to contain a NULL byte.

I don't mean a NULL byte, just a NULL pointer. This part of the
implementation doesn't distinguish between it and an empty string:

> /* NULL becomes empty string, see estimate_variable_size() */
> do_serialize(destptr, maxbytes, "%s",
>              *conf->variable ? *conf->variable : "");

Whether that's a problem in the future entirely depends on whether
there's some authentication method that considers the empty string a
sane and meaningful identity. We might reasonably decide that the
answer is "no", but I like being able to make that decision as opposed
to delegating it to an existing generic framework.

(That last point may be my core concern about making it a GUC: I'd like
us to have full control of how and where this particular piece of
information gets modified.)

Thanks,
--Jacob


view thread (89+ messages)  latest in thread

Message-ID: <214737816b45c29d4aea01ba161f0a2d7876432e.camel@vmware.com>
Permalink:  ../214737816b45c29d4aea01ba161f0a2d7876432e.camel@vmware.com/
Also on:    postgresql.org/message-id/214737816b45c29d4aea01ba161f0a2d7876432e.camel@vmware.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: pchampion@vmware.com, andres@anarazel.de, sfrost@snowman.net, rjuju123@gmail.com, tgl@sss.pgh.pa.us, michael@paquier.xyz
  Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers
  In-Reply-To: <214737816b45c29d4aea01ba161f0a2d7876432e.camel@vmware.com>
  References: <60ce6b04f2e4049d04700730f1c439e325731dc4.camel@vmware.com> <2886824.1648076428@sss.pgh.pa.us> <8a480a78f24a10a83f58e1ce5d462b0a93412a99.camel@vmware.com> <20220323235436.2fx2d67s6gztlb2p@alap3.anarazel.de> <94c53220cb1e8a7a9c411fd14bfc64ff3b65d68d.camel@vmware.com> <Yj6wU9DZ7c6MHfTb@paquier.xyz> <20220326171550.ywohmkvngh4qc2fo@alap3.anarazel.de> <88926.1648317459@sss.pgh.pa.us> <20220326183637.eopabpewkhpjyx5k@alap3.anarazel.de> <1add3bbf7790214c5a240edbb09b2632e402efb5.camel@vmware.com> <20220329235332.z4q5hgv7jsmcavzv@alap3.anarazel.de> <214737816b45c29d4aea01ba161f0a2d7876432e.camel@vmware.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox