[PATCH] Expose port->authn_id to extensions and triggers

From: Jacob Champion <pchampion(at)vmware(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: [PATCH] Expose port->authn_id to extensions and triggers
Date: 2022-02-24 00:15:40
Message-ID: 793d990837ae5c06a558d58d62de9378ab525d83.camel@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

Stephen pointed out [1] that the authenticated identity that's stored
in MyProcPort can't be retrieved by extensions or triggers. Attached is
a patch that provides both a C API and a SQL function for retrieving
it.

GetAuthenticatedIdentityString() is a mouthful but I wanted to
differentiate it from the existing GetAuthenticatedUserId(); better
names welcome. It only exists as an accessor because I wasn't sure if
extensions outside of contrib were encouraged to rely on the internal
layout of struct Port. (If they can, then that call can go away
entirely.)

Thanks,
--Jacob

[1] https://www.postgresql.org/message-id/CAOuzzgpFpuroNRabEvB9kST_TSyS2jFicBNoXvW7G2pZFixyBw%40mail.gmail.com

Attachment Content-Type Size
0001-Add-APIs-to-retrieve-authn_id-from-C-and-SQL.patch text/x-patch 5.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joseph Koshakow 2022-02-24 00:42:12 Extract epoch from Interval weird behavior
Previous Message Peter Eisentraut 2022-02-23 23:21:36 Re: convert libpq uri-regress tests to tap test