Change how API keys are validated (#771)

This commit is contained in:
Dane Everitt 2017-12-03 14:29:14 -06:00 committed by GitHub
parent df7a857929
commit 285485d7b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 774 additions and 383 deletions

View file

@ -221,3 +221,22 @@ $factory->define(Pterodactyl\Models\DaemonKey::class, function (Faker\Generator
'expires_at' => \Carbon\Carbon::now()->addMinutes(10)->toDateTimeString(),
];
});
$factory->define(Pterodactyl\Models\APIKey::class, function (Faker\Generator $faker) {
return [
'id' => $faker->unique()->randomNumber(),
'user_id' => $faker->randomNumber(),
'token' => str_random(Pterodactyl\Models\APIKey::KEY_LENGTH),
'memo' => 'Test Function Key',
'created_at' => \Carbon\Carbon::now()->toDateTimeString(),
'updated_at' => \Carbon\Carbon::now()->toDateTimeString(),
];
});
$factory->define(Pterodactyl\Models\APIPermission::class, function (Faker\Generator $faker) {
return [
'id' => $faker->unique()->randomNumber(),
'key_id' => $faker->randomNumber(),
'permission' => mb_strtolower($faker->word),
];
});