Go to the source code of this file.
|
| DECLARE_GETTER (PQExpBuffer, errorMessage) |
|
| DECLARE_GETTER (char *, oauth_client_id) |
|
| DECLARE_GETTER (char *, oauth_client_secret) |
|
| DECLARE_GETTER (char *, oauth_discovery_uri) |
|
| DECLARE_GETTER (char *, oauth_issuer_id) |
|
| DECLARE_GETTER (char *, oauth_scope) |
|
| DECLARE_GETTER (fe_oauth_state *, sasl_state) |
|
| DECLARE_SETTER (pgsocket, altsock) |
|
| DECLARE_SETTER (char *, oauth_token) |
|
PGDLLEXPORT void | libpq_oauth_init (pgthreadlock_t threadlock, libpq_gettext_func gettext_impl, conn_errorMessage_func errmsg_impl, conn_oauth_client_id_func clientid_impl, conn_oauth_client_secret_func clientsecret_impl, conn_oauth_discovery_uri_func discoveryuri_impl, conn_oauth_issuer_id_func issuerid_impl, conn_oauth_scope_func scope_impl, conn_sasl_state_func saslstate_impl, set_conn_altsock_func setaltsock_impl, set_conn_oauth_token_func settoken_impl) |
|
void | libpq_append_conn_error (PGconn *conn, const char *fmt,...) pg_attribute_printf(2 |
|
void bool | oauth_unsafe_debugging_enabled (void) |
|
int | pq_block_sigpipe (sigset_t *osigset, bool *sigpipe_pending) |
|
void | pq_reset_sigpipe (sigset_t *osigset, bool sigpipe_pending, bool got_epipe) |
|
◆ DECLARE_GETTER
#define DECLARE_GETTER |
( |
|
TYPE, |
|
|
|
MEMBER |
|
) |
| |
Value: typedef TYPE (*conn_ ## MEMBER ## _func) (
PGconn *
conn); \
extern conn_ ## MEMBER ## _func conn_ ## MEMBER;
Definition at line 29 of file oauth-utils.h.
◆ DECLARE_SETTER
#define DECLARE_SETTER |
( |
|
TYPE, |
|
|
|
MEMBER |
|
) |
| |
Value: typedef void (*set_conn_ ## MEMBER ## _func) (
PGconn *
conn, TYPE
val); \
extern set_conn_ ## MEMBER ## _func set_conn_ ## MEMBER;
Definition at line 33 of file oauth-utils.h.
◆ libpq_gettext
#define libpq_gettext |
( |
|
x | ) |
(x) |
◆ pglock_thread
◆ pgunlock_thread
◆ libpq_gettext_func
typedef char *(* libpq_gettext_func) (const char *msgid) |
◆ PGTernaryBool
Enumerator |
---|
PG_BOOL_UNKNOWN | |
PG_BOOL_YES | |
PG_BOOL_NO | |
PG_BOOL_UNKNOWN | |
PG_BOOL_YES | |
PG_BOOL_NO | |
Definition at line 71 of file oauth-utils.h.
◆ DECLARE_GETTER() [1/7]
DECLARE_GETTER |
( |
char * |
, |
|
|
oauth_client_id |
|
|
) |
| |
◆ DECLARE_GETTER() [2/7]
DECLARE_GETTER |
( |
char * |
, |
|
|
oauth_client_secret |
|
|
) |
| |
◆ DECLARE_GETTER() [3/7]
DECLARE_GETTER |
( |
char * |
, |
|
|
oauth_discovery_uri |
|
|
) |
| |
◆ DECLARE_GETTER() [4/7]
DECLARE_GETTER |
( |
char * |
, |
|
|
oauth_issuer_id |
|
|
) |
| |
◆ DECLARE_GETTER() [5/7]
DECLARE_GETTER |
( |
char * |
, |
|
|
oauth_scope |
|
|
) |
| |
◆ DECLARE_GETTER() [6/7]
◆ DECLARE_GETTER() [7/7]
◆ DECLARE_SETTER() [1/2]
DECLARE_SETTER |
( |
char * |
, |
|
|
oauth_token |
|
|
) |
| |
◆ DECLARE_SETTER() [2/2]
◆ libpq_append_conn_error()
void libpq_append_conn_error |
( |
PGconn * |
conn, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
◆ libpq_oauth_init()
PGDLLEXPORT void libpq_oauth_init |
( |
pgthreadlock_t |
threadlock, |
|
|
libpq_gettext_func |
gettext_impl, |
|
|
conn_errorMessage_func |
errmsg_impl, |
|
|
conn_oauth_client_id_func |
clientid_impl, |
|
|
conn_oauth_client_secret_func |
clientsecret_impl, |
|
|
conn_oauth_discovery_uri_func |
discoveryuri_impl, |
|
|
conn_oauth_issuer_id_func |
issuerid_impl, |
|
|
conn_oauth_scope_func |
scope_impl, |
|
|
conn_sasl_state_func |
saslstate_impl, |
|
|
set_conn_altsock_func |
setaltsock_impl, |
|
|
set_conn_oauth_token_func |
settoken_impl |
|
) |
| |
Definition at line 65 of file oauth-utils.c.
76{
88}
set_conn_oauth_token_func set_conn_oauth_token
conn_oauth_client_secret_func conn_oauth_client_secret
conn_sasl_state_func conn_sasl_state
conn_oauth_client_id_func conn_oauth_client_id
conn_oauth_scope_func conn_oauth_scope
static libpq_gettext_func libpq_gettext_impl
pgthreadlock_t pg_g_threadlock
conn_oauth_issuer_id_func conn_oauth_issuer_id
set_conn_altsock_func set_conn_altsock
conn_oauth_discovery_uri_func conn_oauth_discovery_uri
conn_errorMessage_func conn_errorMessage
References conn_errorMessage, conn_oauth_client_id, conn_oauth_client_secret, conn_oauth_discovery_uri, conn_oauth_issuer_id, conn_oauth_scope, conn_sasl_state, libpq_gettext_impl, pg_g_threadlock, set_conn_altsock, and set_conn_oauth_token.
◆ oauth_unsafe_debugging_enabled()
void bool oauth_unsafe_debugging_enabled |
( |
void |
| ) |
|
Definition at line 149 of file oauth-utils.c.
150{
151 const char *env = getenv("PGOAUTHDEBUG");
152
153 return (env && strcmp(env, "UNSAFE") == 0);
154}
◆ pq_block_sigpipe()
int pq_block_sigpipe |
( |
sigset_t * |
osigset, |
|
|
bool * |
sigpipe_pending |
|
) |
| |
Definition at line 172 of file oauth-utils.c.
173{
174 sigset_t sigpipe_sigset;
175 sigset_t sigset;
176
177 sigemptyset(&sigpipe_sigset);
178 sigaddset(&sigpipe_sigset,
SIGPIPE);
179
180
181 SOCK_ERRNO_SET(pthread_sigmask(SIG_BLOCK, &sigpipe_sigset, osigset));
183 return -1;
184
185
186 if (sigismember(osigset,
SIGPIPE))
187 {
188
189 if (sigpending(&sigset) != 0)
190 return -1;
191
192 if (sigismember(&sigset,
SIGPIPE))
193 *sigpipe_pending = true;
194 else
195 *sigpipe_pending = false;
196 }
197 else
198 *sigpipe_pending = false;
199
200 return 0;
201}
#define SOCK_ERRNO_SET(e)
◆ pq_reset_sigpipe()
void pq_reset_sigpipe |
( |
sigset_t * |
osigset, |
|
|
bool |
sigpipe_pending, |
|
|
bool |
got_epipe |
|
) |
| |
Definition at line 208 of file oauth-utils.c.
209{
211 int signo;
212 sigset_t sigset;
213
214
215 if (got_epipe && !sigpipe_pending)
216 {
217 if (sigpending(&sigset) == 0 &&
219 {
220 sigset_t sigpipe_sigset;
221
222 sigemptyset(&sigpipe_sigset);
223 sigaddset(&sigpipe_sigset,
SIGPIPE);
224
225 sigwait(&sigpipe_sigset, &signo);
226 }
227 }
228
229
230 pthread_sigmask(SIG_SETMASK, osigset, NULL);
231
233}
◆ pg_g_threadlock