feat(ssh-keys): add ssh key endpoints and ui components

This commit is contained in:
Matthew Penner 2021-07-17 15:45:46 -06:00
parent 9d64c6751b
commit f9114e2de0
17 changed files with 375 additions and 7 deletions

View file

@ -0,0 +1,29 @@
<?php
namespace Pterodactyl\Transformers\Api\Client;
use Pterodactyl\Models\UserSSHKey;
class UserSSHKeyTransformer extends BaseClientTransformer
{
/**
* Return the resource name for the JSONAPI output.
*/
public function getResourceName(): string
{
return 'user_ssh_key';
}
/**
* Return basic information about the currently logged in user.
*/
public function transform(UserSSHKey $model): array
{
return [
'id' => $model->id,
'name' => $model->name,
'public_key' => $model->public_key,
'created_at' => $model->created_at->toIso8601String(),
];
}
}