Very basic working implementation of sanctum for API validation

This commit is contained in:
Dane Everitt 2021-07-27 21:23:11 -07:00
parent 4b32828423
commit d60e8a193b
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
23 changed files with 24212 additions and 88 deletions

View file

@ -84,11 +84,12 @@ abstract class BaseTransformer extends TransformerAbstract
*/
protected function authorize(string $resource): bool
{
if ($this->getKey()->key_type === ApiKey::TYPE_ACCOUNT && $this->isRootAdmin()) {
return true;
}
return AdminAcl::check($this->getKey(), $resource, AdminAcl::READ);
return true;
// if ($this->getKey()->key_type === ApiKey::TYPE_ACCOUNT && $this->isRootAdmin()) {
// return true;
// }
//
// return AdminAcl::check($this->getKey(), $resource, AdminAcl::READ);
}
/**
@ -104,7 +105,7 @@ abstract class BaseTransformer extends TransformerAbstract
{
/** @var \Pterodactyl\Transformers\Api\Application\BaseTransformer $transformer */
$transformer = Container::getInstance()->makeWith($abstract, $parameters);
$transformer->setKey($this->getKey());
// $transformer->setKey($this->getKey());
if (!$transformer instanceof self) {
throw new InvalidTransformerLevelException('Calls to ' . __METHOD__ . ' must return a transformer that is an instance of ' . __CLASS__);