mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-12-06 17:52:16 +00:00
Return 404 for unused Filament import/export download routes
This commit is contained in:
committed by
Constantin Graf
parent
cc9d04ab5a
commit
eab05eb92e
@@ -122,3 +122,9 @@ Route::get('/organization-invitations/{invitation}', [OrganizationInvitationCont
|
||||
Route::get('/users/{user}/verify-email-change', [UserController::class, 'verifyEmailChange'])
|
||||
->middleware(['auth:web', 'signed:relative'])
|
||||
->name('users.verify-email-change');
|
||||
|
||||
// Filament's import/export download routes are not used, and the required tables do not exist.
|
||||
Route::prefix(config('filament.system_route_prefix', 'filament'))->group(function (): void {
|
||||
Route::get('/exports/{export}/download', fn () => abort(404));
|
||||
Route::get('/imports/{import}/failed-rows/download', fn () => abort(404));
|
||||
});
|
||||
|
||||
41
tests/Unit/Endpoint/Web/FilamentActionsEndpointTest.php
Normal file
41
tests/Unit/Endpoint/Web/FilamentActionsEndpointTest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Unit\Endpoint\Web;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class FilamentActionsEndpointTest extends EndpointTestAbstract
|
||||
{
|
||||
public function test_export_download_returns_not_found(): void
|
||||
{
|
||||
// Act
|
||||
$response = $this->get('/filament/exports/1/download');
|
||||
|
||||
// Assert
|
||||
$response->assertNotFound();
|
||||
}
|
||||
|
||||
public function test_import_failed_rows_download_returns_not_found(): void
|
||||
{
|
||||
// Act
|
||||
$response = $this->get('/filament/imports/1/failed-rows/download');
|
||||
|
||||
// Assert
|
||||
$response->assertNotFound();
|
||||
}
|
||||
|
||||
public function test_import_failed_rows_download_returns_not_found_for_logged_in_user(): void
|
||||
{
|
||||
// Arrange
|
||||
$user = User::factory()->withPersonalOrganization()->create();
|
||||
$this->actingAs($user);
|
||||
|
||||
// Act
|
||||
$response = $this->get('/filament/imports/1/failed-rows/download');
|
||||
|
||||
// Assert
|
||||
$response->assertNotFound();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user