Final touches to new key-rotation service

This commit is contained in:
Dane Everitt 2017-09-24 12:34:00 -05:00
parent 0f0c319ec0
commit 8e2b77dc1e
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
6 changed files with 154 additions and 18 deletions

View file

@ -30,6 +30,7 @@ use Illuminate\Contracts\Foundation\Application;
use Illuminate\Foundation\Testing\HttpException;
use League\Fractal\Serializer\JsonApiSerializer;
use Pterodactyl\Transformers\Daemon\ApiKeyTransformer;
use Pterodactyl\Services\DaemonKeys\DaemonKeyUpdateService;
use Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface;
class ValidateKeyController extends Controller
@ -77,7 +78,7 @@ class ValidateKeyController extends Controller
*/
public function index($token)
{
if (! starts_with($token, 'i_')) {
if (! starts_with($token, DaemonKeyUpdateService::INTERNAL_TOKEN_IDENTIFIER)) {
throw new HttpException(501);
}