From 2949043e12f277f7fb9d41c0cba280a146953237 Mon Sep 17 00:00:00 2001 From: Drylian <109999325+drylian@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:39:40 -0300 Subject: [PATCH] test 5 --- .../Api/Remote/SftpAuthenticationControllerTest.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/Integration/Api/Remote/SftpAuthenticationControllerTest.php b/tests/Integration/Api/Remote/SftpAuthenticationControllerTest.php index 879b385a9..d1d319f9a 100644 --- a/tests/Integration/Api/Remote/SftpAuthenticationControllerTest.php +++ b/tests/Integration/Api/Remote/SftpAuthenticationControllerTest.php @@ -7,7 +7,7 @@ use Pterodactyl\Models\Server; use Pterodactyl\Models\Permission; use Pterodactyl\Models\UserSSHKey; -use phpseclib3\Crypt\EC\PrivateKey; +use phpseclib3\Crypt\EC; use Pterodactyl\Tests\Integration\IntegrationTestCase; class SftpAuthenticationControllerTest extends IntegrationTestCase @@ -108,11 +108,6 @@ public function testUserIsThrottledIfInvalidCredentialsAreProvided() ->assertStatus($i === 10 ? 429 : 403); } } - // test - private static function createKeys() - { - return PrivateKey::createKey('Ed25519')->getPublicKey()->toString('OpenSSH'); - } /** * Test that the user is not throttled so long as a valid public key is provided, even * if it doesn't actually exist in the database for the user. @@ -123,7 +118,7 @@ public function testUserIsNotThrottledIfNoPublicKeyMatches() $this->postJson('/api/remote/sftp/auth', [ 'type' => 'public_key', 'username' => $this->getUsername(), - 'password' => $this->createKeys(), + 'password' => EC::createKey('Ed25519')->getPublicKey()->toString('OpenSSH');, ]) ->assertForbidden(); }