Files
pterodactyl-panel/app/Transformers/Api/Client/UserSSHKeyTransformer.php
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

31 lines
691 B
PHP

<?php
declare(strict_types=1);
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.
*
* @return ApiPayload
*/
public function transform(UserSSHKey $model): array
{
return [
'name' => $model->name,
'fingerprint' => $model->fingerprint,
'public_key' => $model->public_key,
'created_at' => $this->formatTimestamp($model->created_at),
];
}
}