Add support for storing SSH keys on user accounts
This commit is contained in:
parent
5705d7dbdd
commit
97280a62a2
20 changed files with 678 additions and 6 deletions
26
app/Transformers/Api/Client/SSHKeyTransformer.php
Normal file
26
app/Transformers/Api/Client/SSHKeyTransformer.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Transformers\Api\Client;
|
||||
|
||||
use Pterodactyl\Models\UserSSHKey;
|
||||
|
||||
class SSHKeyTransformer 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(),
|
||||
];
|
||||
}
|
||||
}
|
Reference in a new issue