PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
magic_validator.c File Reference
#include "postgres.h"
#include "fmgr.h"
#include "libpq/oauth.h"
Include dependency graph for magic_validator.c:

Go to the source code of this file.

Functions

static bool validate_token (const ValidatorModuleState *state, const char *token, const char *role, ValidatorModuleResult *result)
 
const OAuthValidatorCallbacks_PG_oauth_validator_module_init (void)
 

Variables

 PG_MODULE_MAGIC
 
static const OAuthValidatorCallbacks validator_callbacks
 

Function Documentation

◆ _PG_oauth_validator_module_init()

const OAuthValidatorCallbacks * _PG_oauth_validator_module_init ( void  )

Definition at line 36 of file magic_validator.c.

37{
38 return &validator_callbacks;
39}
static const OAuthValidatorCallbacks validator_callbacks

References validator_callbacks.

◆ validate_token()

static bool validate_token ( const ValidatorModuleState state,
const char *  token,
const char *  role,
ValidatorModuleResult result 
)
static

Definition at line 42 of file magic_validator.c.

45{
46 elog(FATAL, "magic_validator: this should be unreachable");
48}
#define pg_unreachable()
Definition: c.h:332
#define FATAL
Definition: elog.h:41
#define elog(elevel,...)
Definition: elog.h:225

References elog, FATAL, and pg_unreachable.

Variable Documentation

◆ PG_MODULE_MAGIC

PG_MODULE_MAGIC

Definition at line 21 of file magic_validator.c.

◆ validator_callbacks

const OAuthValidatorCallbacks validator_callbacks
static
Initial value:
= {
0xdeadbeef,
.validate_cb = validate_token,
}
static bool validate_token(const ValidatorModuleState *state, const char *token, const char *role, ValidatorModuleResult *result)

Definition at line 29 of file magic_validator.c.

Referenced by _PG_oauth_validator_module_init().