Pop some tests for new middleware in there.

This commit is contained in:
Dane Everitt 2017-11-19 14:34:55 -06:00
parent 45a153427e
commit 49379bd115
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 245 additions and 10 deletions

View file

@ -7,7 +7,6 @@ use Illuminate\Http\Request;
use Illuminate\Auth\AuthManager;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
use Illuminate\Contracts\Config\Repository as ConfigRepository;
use Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
@ -18,11 +17,6 @@ class AuthenticateKey
*/
private $auth;
/**
* @var \Illuminate\Contracts\Config\Repository
*/
private $config;
/**
* @var \Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface
*/
@ -33,15 +27,12 @@ class AuthenticateKey
*
* @param \Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface $repository
* @param \Illuminate\Auth\AuthManager $auth
* @param \Illuminate\Contracts\Config\Repository $config
*/
public function __construct(
ApiKeyRepositoryInterface $repository,
AuthManager $auth,
ConfigRepository $config
AuthManager $auth
) {
$this->auth = $auth;
$this->config = $config;
$this->repository = $repository;
}
@ -53,6 +44,9 @@ class AuthenticateKey
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
* @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
*/
public function handle(Request $request, Closure $next)
{