@@ -58,11 +58,30 @@ SELECT
58
58
FROM pg_proc p
59
59
JOIN schema_obj s ON s.oid = p.pronamespace
60
60
CROSS JOIN LATERAL aclexplode(p.proacl) AS acl
61
- ORDER BY object_name, grantee, privilege_type;
61
+ ORDER BY object_name, grantee, privilege_type;
62
62
schema | object_name | grantee | privilege_type
63
63
-----------+-------------+----------------+----------------
64
64
pgbouncer | get_auth | pgbouncer | EXECUTE
65
65
pgbouncer | get_auth | postgres | EXECUTE
66
66
pgbouncer | get_auth | supabase_admin | EXECUTE
67
67
(3 rows)
68
68
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