Исправления безопасности и надёжности: установщик при сбое базы, права в API, нельзя выдать больше своего, пустой fillable, SSRF, очередь и расписание, роль при регистрации
This commit is contained in:
1 parent
6a550fef47
commit
ce446d071c
59 files changed
+1523
-114
No files matched your search
+7
-5
@@ -41,11 +41,13 @@ return static function (Router $router): void {
|
||||
$router->get('/me', [SystemController::class, 'me'])->name('api.me');
|
||||
$router->get('/metrics', [SystemController::class, 'metrics'])->name('api.metrics');
|
||||
|
||||
$router->get('/notes', [NotesController::class, 'index'])->name('api.notes.index');
|
||||
$router->post('/notes', [NotesController::class, 'store'])->name('api.notes.store');
|
||||
$router->get('/notes/{id:\d+}', [NotesController::class, 'show'])->name('api.notes.show');
|
||||
$router->patch('/notes/{id:\d+}', [NotesController::class, 'update'])->name('api.notes.update');
|
||||
$router->delete('/notes/{id:\d+}', [NotesController::class, 'delete'])->name('api.notes.delete');
|
||||
// Права те же, что у веба: ключ с --abilities=notes.view читает,
|
||||
// но не пишет. can: здесь проверяет владельца ключа, а не сессию
|
||||
$router->get('/notes', [NotesController::class, 'index'])->middleware('can:notes.view')->name('api.notes.index');
|
||||
$router->post('/notes', [NotesController::class, 'store'])->middleware('can:notes.manage')->name('api.notes.store');
|
||||
$router->get('/notes/{id:\d+}', [NotesController::class, 'show'])->middleware('can:notes.view')->name('api.notes.show');
|
||||
$router->patch('/notes/{id:\d+}', [NotesController::class, 'update'])->middleware('can:notes.manage')->name('api.notes.update');
|
||||
$router->delete('/notes/{id:\d+}', [NotesController::class, 'delete'])->middleware('can:notes.manage')->name('api.notes.delete');
|
||||
});
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user