0001-oauth-Fix-incorrect-const-markers-in-struct.patch
application/octet-stream
Filename: 0001-oauth-Fix-incorrect-const-markers-in-struct.patch
Type: application/octet-stream
Part: 1
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch 0001
Subject: oauth: Fix incorrect const markers in struct
| File | + | − |
|---|---|---|
| doc/src/sgml/libpq.sgml | 5 | 5 |
| src/interfaces/libpq/libpq-fe.h | 5 | 5 |
From 577e8918c67dc66c0ec1686f92c85eb63c045bcc Mon Sep 17 00:00:00 2001
From: Daniel Gustafsson <dgustafsson@postgresql.org>
Date: Mon, 24 Feb 2025 09:46:53 +0100
Subject: [PATCH 1/2] oauth: Fix incorrect const markers in struct
Two members in PGoauthBearerRequest were incorrectly marked as const.
While in there, align the name of the struct with the typedef as per
project style.
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/912516.1740329361@sss.pgh.pa.us
---
doc/src/sgml/libpq.sgml | 10 +++++-----
src/interfaces/libpq/libpq-fe.h | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index ddb3596df83..8fa0515c6a0 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -10318,21 +10318,21 @@ typedef struct _PGpromptOAuthDevice
of <symbol>PGoauthBearerRequest</symbol>, which should be filled in
by the implementation:
<synopsis>
-typedef struct _PGoauthBearerRequest
+typedef struct PGoauthBearerRequest
{
/* Hook inputs (constant across all calls) */
- const char *const openid_configuration; /* OIDC discovery URL */
- const char *const scope; /* required scope(s), or NULL */
+ const char *openid_configuration; /* OIDC discovery URL */
+ const char *scope; /* required scope(s), or NULL */
/* Hook outputs */
/* Callback implementing a custom asynchronous OAuth flow. */
PostgresPollingStatusType (*async) (PGconn *conn,
- struct _PGoauthBearerRequest *request,
+ struct PGoauthBearerRequest *request,
SOCKTYPE *altsock);
/* Callback to clean up custom allocations. */
- void (*cleanup) (PGconn *conn, struct _PGoauthBearerRequest *request);
+ void (*cleanup) (PGconn *conn, struct PGoauthBearerRequest *request);
char *token; /* acquired Bearer token */
void *user; /* hook-defined allocated data */
diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h
index b7399dee58e..34ddfdb1831 100644
--- a/src/interfaces/libpq/libpq-fe.h
+++ b/src/interfaces/libpq/libpq-fe.h
@@ -745,11 +745,11 @@ typedef struct _PGpromptOAuthDevice
#define SOCKTYPE int
#endif
-typedef struct _PGoauthBearerRequest
+typedef struct PGoauthBearerRequest
{
/* Hook inputs (constant across all calls) */
- const char *const openid_configuration; /* OIDC discovery URI */
- const char *const scope; /* required scope(s), or NULL */
+ const char *openid_configuration; /* OIDC discovery URI */
+ const char *scope; /* required scope(s), or NULL */
/* Hook outputs */
@@ -770,7 +770,7 @@ typedef struct _PGoauthBearerRequest
* request->token must be set by the hook.
*/
PostgresPollingStatusType (*async) (PGconn *conn,
- struct _PGoauthBearerRequest *request,
+ struct PGoauthBearerRequest *request,
SOCKTYPE * altsock);
/*
@@ -780,7 +780,7 @@ typedef struct _PGoauthBearerRequest
* This is technically optional, but highly recommended, because there is
* no other indication as to when it is safe to free the token.
*/
- void (*cleanup) (PGconn *conn, struct _PGoauthBearerRequest *request);
+ void (*cleanup) (PGconn *conn, struct PGoauthBearerRequest *request);
/*
* The hook should set this to the Bearer token contents for the
--
2.39.3 (Apple Git-146)