PostgreSQL Source Code
git master
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
c
d
g
h
i
k
l
m
p
r
s
t
Functions
Variables
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
c
d
f
h
i
n
o
p
r
s
t
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
fail_validator.c
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* fail_validator.c
4
* Test module for serverside OAuth token validation callbacks, which is
5
* guaranteed to always fail in the validation callback
6
*
7
* Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8
* Portions Copyright (c) 1994, Regents of the University of California
9
*
10
* src/test/modules/oauth_validator/fail_validator.c
11
*
12
*-------------------------------------------------------------------------
13
*/
14
15
#include "
postgres.h
"
16
17
#include "
fmgr.h
"
18
#include "
libpq/oauth.h
"
19
20
PG_MODULE_MAGIC
;
21
22
static
bool
fail_token
(
const
ValidatorModuleState
*
state
,
23
const
char
*
token
,
24
const
char
*role,
25
ValidatorModuleResult
*result);
26
27
/* Callback implementations (we only need the main one) */
28
static
const
OAuthValidatorCallbacks
validator_callbacks
= {
29
PG_OAUTH_VALIDATOR_MAGIC
,
30
31
.validate_cb =
fail_token
,
32
};
33
34
const
OAuthValidatorCallbacks
*
35
_PG_oauth_validator_module_init
(
void
)
36
{
37
return
&
validator_callbacks
;
38
}
39
40
static
bool
41
fail_token
(
const
ValidatorModuleState
*
state
,
42
const
char
*
token
,
const
char
*role,
43
ValidatorModuleResult
*res)
44
{
45
elog
(
FATAL
,
"fail_validator: sentinel error"
);
46
pg_unreachable
();
47
}
pg_unreachable
#define pg_unreachable()
Definition:
c.h:332
FATAL
#define FATAL
Definition:
elog.h:41
elog
#define elog(elevel,...)
Definition:
elog.h:225
_PG_oauth_validator_module_init
const OAuthValidatorCallbacks * _PG_oauth_validator_module_init(void)
Definition:
fail_validator.c:35
fail_token
static bool fail_token(const ValidatorModuleState *state, const char *token, const char *role, ValidatorModuleResult *result)
Definition:
fail_validator.c:41
PG_MODULE_MAGIC
PG_MODULE_MAGIC
Definition:
fail_validator.c:20
validator_callbacks
static const OAuthValidatorCallbacks validator_callbacks
Definition:
fail_validator.c:28
fmgr.h
oauth.h
PG_OAUTH_VALIDATOR_MAGIC
#define PG_OAUTH_VALIDATOR_MAGIC
Definition:
oauth.h:74
postgres.h
OAuthValidatorCallbacks
Definition:
oauth.h:77
ValidatorModuleResult
Definition:
oauth.h:35
ValidatorModuleState
Definition:
oauth.h:22
state
Definition:
regguts.h:323
token
Definition:
fe-auth-oauth-curl.c:142
src
test
modules
oauth_validator
fail_validator.c
Generated on Sun Mar 16 2025 00:13:26 for PostgreSQL Source Code by
1.9.4