Add test coverage for the SSH key endpoints

This commit is contained in:
DaneEveritt 2022-05-14 18:08:48 -04:00
parent 97280a62a2
commit 6554164252
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
7 changed files with 201 additions and 7 deletions

View file

@ -0,0 +1,26 @@
<?php
namespace Pterodactyl\Transformers\Api\Client;
use Pterodactyl\Models\UserSSHKey;
class UserSSHKeyTransformer extends BaseClientTransformer
{
public function getResourceName(): string
{
return UserSSHKey::RESOURCE_NAME;
}
/**
* Return's a user's SSH key in an API response format.
*/
public function transform(UserSSHKey $model): array
{
return [
'name' => $model->name,
'fingerprint' => $model->fingerprint,
'public_key' => $model->public_key,
'created_at' => $model->created_at->toIso8601String(),
];
}
}