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 1tVbri-009ySj-MU for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jan 2025 19:37:19 +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 1tVbri-005PZ9-4a for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jan 2025 19:37:17 +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 1tVbrh-005PZ1-NI for pgsql-hackers@lists.postgresql.org; Wed, 08 Jan 2025 19:37:17 +0000 Received: from fhigh-a4-smtp.messagingengine.com ([103.168.172.155]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tVbre-000ZXp-3D for pgsql-hackers@postgresql.org; Wed, 08 Jan 2025 19:37:16 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 4B63211400BC; Wed, 8 Jan 2025 14:37:14 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Wed, 08 Jan 2025 14:37:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1736365034; x=1736451434; bh=Xe+X8g/s6yWsU9RSzKKlqjtT3La6yli/ UcAw3s739s0=; b=HiiMf4GjZAm0rLghjNuznJc/ga53G3Wp8J8k6PeGtoCM/Jg/ kZ0gN5NrJNcc2WlaA5I4BvoBL5kfK9ObYd5aqmZ8j843yU6Yzh057mw+q0rKhCzZ lUxtXSCJTzKmMGdGZjKmuoTWLjLtUxkwtqQT/Ky8O5i15C9QJqVwyOj8nex0WBZu 94ymsFTz3dfcnFwOQqmuwlAtIaG1R/4yceEjieoHzH3oM9/+EBUeVsBZXeRLk9ev JOln2NBNJZIe7Ywz/4zkhrxeq97vyH1KurK7VXynBdwX9X1ny1cYOiGLNfgPBrwr BogZ50pIUL8VqJ6chhIRU7UaQZNxl5RTfhmsSQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1736365034; x= 1736451434; bh=Xe+X8g/s6yWsU9RSzKKlqjtT3La6yli/UcAw3s739s0=; b=C Qmf4QmddLM6Bele0AlapyAqyGkIid9QBB2kPdbhcHFFg2GvP+3+3Pwb+iQTERVP+ TF6grzvdBl6jepMCAYEMBX9BeP2gZ25DHNAmJuqwFS0cBQNBJFbfxYkobVG6iw1K PX0QW3mW4qmAn2Wkkz6orspLYXzcNWgeK+e8eip+laArrayxUG4VRmAVMz3SaKxm qVAXgafTzBWW3DdBEvxwJ7HdzFNiojwXry/M3IkQkv+aNq2z7eLNcZbJxwiJukiT QD/Ct5G/b4jrgg4v6OKiqKTXQ99PjnSa7G21srqnnHH+/p6ukJ8+BvWGXfLKnACe RJS0dwksgv5EUDEpHKHiA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeggedguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddv jeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghish gvnhhtrhgruhhtrdhorhhgqeenucggtffrrghtthgvrhhnpeetffevleefledtvdejgedt feejgfelfeelvdfffeejudejveehiefggfejgffggeenucffohhmrghinhepphhoshhtgh hrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgpdhnsggprhgtphhtth hopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehjrggtohgsrdgthhgrmhhp ihhonhesvghnthgvrhhprhhishgvuggsrdgtohhmpdhrtghpthhtohepuggrnhhivghlse ihvghsqhhlrdhsvgdprhgtphhtthhopegrhhestgihsggvrhhtvggtrdgrthdprhgtphht thhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Jan 2025 14:37:12 -0500 (EST) Message-ID: Date: Wed, 8 Jan 2025 20:37:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER To: Jacob Champion Cc: Daniel Gustafsson , Antonin Houska , PostgreSQL Hackers References: <63648.1728384409@antos> <2453.1729230681@antos> <6bde5f56-9e7a-4148-b81c-eb6532cb3651@eisentraut.org> <9B417838-B872-453D-BBFB-99FA957EB723@yesql.se> Content-Language: en-US From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 07.01.25 23:24, Jacob Champion wrote: > On Thu, Jan 2, 2025 at 2:11 AM Peter Eisentraut wrote: >> There is a mix of using "URL" and "URI" throughout the patch. I tried >> to look up in the source material (RFCs) what the correct use would >> be, but even they are mixing it in nonobvious ways. Maybe this is >> just hopelessly confused, or maybe there is a system that I don't >> recognize. > > Ugh, yeah. I think my "system" was whether the RFC I read most > recently had used "URL" or "URI" more in the text. > > In an ideal world, I'd just switch to "URL" to avoid confusion. There > are some URNs in use as part of OAuth (e.g. > `urn:ietf:params:oauth:grant-type:device_code`) but I don't think I > refer to those as URIs anyway. And more esoteric forms of URI (data:) > are not allowed. > > However... there are some phrases, like "Well-Known URI", where that's > just the Name of the Thing. Similarly, when the wire protocol itself > uses "URI" (say, in JSON field names), I'd rather be consistent to > make searching easier. > > Is it enough to prefer "URL" in the user-facing documentation (at > least, when it doesn't conflict with other established naming > conventions), and accept both in the code? The above explanation makes sense to me. I don't know what you mean by "accept in the code". I would agree with "tolerate some inconsistency" in the code but not with, like, create alias names for all the interface names. > >> * src/interfaces/libpq/libpq-fe.h >> >> +#ifdef WIN32 >> +#include /* for SOCKET */ >> +#endif >> >> Including a system header like that seems a bit unpleasant. AFAICT, >> you only need it for this: >> >> + PostgresPollingStatusType (*async) (PGconn *conn, >> + struct _PGoauthBearerRequest >> *request, >> + SOCKTYPE * altsock); >> >> But that function could already get the altsock handle via >> conn->altsock. So maybe that is a way to avoid the whole socket type >> dance in this header. > > It'd also couple clients against libpq-int.h, so they'd have to > remember to recompile every release. I'm worried that'd cause a bunch > of ABI problems... Couldn't that function use PQsocket() to get at the actual socket from the PGconn handle? >> * src/test/modules/oauth_validator/fail_validator.c >> >> +{ >> + elog(FATAL, "fail_validator: sentinel error"); >> + pg_unreachable(); >> +} >> >> This pg_unreachable() is probably not necessary after elog(FATAL). > > Cirrus completes successfully with that, but MSVC starts complaining: > > warning C4715: 'fail_token': not all control paths return a value > > Is that expected? Ah yes, because MSVC doesn't support the noreturn attribute. (See .) So ok to leave as you had it for now.