Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tvbgE-006GdG-Cj for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Mar 2025 12:40:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tvbgD-006FA7-4u for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Mar 2025 12:40:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tvbgC-006F9w-BU for pgsql-hackers@lists.postgresql.org; Fri, 21 Mar 2025 12:40:52 +0000 Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tvbg9-000JdF-1r for pgsql-hackers@postgresql.org; Fri, 21 Mar 2025 12:40:51 +0000 Received: by mail-qt1-x831.google.com with SMTP id d75a77b69052e-4769f3e19a9so11762821cf.0 for ; Fri, 21 Mar 2025 05:40:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1742560848; x=1743165648; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=82Qo8NXobipO62Qs9jOV9CqYTxyV+zGltMzCh+SNaiI=; b=tR8PuhsleblB/wUHLRPfk0WbpqrdbMrjIxDMioJlt5R9YrF+nf31SGtjyIZYial2k9 mPYo21Sz8esWcP9y3C3Ey5xHW4hxpYfgN8DlKOWPkkhvIFKGP0WRTQqm7dUBfxzwmrHO eNTWuAWKdR4CZWuN7JDVD+fVWSWrgLevrj21BhKI9kNiBh+QLopmqf8mZppogxBkxd0N Qe0lWrx3Qu2ATi+LNFZxue8jxxG3h6X5cHOrqOI9hdjyWYQ7PqqrubG++smweZ7YG4YQ 9qemAM4FkLROxzF8E0EUhgDYanEHLLd2+vi7hGdw4Eb5hkpmMwnGJWi0N1OoXn/XpYwu 3CMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742560848; x=1743165648; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=82Qo8NXobipO62Qs9jOV9CqYTxyV+zGltMzCh+SNaiI=; b=cA2mmLvcrvthTOx0FzcRJkqPkKpJ8meTr/3+QCPmpX7jOZgHk4szO1FPd5O6fDGunf puh66QW1d8DNMS+9EmDgluNnz6cGh5kBrDrAlCXhfHUyoQx67VwftfS5ZABGMF2aPLoR U5f8L6DKcACiEvVPbVEs0Iwss6cW9H13UT3v5qe4XXbkVwBnG/12gR2nncfWJLcpgLf4 exNV76QJngz6mAX4VPu2q0SkpykR6M5qdkOxJ9WMDqFRt5svjOuJVkQ6htd2MTD/Teln Osj5SgWJ5QsX7DtuDaHNL93Y4LEhFYm64bXgwY3qgss5TtoaknRvXGO+AKzA4D022M59 pXkA== X-Forwarded-Encrypted: i=1; AJvYcCV+JfOmaA7j246aDsNM78VbaUXCXEECfeGkUG1FlgYuM4M9yTrl+bVhmutGhsQ0Awpuc/ibyCYp9BHnBJDx@postgresql.org X-Gm-Message-State: AOJu0Ywz8BQaqmLoEtzHaAiRGT9No6f5yrmJSYDI0pnalM8VmvYHmZlB R+fzz2Hxugxbk4ChHFZY4vhKngrZ+R7hgoukbqS8TCIuTBTG6hzSahSzawykjBQ= X-Gm-Gg: ASbGncun2CHB7lW9IVq2AihYVb2fE9HuZfWbELnWqzX1W43LWk8upma56Tk298fA6gn FgIMI6iKI89zY/C8mxrlYpNxtbC/nS2OXSlKQh0PC8CU3JuvBw4TLBdFMmwbGsMnkxF61sWzNUC TiADFD53a42twz9p9eVICiSX1opjarZOpVNzAik8REX7vGpGPI/C3orVbIprpQKXLTEY6x0uZaW MRLfkxN9mFYEKINgrcVe0bsCONgKohtlfD24sGX02SZYYZ71V4RldwC26E8ZYuD78eSSgrXCgVs 3iui6xQuxOPSaL/0C3QmEs7NuW52Gme9tg254X5jSUv22omAFB5xp3Q= X-Google-Smtp-Source: AGHT+IEeNeYsYFw2C4g0tUWC/a+VDV2IxQiOGhgfV38U3qm879CFTvSC7bKDiW7RndX2RZc6te0SSg== X-Received: by 2002:a05:622a:230f:b0:476:b764:e315 with SMTP id d75a77b69052e-4771de8b2d5mr47417071cf.52.1742560847940; Fri, 21 Mar 2025 05:40:47 -0700 (PDT) Received: from ?IPV6:2605:a601:a681:6b00::1cb? ([2605:a601:a681:6b00::1cb]) by smtp.googlemail.com with ESMTPSA id d75a77b69052e-4771d159a6esm11667631cf.12.2025.03.21.05.40.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Mar 2025 05:40:47 -0700 (PDT) Message-ID: Date: Fri, 21 Mar 2025 08:40:45 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER To: Andres Freund , Tom Lane Cc: Bruce Momjian , Jacob Champion , PostgreSQL Hackers , Daniel Gustafsson , Thomas Munro , Nazir Bilal Yavuz , Peter Eisentraut , Antonin Houska References: <636879.1742357835@sss.pgh.pa.us> <641687.1742360249@sss.pgh.pa.us> <1120967.1742504934@sss.pgh.pa.us> From: Andrew Dunstan Content-Language: en-US Autocrypt: addr=andrew@dunslane.net; keydata= xsBNBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2HbLF0izW5Ik5UjX2HBXBx4syI gY6b0ugohXrr274+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6Njy xjo3WfpD4lHMOR/Oc3/8mScEF84rF2jXbsFgelWnbPWAvXY+pD0dXOFRkagGmC/viwBDqq5b 5tk76kKmUbZxABEBAAHCwHwEGAEIACYCGwwWIQTkPlhGHfx8v0RpFaWZ+n/LWfw7gQUCZFlx 5wUJGVGAjgAKCRCZ+n/LWfw7gf+iB/4g8CPY5jihf5r/8EsoIGe2H+dpVmpPF8YGBzTIvCz/ fQoOq8AX/pE76QEuFnFZWfjw+wgBXgCVmkox2Eflkk6z4ND3pcwGZ6CfCxTQCDk/dij+2DQ4 6bmDCy/sBgcbz9mTpoLC11HLoPae6YN9nBNQRZDcEFEu54OaVOqlIdbA6m+POIBCXZdHOFc0 WoDTgxHRzC1jgQNidyd6tKqcsVJs0dzF0oKTmFFmUAqTdJO12LBuNA1rlqrR3EtpYk8B/wtS 5dIMD7Q8hwQpL+4C6GNpb6ZKnPkLi47pDOLhz2qBrqN+rqUEsT3YnExYpzj5yOBi+FlmV1Hw 49QYe1sn2ZPs In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-03-20 Th 7:26 PM, Andres Freund wrote: > Hi, > > On 2025-03-20 17:08:54 -0400, Tom Lane wrote: >> Bruce Momjian writes: >>> On Thu, Mar 20, 2025 at 01:33:26PM -0700, Jacob Champion wrote: >>>> So one question for the collective is -- putting Curl itself aside -- >>>> is having a basic-but-usable OAuth flow, out of the box, worth the >>>> costs of a generic HTTP client? >>> One observation is that security scanning tools are going to see the >>> curl dependency and look at any CSVs related to them and ask us, whether >>> they are using OAUTH or not. >> Yes. Also, none of this has addressed my complaint about the extent >> of the build and install dependencies. Yes, simply not selecting >> --with-libcurl removes the problem ... but most packagers are under >> very heavy pressure to enable all features of a package. > How about we provide the current libpq.so without linking to curl and also a > libpq-oauth.so that has curl support? If we do it right libpq-oauth.so would > itself link to libpq.so, making libpq-oauth.so a fairly small library. > > That way packagers can split libpq-oauth.so into a separate package, while > still just building once. > > That'd be a bit of work on the buildsystem side, but it seems doable. > That certainly seems worth exploring. >> From what's been said here, only a small minority of users are likely >> to have any interest in this feature. So my answer to "is it worth >> the cost" is no, and would be no even if I had a lower estimate of >> the costs. > I think this is likely going to be rather widely used, way more widely than > e.g. kerberos or ldap support in libpq. My understanding is that there's a > fair bit of pressure in lots of companies to centralize authentication towards > centralized systems, even for server applications. Indeed. There is still work to do on OAUTH2 but the demand you mention is just going to keep increasing. > > >> I don't have any problem with making a solution available to those >> users who want it --- but I really do NOT want this to be part of >> stock libpq nor done as part of the core Postgres build. I do not >> think that the costs of that have been fully accounted for, especially >> not the fact that almost all of those costs fall on people other than >> us. > I am on board with not having it as part of stock libpq, but I don't see what > we gain by not building it as part of postgres (if the dependencies are > available, of course). > +1. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com