PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
fe-auth-oauth.h File Reference
#include "fe-auth-sasl.h"
#include "libpq-fe.h"
Include dependency graph for fe-auth-oauth.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  fe_oauth_state
 

Enumerations

enum  fe_oauth_step { FE_OAUTH_INIT , FE_OAUTH_BEARER_SENT , FE_OAUTH_REQUESTING_TOKEN , FE_OAUTH_SERVER_ERROR }
 

Functions

void pqClearOAuthToken (PGconn *conn)
 
bool oauth_unsafe_debugging_enabled (void)
 
bool use_builtin_flow (PGconn *conn, fe_oauth_state *state)
 

Variables

const pg_fe_sasl_mech pg_oauth_mech
 

Enumeration Type Documentation

◆ fe_oauth_step

Enumerator
FE_OAUTH_INIT 
FE_OAUTH_BEARER_SENT 
FE_OAUTH_REQUESTING_TOKEN 
FE_OAUTH_SERVER_ERROR 

Definition at line 22 of file fe-auth-oauth.h.

23{
28};
@ FE_OAUTH_REQUESTING_TOKEN
Definition: fe-auth-oauth.h:26
@ FE_OAUTH_SERVER_ERROR
Definition: fe-auth-oauth.h:27
@ FE_OAUTH_INIT
Definition: fe-auth-oauth.h:24
@ FE_OAUTH_BEARER_SENT
Definition: fe-auth-oauth.h:25

Function Documentation

◆ oauth_unsafe_debugging_enabled()

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}

Referenced by issuer_from_well_known_uri(), and pg_fe_run_oauth_flow_impl().

◆ pqClearOAuthToken()

void pqClearOAuthToken ( PGconn conn)

Definition at line 1353 of file fe-auth-oauth.c.

1354{
1355 if (!conn->oauth_token)
1356 return;
1357
1360 conn->oauth_token = NULL;
1361}
#define free(a)
Definition: header.h:65
void explicit_bzero(void *buf, size_t len)
PGconn * conn
Definition: streamutil.c:52
char * oauth_token
Definition: libpq-int.h:443

References conn, explicit_bzero(), free, and pg_conn::oauth_token.

Referenced by pqClosePGconn(), and PQconnectPoll().

◆ use_builtin_flow()

bool use_builtin_flow ( PGconn conn,
fe_oauth_state state 
)

Definition at line 749 of file fe-auth-oauth.c.

750{
751 return false;
752}

Referenced by setup_token_request().

Variable Documentation

◆ pg_oauth_mech

const pg_fe_sasl_mech pg_oauth_mech
extern

Definition at line 40 of file fe-auth-oauth.c.

Referenced by pg_SASL_init(), pqConnectOptions2(), and PQconnectPoll().