Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbf5a894

Browse files
Test SCRAM iteration changes with psql \password
A version of this test was included in the original patch for alteringSCRAM iteration count, but was omitted due to how interactive psql TAPsessions worked before being refactored.Discussion:https://postgr.es/m/20230130194350.zj5v467x4jgqt3d6@awork3.anarazel.deDiscussion:https://postgr.es/m/F72E7BC7-189F-4B17-BF47-9735EB72C364@yesql.se
1 parent664d757 commitbf5a894

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

‎src/test/authentication/t/001_password.pl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,32 @@ sub test_conn
101101
WHERE rolname = 'scram_role_iter'");
102102
is($res,'SCRAM-SHA-256$1024:','scram_iterations in server side ROLE');
103103

104+
# If we don't have IO::Pty, forget it, because IPC::Run depends on that
105+
# to support pty connections
106+
SKIP:
107+
{
108+
skip"IO::Pty required", 1unlesseval {require IO::Pty; };
109+
110+
# Alter the password on the created role using \password in psql to ensure
111+
# that clientside password changes use the scram_iterations value when
112+
# calculating SCRAM secrets.
113+
my$session =$node->interactive_psql('postgres');
114+
115+
$session->set_query_timer_restart();
116+
$session->query("SET password_encryption='scram-sha-256';");
117+
$session->query("SET scram_iterations=42;");
118+
$session->query_until(qr/Enter new password/,"\\password scram_role_iter\n");
119+
$session->query_until(qr/Enter it again/,"pass\n");
120+
$session->query_until(qr/postgres=#/,"pass\n");
121+
$session->quit;
122+
123+
$res =$node->safe_psql('postgres',
124+
"SELECT substr(rolpassword,1,17)
125+
FROM pg_authid
126+
WHERE rolname = 'scram_role_iter'");
127+
is($res,'SCRAM-SHA-256$42:','scram_iterations in psql \password command');
128+
}
129+
104130
# Create a database to test regular expression.
105131
$node->safe_psql('postgres',"CREATE database regex_testdb;");
106132

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp