Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qEuVT-0000ZR-DO for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jun 2023 16:28:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qEuVS-0000FG-2V for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jun 2023 16:28:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qEuVR-0000F3-PM for pgsql-hackers@lists.postgresql.org; Thu, 29 Jun 2023 16:28:29 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qEuVO-0017y0-Lp for pgsql-hackers@postgresql.org; Thu, 29 Jun 2023 16:28:28 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1b80512a7f2so5895655ad.3 for ; Thu, 29 Jun 2023 09:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timescale.com; s=google; t=1688056105; x=1690648105; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=WkgEoBgzA5pIPqOCTebNAADbPLWh9lRd4iqj6QsjCIA=; b=Ve1/OUrgj5ICTFAbQ9QFafS64HMfNetU2FeUktoowD9UhmLNM006XZ7FA/urbzYefH WzWgEQuw2e3zLkKvx+WfVrBpJg0oziL6JAySdJWC63aIu+2YKK7GvHHjBFjVd7o321Kg cJSoWpQ774d3n7WEbZcBb8Trc+d3gQenecR+O4PBo7Ef2tELs4maBFCfzsf5U4rKi+TA cWd608hAE0a9BBS2ncc6XLfGQVWcpizy4ir+4hZPZYQN+yxCCLGm6fXf6M3O8FrLxbyY bf6q/CBFqgpXYbowMw4rId3D9BlHS+wAhDAHmuIrTmvElGtGDqs2DqvdtLubXIam5/mB EMDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688056105; x=1690648105; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WkgEoBgzA5pIPqOCTebNAADbPLWh9lRd4iqj6QsjCIA=; b=C9cA7I32U73BeQKhWgOGjQuWbEqoycOmF7V9OYTouOVXUHR8GbtEAI/GFGb5fdPUSz wy6BhygF5pjkgLevtATqEri6/ygaCZqfOZVrTZI8TAqQJzXTg4Qj7UJmia/YbT1H3PLu 8vn5FWKuwnxBpjOmklFNKw1jXNLlsgNw/16ulWjK7t1KefyVYO66ZXSGZfzBQeeJuJsh a236u7nZseW+n9vWjd5KXq9TpBBo2/prJDdx0g0PpogcdW0bP5wLoch28o1c+KZkVtI0 XTZDhtEV/byTif8RhKnwsk/WLc44xg2b7jZDYMpvPB+PKlMvgaXQ/6r47pTzjmHuakZ/ fhQg== X-Gm-Message-State: AC+VfDzgDl/lGhEiUG+F8jrq05jVsm8U/z+AFWbid+6rvfs13yj6u9D7 53O4A1uZkaPEgKLhmjLgummnRBbyIhNDo0qGYlEbnA== X-Google-Smtp-Source: ACHHUZ4t8Kdv/naLI2qUh3Jua4AwfFTyMHPB7tBBTLiarfcElK8lKrQlbsA+QfYq6aG3SZl2I/MeGQ== X-Received: by 2002:a17:903:2348:b0:1b7:ed6a:d8a5 with SMTP id c8-20020a170903234800b001b7ed6ad8a5mr14174776plh.61.1688056105572; Thu, 29 Jun 2023 09:28:25 -0700 (PDT) Received: from [192.168.1.21] ([50.53.8.205]) by smtp.gmail.com with ESMTPSA id u10-20020a17090282ca00b001b8062c1db3sm6783328plz.82.2023.06.29.09.28.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Jun 2023 09:28:25 -0700 (PDT) Message-ID: Date: Thu, 29 Jun 2023 09:28:24 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 From: Jacob Champion Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER To: "pgsql-hackers@postgresql.org" Cc: "hlinnaka@iki.fi" , "michael@paquier.xyz" , "smilingsamay@gmail.com" , Stephen Frost , mahendrakar s , Andrey Chudnovsky References: <2f06a4aef1d5defe4b7aaec01478572e5557d32a.camel@vmware.com> <8a5a35b31c3f25f6b047e77def0445a60399981d.camel@vmware.com> <0e86fe7e3534fb05db02379fed404a2010eb1d62.camel@vmware.com> <4db7d3ea061f47a15fc6d865f53dd327ea2975fb.camel@vmware.com> <863c9732-524e-af8f-0c79-700e2c171fa7@timescale.com> Content-Language: en-US In-Reply-To: <863c9732-524e-af8f-0c79-700e2c171fa7@timescale.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 5/19/23 15:01, Jacob Champion wrote: > But I don't want to > gold-plate it if this overall approach is unacceptable. So, questions > for the gallery: > > 1) Would starting up a background thread (pooled or not) be acceptable > on Windows? Alternatively, does anyone know enough Winsock deep magic to > combine multiple pending events into one (selectable!) socket? > > 2) If a background thread is acceptable on one platform, does it make > more sense to use one on every platform and just have synchronous code > everywhere? Or should we use a threadless async implementation when we can? > > 3) Is the current conn->async_auth() entry point sufficient for an > application to implement the Microsoft flows discussed upthread? > > 4) Would we want to try to require a new enough cURL/OpenSSL to avoid > thread safety problems during initialization, or do we need to introduce > some API equivalent to PQinitOpenSSL? > > 5) Does this maintenance tradeoff (full control over the client vs. a > large amount of RFC-governed code) seem like it could be okay? There was additional interest at PGCon, so I've registered this in the commitfest. Potential reviewers should be aware that the current implementation requires Linux (or, more specifically, epoll), as the cfbot shows. But if you have any opinions on the above questions, those will help me tackle the other platforms. :D Thanks! --Jacob