Add support for generating a signed URL for downloading a file from the daemon

This commit is contained in:
Dane Everitt 2020-04-04 19:54:59 -07:00
parent 15b436d26e
commit be05d2df81
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
7 changed files with 230 additions and 17 deletions

View file

@ -3,6 +3,7 @@
namespace Pterodactyl\Http\Middleware\Api\Client;
use Closure;
use Pterodactyl\Models\Backup;
use Illuminate\Container\Container;
use Pterodactyl\Contracts\Extensions\HashidsInterface;
use Pterodactyl\Http\Middleware\Api\ApiSubstituteBindings;
@ -55,6 +56,10 @@ class SubstituteClientApiBindings extends ApiSubstituteBindings
}
});
$this->router->model('backup', Backup::class, function ($value) {
return Backup::query()->where('uuid', $value)->firstOrFail();
});
return parent::handle($request, $next);
}
}