Fix daemon key provider service
Handles missing keys if user is an admin or the server owner. Step in the right direction for #733 where all users have their own keys now. Still need to address admin status revocation in order to fully address that issue.
This commit is contained in:
parent
88562b5cd6
commit
b1f6058e31
8 changed files with 159 additions and 53 deletions
|
@ -24,6 +24,8 @@
|
|||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Pterodactyl\Models\DaemonKey;
|
||||
|
||||
interface DaemonKeyRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
|
@ -31,6 +33,15 @@ interface DaemonKeyRepositoryInterface extends RepositoryInterface
|
|||
*/
|
||||
const INTERNAL_KEY_IDENTIFIER = 'i_';
|
||||
|
||||
/**
|
||||
* Load the server and user relations onto a key model.
|
||||
*
|
||||
* @param \Pterodactyl\Models\DaemonKey $key
|
||||
* @param bool $refresh
|
||||
* @return \Pterodactyl\Models\DaemonKey
|
||||
*/
|
||||
public function loadServerAndUserRelations(DaemonKey $key, bool $refresh = false): DaemonKey;
|
||||
|
||||
/**
|
||||
* Gets the daemon keys associated with a specific server.
|
||||
*
|
||||
|
|
|
@ -33,7 +33,7 @@ interface SubuserRepositoryInterface extends RepositoryInterface
|
|||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function getWithPermissionsUsingUserAndServer($user, $server);
|
||||
public function getWithPermissionsUsingUserAndServer(int $user, int $server): Subuser;
|
||||
|
||||
/**
|
||||
* Find a subuser and return with server and permissions relationships.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue