Skip to content

Commit

Permalink
talvez ultimo test
Browse files Browse the repository at this point in the history
  • Loading branch information
drylian committed Dec 7, 2023
1 parent 2949043 commit 81fc294
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +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;

Expand Down Expand Up @@ -110,15 +111,17 @@ public function testUserIsThrottledIfInvalidCredentialsAreProvided()
}
/**
* 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.
* if it doesn't actually exist in the database for the user.PrivateKey
*/
public function testUserIsNotThrottledIfNoPublicKeyMatches()
{
for ($i = 0; $i <= 10; ++$i) {
$privategenkey = EC::createKey('Ed25519');
$geratedkey = $privategenkey->getPublicKey()->toString('OpenSSH');
$this->postJson('/api/remote/sftp/auth', [
'type' => 'public_key',
'username' => $this->getUsername(),
'password' => EC::createKey('Ed25519')->getPublicKey()->toString('OpenSSH');,
'password' => ,
])
->assertForbidden();
}
Expand Down

0 comments on commit 81fc294

Please sign in to comment.