mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 06:13:45 +02:00
Final adjustments to Daemon <-> Panel communication change
This commit is contained in:
@@ -31,8 +31,6 @@ use Pterodactyl\Contracts\Repository\ServerRepositoryInterface as DatabaseServer
|
||||
|
||||
class ServerRepository extends BaseRepository implements ServerRepositoryInterface
|
||||
{
|
||||
const DAEMON_PERMISSIONS = ['s:*'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -73,9 +71,6 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||
],
|
||||
'rebuild' => false,
|
||||
'start_on_completion' => $start,
|
||||
'keys' => [
|
||||
(string) $server->daemonSecret => self::DAEMON_PERMISSIONS,
|
||||
],
|
||||
];
|
||||
|
||||
// Loop through overrides.
|
||||
@@ -88,22 +83,6 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setSubuserKey($key, array $permissions)
|
||||
{
|
||||
Assert::stringNotEmpty($key, 'First argument passed to setSubuserKey must be a non-empty string, received %s.');
|
||||
|
||||
return $this->getHttpClient()->request('PATCH', '/server', [
|
||||
'json' => [
|
||||
'keys' => [
|
||||
$key => $permissions,
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -169,4 +148,14 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||
{
|
||||
return $this->getHttpClient()->request('GET', '/servers');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function revokeAccessKey($key)
|
||||
{
|
||||
Assert::stringNotEmpty($key, 'First argument passed to revokeAccessKey must be a non-empty string, received %s.');
|
||||
|
||||
return $this->getHttpClient()->request('DELETE', '/keys/' . $key);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user