2021-07-17 17:47:07 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Transformers\Api\Client;
|
|
|
|
|
2021-08-08 16:23:02 +00:00
|
|
|
use Pterodactyl\Models\HardwareSecurityKey;
|
2021-08-07 20:06:45 +00:00
|
|
|
use Pterodactyl\Transformers\Api\Transformer;
|
2021-07-17 17:47:07 +00:00
|
|
|
|
2021-08-07 20:06:45 +00:00
|
|
|
class WebauthnKeyTransformer extends Transformer
|
2021-07-17 17:47:07 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Return the resource name for the JSONAPI output.
|
|
|
|
*/
|
|
|
|
public function getResourceName(): string
|
|
|
|
{
|
2021-08-08 16:23:02 +00:00
|
|
|
return HardwareSecurityKey::RESOURCE_NAME;
|
2021-07-17 17:47:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return basic information about the currently logged in user.
|
|
|
|
*/
|
2021-08-08 16:23:02 +00:00
|
|
|
public function transform(HardwareSecurityKey $model): array
|
2021-07-17 17:47:07 +00:00
|
|
|
{
|
|
|
|
return [
|
|
|
|
'id' => $model->id,
|
|
|
|
'name' => $model->name,
|
2021-08-07 20:06:45 +00:00
|
|
|
'created_at' => self::formatTimestamp($model->created_at),
|
2021-07-17 17:47:07 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|