2016-01-16 00:26:50 +00:00
|
|
|
<?php
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2016-01-16 00:26:50 +00:00
|
|
|
namespace Pterodactyl\Models;
|
|
|
|
|
2018-01-12 04:49:46 +00:00
|
|
|
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
2016-01-16 00:26:50 +00:00
|
|
|
|
2020-04-04 06:22:35 +00:00
|
|
|
class ApiKey extends Model
|
2016-01-16 00:26:50 +00:00
|
|
|
{
|
2018-01-14 18:11:04 +00:00
|
|
|
/**
|
|
|
|
* Different API keys that can exist on the system.
|
|
|
|
*/
|
2021-01-23 20:33:34 +00:00
|
|
|
public const TYPE_ACCOUNT = 1;
|
|
|
|
public const TYPE_APPLICATION = 2;
|
2016-01-16 00:26:50 +00:00
|
|
|
|
2017-04-02 04:11:52 +00:00
|
|
|
/**
|
|
|
|
* Cast values to correct type.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $casts = [
|
2020-03-28 23:06:36 +00:00
|
|
|
'allowed_ips' => 'array',
|
2018-01-12 04:49:46 +00:00
|
|
|
'user_id' => 'int',
|
|
|
|
'r_' . AdminAcl::RESOURCE_USERS => 'int',
|
|
|
|
'r_' . AdminAcl::RESOURCE_ALLOCATIONS => 'int',
|
2018-01-26 03:26:06 +00:00
|
|
|
'r_' . AdminAcl::RESOURCE_DATABASE_HOSTS => 'int',
|
|
|
|
'r_' . AdminAcl::RESOURCE_SERVER_DATABASES => 'int',
|
2018-01-12 04:49:46 +00:00
|
|
|
'r_' . AdminAcl::RESOURCE_EGGS => 'int',
|
|
|
|
'r_' . AdminAcl::RESOURCE_LOCATIONS => 'int',
|
|
|
|
'r_' . AdminAcl::RESOURCE_NESTS => 'int',
|
|
|
|
'r_' . AdminAcl::RESOURCE_NODES => 'int',
|
|
|
|
'r_' . AdminAcl::RESOURCE_SERVERS => 'int',
|
2020-12-28 19:47:08 +00:00
|
|
|
'r_' . AdminAcl::RESOURCE_ROLES => 'int',
|
2017-04-02 04:11:52 +00:00
|
|
|
];
|
2016-01-16 00:26:50 +00:00
|
|
|
}
|