public inbox for [email protected]  
help / color / mirror / Atom feed
From: Chao Li <[email protected]>
To: Postgres hackers <[email protected]>
Cc: Jacob Champion <[email protected]>
Subject: Fix OAuth validator docs for error_detail on internal errors
Date: Thu, 4 Jun 2026 20:33:39 +0800
Message-ID: <[email protected]> (raw)

Hi,

While testing “[d438a3659] oauth: Let validators provide failure DETAILs”, I noticed a tiny doc issue.

With this feature, when a validator returns false, result->error_detail can carry an error message. However, it seems that the previous paragraph was not updated:
```
   <para>
    A validator may return <literal>false</literal> to signal an internal error,
    in which case any result parameters are ignored and the connection fails.

```

“Any result parameters are ignored” is no longer accurate; it should be something like “any result parameters except result->error_detail are ignored”. This patch just makes that tiny doc fix.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/






Attachments:

  [application/octet-stream] v1-0001-doc-Clarify-OAuth-validator-error_detail-handling.patch (1.5K, 2-v1-0001-doc-Clarify-OAuth-validator-error_detail-handling.patch)
  download | inline diff:
From 7c70a33a07856df88071ac7991ced1e99fad0dea Mon Sep 17 00:00:00 2001
From: "Chao Li (Evan)" <[email protected]>
Date: Thu, 4 Jun 2026 19:23:59 +0800
Subject: [PATCH v1] doc: Clarify OAuth validator error_detail handling

ValidatorModuleResult.error_detail is still consulted when validate_cb
returns false to signal an internal error.  Do not describe all result
parameters as ignored in that case.

Author: Chao Li <[email protected]>
---
 doc/src/sgml/oauth-validators.sgml | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/oauth-validators.sgml b/doc/src/sgml/oauth-validators.sgml
index 8aad470a464..7015664f26c 100644
--- a/doc/src/sgml/oauth-validators.sgml
+++ b/doc/src/sgml/oauth-validators.sgml
@@ -399,9 +399,10 @@ typedef struct ValidatorModuleResult
    </para>
    <para>
     A validator may return <literal>false</literal> to signal an internal error,
-    in which case any result parameters are ignored and the connection fails.
-    Otherwise the validator should return <literal>true</literal> to indicate
-    that it has processed the token and made an authorization decision.
+    in which case the connection fails. Except for
+    <structfield>result->error_detail</structfield>, all result parameters are
+    ignored. Otherwise the validator should return <literal>true</literal> to
+    indicate that it has processed the token and made an authorization decision.
    </para>
    <para>
     In either failure case (validation error or internal error) the module may
-- 
2.50.1 (Apple Git-155)



view thread (7+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Fix OAuth validator docs for error_detail on internal errors
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox