Add controllers and packages for security keys
This commit is contained in:
parent
f8ec8b4d5a
commit
06f692e649
29 changed files with 2398 additions and 383 deletions
25
app/Transformers/Api/Client/SecurityKeyTransformer.php
Normal file
25
app/Transformers/Api/Client/SecurityKeyTransformer.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Transformers\Api\Client;
|
||||
|
||||
use Pterodactyl\Models\SecurityKey;
|
||||
|
||||
class SecurityKeyTransformer extends BaseClientTransformer
|
||||
{
|
||||
public function getResourceName(): string
|
||||
{
|
||||
return SecurityKey::RESOURCE_NAME;
|
||||
}
|
||||
|
||||
public function transform(SecurityKey $model): array
|
||||
{
|
||||
return [
|
||||
'uuid' => $model->uuid,
|
||||
'name' => $model->name,
|
||||
'type' => $model->type,
|
||||
'public_key_id' => base64_encode($model->public_key_id),
|
||||
'created_at' => self::formatTimestamp($model->created_at),
|
||||
'updated_at' => self::formatTimestamp($model->updated_at),
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue