dont test ssh at all, it wont work if openssl is not built

This commit is contained in:
Arthur Passos 2024-06-24 16:50:23 -03:00
parent 5bdd49f36c
commit 4d5676f455
2 changed files with 0 additions and 24 deletions

View File

@ -7,11 +7,7 @@ New password should work
Two new passwords were added, should both work
1
1
Authenticating with ssh key
1
Altering credentials and keeping only bcrypt_password
Asserting SSH does not work anymore
AUTHENTICATION_FAILED
Asserting bcrypt_password works
1
Adding new bcrypt_password

View File

@ -4,14 +4,6 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
ssh_key="-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACAc6mt3bktHHukGJM1IJKPVtFMe4u3d8T6LHha8J4WOGAAAAJApc2djKXNn
YwAAAAtzc2gtZWQyNTUxOQAAACAc6mt3bktHHukGJM1IJKPVtFMe4u3d8T6LHha8J4WOGA
AAAEAk15S5L7j85LvmAivo2J8lo44OR/tLILBO1Wb2//mFwBzqa3duS0ce6QYkzUgko9W0
Ux7i7d3xPoseFrwnhY4YAAAADWFydGh1ckBhcnRodXI=
-----END OPENSSH PRIVATE KEY-----"
function test_login_pwd
{
${CLICKHOUSE_CLIENT} --user $1 --password $2 --query "select 1"
@ -46,21 +38,9 @@ test_login_pwd ${user} '3'
test_login_pwd ${user} '4'
ssh_pub_key="AAAAC3NzaC1lZDI1NTE5AAAAIBzqa3duS0ce6QYkzUgko9W0Ux7i7d3xPoseFrwnhY4Y"
${CLICKHOUSE_CLIENT} --query "ALTER USER ${user} ADD IDENTIFIED WITH ssh_key BY KEY '${ssh_pub_key}' TYPE 'ssh-ed25519'"
echo ${ssh_key} > ssh_key
echo "Authenticating with ssh key"
${CLICKHOUSE_CLIENT} --user ${user} --ssh-key-file 'ssh_key' --ssh-key-passphrase "" --query "SELECT 1"
echo "Altering credentials and keeping only bcrypt_password"
${CLICKHOUSE_CLIENT} --query "ALTER USER ${user} IDENTIFIED WITH bcrypt_password BY '5'"
echo "Asserting SSH does not work anymore"
${CLICKHOUSE_CLIENT} --user ${user} --ssh-key-file 'ssh_key' --ssh-key-passphrase "" --query "SELECT 1" 2>&1 | grep -m1 -o 'AUTHENTICATION_FAILED'
echo "Asserting bcrypt_password works"
test_login_pwd ${user} '5'