pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Michael Paquier <michael@paquier.xyz>
To: Drouvot, Bertrand <bdrouvot@amazon.com>
Cc: Jacob Champion <jchampion@timescale.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: sfrost@snowman.net <sfrost@snowman.net>
Cc: rjuju123@gmail.com <rjuju123@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: andres@anarazel.de <andres@anarazel.de>
Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers
Date: Sat, 6 Aug 2022 10:59:26 -0400
Message-ID: <af85ae52-de60-6a98-d69e-7d410aee752d@joeconway.com> (raw)
In-Reply-To: <Yu4JhEvh1V0sGWXv@paquier.xyz>
References: <200677.1654265052@sss.pgh.pa.us>
	<CA+TgmoY22u4JUuPtA7BYs2M8o9zWJh7_dViwoqUBU7DS+_kCyA@mail.gmail.com>
	<CAAWbhmj340fKUMO-a=3BZKw4RfvWroz_V=E_9bowoxeAxFkCSQ@mail.gmail.com>
	<CA+Tgmoa2ed6X+qDKvs6NZ=h0hQ2OJjgnmoBF2LwRagE6R5qAAw@mail.gmail.com>
	<CAAWbhmhfzt+hYiTXi3f0V_E5E+E_mmzd_x+p9zjs_NvBpJ36pA@mail.gmail.com>
	<CA+TgmoZmRAkOgNzSqRxzJ=Kok_NYHZ57X2ZKRh=cfoCukp4f_Q@mail.gmail.com>
	<CAAWbhmjPu2VNS8MhwDp=+hu61EsJ3zf_rTRtyZ8Qw08eAhg_pA@mail.gmail.com>
	<f98e0b81-96cb-b0d8-c483-e99563cc44b4@amazon.com>
	<3b678314-054a-6119-b373-4574067f404e@timescale.com>
	<cc8aaffb-1008-eaf6-090e-2461cbe6e1cf@amazon.com>
	<Yu4JhEvh1V0sGWXv@paquier.xyz>

On 8/6/22 02:26, Michael Paquier wrote:
> On Fri, Aug 05, 2022 at 12:48:33PM +0200, Drouvot, Bertrand wrote:
>> On 8/2/22 11:57 PM, Jacob Champion wrote:
>>> Thoughts from prior reviewers? Is SYSTEM_USER the way to go?
> 
> Reading through the other thread, there is a clear parallel between
> both in concept to provide this information at SQL level, indeed.
> 
>> I did not look in detail to this thread, but if the goal is "only" to expose
>> authn_id (as the subject describes) then it seems to me that SYSTEM_USER [1]
>> is the way to go.
>> 
>> [1]: https://commitfest.postgresql.org/39/3703/
> 
> However, I am not sure if the suggestion of auth_method:authn as
> output generated by SYSTEM_USER would be correct according to the SQL
> specification, either.  The spec being not really talkative about the
> details of what an external module should be opens up for a lot of
> interpretation, something that both thread are dealing with.

As I pointed out here [ 
https://www.postgresql.org/message-id/28b4a9ef-5103-f117-99e1-99ae5a86a6e8%40joeconway.com 
] both the SQL Server and Oracle interpretations are similar to the one 
provided by Bertrand's patch:

SQL Server:
   "If the current user is logged in to SQL Server by
    using Windows Authentication, SYSTEM_USER returns the
    Windows login identification name in the form:
    DOMAIN\user_login_name. However, if the current user
    is logged in to SQL Server by using SQL Server
    Authentication, SYSTEM_USER returns the SQL Server
    login identification name"

Oracle:
   "SYSTEM_USER
    Returns the name of the current data store user as
    identified by the operating system."

I am not sure how else we should interpret SYSTEM_USER -- if it isn't 
port->authn_id what else would you propose it should be?

-- 
Joe Conway
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com





view thread (89+ messages)  latest in thread

Message-ID: <af85ae52-de60-6a98-d69e-7d410aee752d@joeconway.com>
Permalink:  ../af85ae52-de60-6a98-d69e-7d410aee752d@joeconway.com/
Also on:    postgresql.org/message-id/af85ae52-de60-6a98-d69e-7d410aee752d@joeconway.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: mail@joeconway.com, michael@paquier.xyz, bdrouvot@amazon.com, jchampion@timescale.com, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, sfrost@snowman.net, rjuju123@gmail.com, andres@anarazel.de
  Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers
  In-Reply-To: <af85ae52-de60-6a98-d69e-7d410aee752d@joeconway.com>
  References: <200677.1654265052@sss.pgh.pa.us> <CA+TgmoY22u4JUuPtA7BYs2M8o9zWJh7_dViwoqUBU7DS+_kCyA@mail.gmail.com> <CAAWbhmj340fKUMO-a=3BZKw4RfvWroz_V=E_9bowoxeAxFkCSQ@mail.gmail.com> <CA+Tgmoa2ed6X+qDKvs6NZ=h0hQ2OJjgnmoBF2LwRagE6R5qAAw@mail.gmail.com> <CAAWbhmhfzt+hYiTXi3f0V_E5E+E_mmzd_x+p9zjs_NvBpJ36pA@mail.gmail.com> <CA+TgmoZmRAkOgNzSqRxzJ=Kok_NYHZ57X2ZKRh=cfoCukp4f_Q@mail.gmail.com> <CAAWbhmjPu2VNS8MhwDp=+hu61EsJ3zf_rTRtyZ8Qw08eAhg_pA@mail.gmail.com> <f98e0b81-96cb-b0d8-c483-e99563cc44b4@amazon.com> <3b678314-054a-6119-b373-4574067f404e@timescale.com> <cc8aaffb-1008-eaf6-090e-2461cbe6e1cf@amazon.com> <Yu4JhEvh1V0sGWXv@paquier.xyz> <af85ae52-de60-6a98-d69e-7d410aee752d@joeconway.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