Re: [PoC] Federated Authn/z with OAUTHBEARER
Jacob Champion <jacob.champion@enterprisedb.com>
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
meson: Fix install-quiet after clean
- a9ffb35274fb 18.0 landed
- 4ae03be54734 19 (unreleased) landed
-
oauth: Run Autoconf tests with correct compiler flags
- 3d23f68c5529 18.0 landed
- 990571a08b66 19 (unreleased) landed
-
Link libpq with libdl if the platform needs that.
- 4df477153a6b 19 (unreleased) landed
- 7bd752c1fb8e 18.0 landed
-
Doc: correct spelling of meson switch.
- 3faac9d14063 16.9 landed
- 766d2e673342 17.5 landed
- ac557793d478 18.0 landed
-
oauth: Correct SSL dependency for libpq-oauth.a
- 3db68212a393 18.0 landed
-
oauth: Fix Autoconf build on macOS
- 4ea1254f35b2 18.0 cited
-
oauth: Move the builtin flow into a separate module
- b0635bfda053 18.0 landed
-
Remove a stray "pgrminclude" annotation
- 764d501d24ba 18.0 cited
-
oauth: Simplify copy of PGoauthBearerRequest
- 1cf4c56480f8 18.0 landed
-
oauth: Improve validator docs on interruptibility
- 873c0fd67872 18.0 landed
-
oauth: Disallow synchronous DNS in libcurl
- d7e40845f923 18.0 landed
-
oauth: Fix postcondition for set_timer on macOS
- 434dbf6907ec 18.0 landed
-
oauth: Use IPv4-only issuer in oauth_validator tests
- 8d9d5843b55f 18.0 landed
-
Work around OAuth/EVFILT_TIMER quirk on NetBSD.
- c301a0a74a8a 18.0 landed
-
oauth: Fix incorrect const markers in struct
- 03366b61dfe5 18.0 landed
-
Add missing entry to oauth_validator test .gitignore
- 2c53dec7f440 18.0 landed
-
cirrus: Temporarily fix libcurl link error
- 9d9a71002a1c 18.0 landed
-
Add support for OAUTHBEARER SASL mechanism
- b3f0be788afc 18.0 landed
-
libpq: Handle asynchronous actions during SASL
- a99a32e43ed7 18.0 landed
-
require_auth: prepare for multiple SASL mechanisms
- f8d8581ed882 18.0 landed
-
Move PG_MAX_AUTH_TOKEN_LENGTH to libpq/auth.h
- e21d6f297158 18.0 landed
-
Make SASL max message length configurable
- 6d16f9debae0 18.0 landed
-
jsonapi: fully initialize dummy lexer
- 41b023946dfd 18.0 landed
-
common/jsonapi: support libpq as a client
- 0785d1b8b2fa 18.0 landed
-
Remove fe_memutils from libpgcommon_shlib
- f1976df5eaf2 18.0 landed
-
Revert ECPG's use of pnstrdup()
- f0096ef13be2 13.17 landed
- 3557185538fe 14.14 landed
- 2de129b356bf 15.9 landed
- ee2997c678d8 16.5 landed
- e9e05c655069 17.0 landed
- 5388216f6adc 18.0 landed
-
Explicitly require password for SCRAM exchange
- adcdb2c8dda4 17.0 landed
-
Refactor SASL exchange to return tri-state status
- 24178e235ea5 17.0 landed
On Fri, Feb 28, 2025 at 5:44 AM Thomas Munro <thomas.munro@gmail.com> wrote: > If you trigger the new optional NetBSD CI task, the oauthvalidator > tests implode[1]. Oh, thank you for reporting that. I need to pay more attention to the BSD CI thread. > Apparently that OS's kevent() doesn't like zero > relative timeouts for EVFILT_TIMER[2]. I see that you worked around > the same problem for Linux timerfd already by rounding 0 up to 1, so > we could just do the same here, and it passes with the attached. Just from inspection, that looks good to me. I'll look into running the new BSD tasks on the other patches I posted above, too. Should we maybe consider just doing that across the board, and put up with the inefficiency? Admittedly 1ms is a lot more dead time than 1ns... > A > cute alternative, not tested, might be to put NOTE_ABSTIME into fflag > if timeout == 0 (then it's an absolute time in the past, which should > fire immediately). That could work. I think I need to stare at the man pages more if we go that direction, since (IIUC) NOTE_ABSTIME changes up some other default behavior for the timer. > But I'm curious, how hard would it be to do this ↓ instead and not > have that problem on any OS? > > * There might be an optimization opportunity here: if timeout == 0, we > * could signal drive_request to immediately call > * curl_multi_socket_action, rather than returning all the way up the > * stack only to come right back. But it's not clear that the additional > * code complexity is worth it. I'm not sure if it's hard, so much as it is confusing. My first attempt at it a while back gave me the feeling that I wouldn't remember how it worked in a few months. Here are the things that I think we would have to consider, at minimum: 1. Every call to curl_multi_socket_action/all now has to look for the new "time out immediately" flag after returning. 2. If it is set, and if actx->running has been set to zero, we have to decide what that means conceptually. (Is that an impossible case? Or do we ignore the timeout and assume the request is done/failed?) 3. Otherwise, we need to clear the flag and immediately call curl_multi_socket_action(CURL_SOCKET_TIMEOUT), and repeat until that flag is no longer set. That feels brittle to me, because if there's some misunderstanding in our code or some strange corner case in an old version of Curl on some platform, and we keep getting a timeout of zero, we'll hit an infinite loop. (The current behavior instead returns control to the top level every time, and gives curl_multi_socket_all() a chance to right the ship by checking the status of all the outstanding sockets.) 4. Even if 2 and 3 are just FUD, there's another potential call to set_timer(0) in OAUTH_STEP_TOKEN_REQUEST. The interval can only be zero in debug mode, so if we add new code for that case alone, the tests will be mostly exercising a non-production code path. I prefer your patch, personally. Thanks! --Jacob