mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +03:00
Add a client authentication hook.
KaiGai Kohei, with minor cleanup of the comments by me.
This commit is contained in:
@ -216,6 +216,12 @@ static int CheckRADIUSAuth(Port *port);
|
||||
*----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* This hook allows plugins to get control following client authentication,
|
||||
* but before the user has been informed about the results. It could be used
|
||||
* to record login events, insert a delay after failed authentication, etc.
|
||||
*/
|
||||
ClientAuthentication_hook_type ClientAuthentication_hook = NULL;
|
||||
|
||||
/*
|
||||
* Tell the user the authentication failed, but not (much about) why.
|
||||
@ -577,6 +583,9 @@ ClientAuthentication(Port *port)
|
||||
break;
|
||||
}
|
||||
|
||||
if (ClientAuthentication_hook)
|
||||
(*ClientAuthentication_hook)(port, status);
|
||||
|
||||
if (status == STATUS_OK)
|
||||
sendAuthRequest(port, AUTH_REQ_OK);
|
||||
else
|
||||
|
Reference in New Issue
Block a user