Skip to content

Commit 03366b6

Browse files
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
1 parent bfe56cd commit 03366b6

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

doc/src/sgml/libpq.sgml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10318,21 +10318,21 @@ typedef struct _PGpromptOAuthDevice
1031810318
of <symbol>PGoauthBearerRequest</symbol>, which should be filled in
1031910319
by the implementation:
1032010320
<synopsis>
10321-
typedef struct _PGoauthBearerRequest
10321+
typedef struct PGoauthBearerRequest
1032210322
{
1032310323
/* Hook inputs (constant across all calls) */
10324-
const char *const openid_configuration; /* OIDC discovery URL */
10325-
const char *const scope; /* required scope(s), or NULL */
10324+
const char *openid_configuration; /* OIDC discovery URL */
10325+
const char *scope; /* required scope(s), or NULL */
1032610326

1032710327
/* Hook outputs */
1032810328

1032910329
/* Callback implementing a custom asynchronous OAuth flow. */
1033010330
PostgresPollingStatusType (*async) (PGconn *conn,
10331-
struct _PGoauthBearerRequest *request,
10331+
struct PGoauthBearerRequest *request,
1033210332
SOCKTYPE *altsock);
1033310333

1033410334
/* Callback to clean up custom allocations. */
10335-
void (*cleanup) (PGconn *conn, struct _PGoauthBearerRequest *request);
10335+
void (*cleanup) (PGconn *conn, struct PGoauthBearerRequest *request);
1033610336

1033710337
char *token; /* acquired Bearer token */
1033810338
void *user; /* hook-defined allocated data */

src/interfaces/libpq/libpq-fe.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -745,11 +745,11 @@ typedef struct _PGpromptOAuthDevice
745745
#define SOCKTYPE int
746746
#endif
747747

748-
typedef struct _PGoauthBearerRequest
748+
typedef struct PGoauthBearerRequest
749749
{
750750
/* Hook inputs (constant across all calls) */
751-
const char *const openid_configuration; /* OIDC discovery URI */
752-
const char *const scope; /* required scope(s), or NULL */
751+
const char *openid_configuration; /* OIDC discovery URI */
752+
const char *scope; /* required scope(s), or NULL */
753753

754754
/* Hook outputs */
755755

@@ -770,7 +770,7 @@ typedef struct _PGoauthBearerRequest
770770
* request->token must be set by the hook.
771771
*/
772772
PostgresPollingStatusType (*async) (PGconn *conn,
773-
struct _PGoauthBearerRequest *request,
773+
struct PGoauthBearerRequest *request,
774774
SOCKTYPE * altsock);
775775

776776
/*
@@ -780,7 +780,7 @@ typedef struct _PGoauthBearerRequest
780780
* This is technically optional, but highly recommended, because there is
781781
* no other indication as to when it is safe to free the token.
782782
*/
783-
void (*cleanup) (PGconn *conn, struct _PGoauthBearerRequest *request);
783+
void (*cleanup) (PGconn *conn, struct PGoauthBearerRequest *request);
784784

785785
/*
786786
* The hook should set this to the Bearer token contents for the

0 commit comments

Comments
 (0)