File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,12 @@ static int CheckRADIUSAuth(Port *port);
216
216
*----------------------------------------------------------------
217
217
*/
218
218
219
+ /*
220
+ * This hook allows plugins to get control following client authentication,
221
+ * but before the user has been informed about the results. It could be used
222
+ * to record login events, insert a delay after failed authentication, etc.
223
+ */
224
+ ClientAuthentication_hook_type ClientAuthentication_hook = NULL ;
219
225
220
226
/*
221
227
* Tell the user the authentication failed, but not (much about) why.
@@ -577,6 +583,9 @@ ClientAuthentication(Port *port)
577
583
break ;
578
584
}
579
585
586
+ if (ClientAuthentication_hook )
587
+ (* ClientAuthentication_hook )(port , status );
588
+
580
589
if (status == STATUS_OK )
581
590
sendAuthRequest (port , AUTH_REQ_OK );
582
591
else
Original file line number Diff line number Diff line change @@ -24,4 +24,8 @@ extern char *pg_krb_realm;
24
24
25
25
extern void ClientAuthentication (Port * port );
26
26
27
+ /* Hook for plugins to get control in ClientAuthentication() */
28
+ typedef void (* ClientAuthentication_hook_type )(Port * , int );
29
+ extern PGDLLIMPORT ClientAuthentication_hook_type ClientAuthentication_hook ;
30
+
27
31
#endif /* AUTH_H */
You can’t perform that action at this time.
0 commit comments