From 419a8dd8142afef790dafd91ba39afac2ca48aaf Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Wed, 15 Mar 2023 16:37:28 -0400 Subject: Add a hook for modifying the ldapbind password The hook can be installed by a shared_preload library. A similar mechanism could be used for radius paswords, for example, and the type name auth_password_hook_typ has been shosen with that in mind. John Naylor and Andrew Dunstan Discussion: https://postgr.es/m/469b06ed-69de-ba59-c13a-91d2372e52a9@dunslane.net --- src/include/libpq/auth.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/include') diff --git a/src/include/libpq/auth.h b/src/include/libpq/auth.h index 137bee7c45..9916c99df1 100644 --- a/src/include/libpq/auth.h +++ b/src/include/libpq/auth.h @@ -28,4 +28,10 @@ extern void sendAuthRequest(Port *port, AuthRequest areq, const char *extradata, typedef void (*ClientAuthentication_hook_type) (Port *, int); extern PGDLLIMPORT ClientAuthentication_hook_type ClientAuthentication_hook; +/* hook type for password manglers */ +typedef char *(*auth_password_hook_typ) (char *input); + +/* Default LDAP password mutator hook, can be overridden by a shared library */ +extern PGDLLIMPORT auth_password_hook_typ ldap_password_hook; + #endif /* AUTH_H */ -- cgit v1.2.3