@@ -58,11 +58,30 @@ SELECT
5858FROM pg_proc p
5959JOIN schema_obj s ON s.oid = p.pronamespace
6060CROSS JOIN LATERAL aclexplode(p.proacl) AS acl
61- ORDER BY object_name, grantee, privilege_type;
61+ ORDER BY object_name, grantee, privilege_type;
6262 schema | object_name | grantee | privilege_type
6363-----------+-------------+----------------+----------------
6464 pgbouncer | get_auth | pgbouncer | EXECUTE
6565 pgbouncer | get_auth | postgres | EXECUTE
6666 pgbouncer | get_auth | supabase_admin | EXECUTE
6767(3 rows)
6868
69+ -- Ensure that pgbouncer.get_auth() function does not return an expired password
70+ create role test_expired_user_password with login password 'expired_password' valid until '2000-01-01 00:00:00+00';
71+ create role test_valid_user_password with login password 'valid_password' valid until '2100-01-01 00:00:00+00';
72+ -- Update the pg_authid catalog directly to replace with a known SCRAM hash
73+ update pg_authid set rolpassword = 'SCRAM-SHA-256$4096:testsaltbase64$storedkeybase64$serverkeybase64' where rolname = 'test_valid_user_password';
74+ select pgbouncer.get_auth('test_expired_user_password');
75+ get_auth
76+ -------------------------------
77+ (test_expired_user_password,)
78+ (1 row)
79+
80+ select pgbouncer.get_auth('test_valid_user_password');
81+ get_auth
82+ ----------------------------------------------------------------------------------------------
83+ (test_valid_user_password,SCRAM-SHA-256$4096:testsaltbase64$storedkeybase64$serverkeybase64)
84+ (1 row)
85+
86+ drop role test_expired_user_password;
87+ drop role test_valid_user_password;
0 commit comments