mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Add audit things.
This commit is contained in:
parent
5b8f67e992
commit
47147066d2
12
.ci/php-cs-fixer/composer.lock
generated
12
.ci/php-cs-fixer/composer.lock
generated
@ -226,16 +226,16 @@
|
||||
},
|
||||
{
|
||||
"name": "friendsofphp/php-cs-fixer",
|
||||
"version": "v3.43.0",
|
||||
"version": "v3.43.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||
"reference": "39b5632c39ca9deb4eb7e670ba96fcf5c3a72e3c"
|
||||
"reference": "91c0b47216aa43b09656b4d99aa9dade2f3ad8fc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/39b5632c39ca9deb4eb7e670ba96fcf5c3a72e3c",
|
||||
"reference": "39b5632c39ca9deb4eb7e670ba96fcf5c3a72e3c",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/91c0b47216aa43b09656b4d99aa9dade2f3ad8fc",
|
||||
"reference": "91c0b47216aa43b09656b4d99aa9dade2f3ad8fc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -304,7 +304,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.43.0"
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.43.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -312,7 +312,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2023-12-28T17:36:39+00:00"
|
||||
"time": "2023-12-29T09:42:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
|
@ -71,6 +71,7 @@ class AttemptController extends Controller
|
||||
throw new FireflyException('200040: Webhook and webhook message are no match');
|
||||
}
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User lists webhook attempts of webhook #%d and message #%d, but webhooks are DISABLED.', $webhook->id, $message->id));
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
Log::channel('audit')->info(sprintf('User lists webhook attempts of webhook #%d and message #%d.', $webhook->id, $message->id));
|
||||
@ -113,6 +114,7 @@ class AttemptController extends Controller
|
||||
}
|
||||
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User views single webhook attempt #%d of webhook #%d and message #%d, but webhooks are DISABLED', $attempt->id, $webhook->id, $message->id));
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
|
||||
|
@ -63,6 +63,7 @@ class DestroyController extends Controller
|
||||
public function destroy(Webhook $webhook): JsonResponse
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User tries to destroy webhook #%d. but webhooks are DISABLED.', $webhook->id));
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
|
||||
@ -91,6 +92,7 @@ class DestroyController extends Controller
|
||||
}
|
||||
|
||||
if (false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User tries to destroy webhook #%d, message #%d, attempt #%d, but webhooks are DISABLED.', $webhook->id, $message->id, $attempt->id));
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
|
||||
@ -112,14 +114,15 @@ class DestroyController extends Controller
|
||||
*/
|
||||
public function destroyMessage(Webhook $webhook, WebhookMessage $message): JsonResponse
|
||||
{
|
||||
Log::channel('audit')->info(sprintf('User destroys webhook #%d, message #%d.', $webhook->id, $message->id));
|
||||
if ($message->webhook_id !== $webhook->id) {
|
||||
throw new FireflyException('200040: Webhook and webhook message are no match');
|
||||
}
|
||||
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User tries to destroy webhook #%d, message #%d, but webhooks are DISABLED.', $webhook->id, $message->id));
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
Log::channel('audit')->info(sprintf('User destroys webhook #%d, message #%d.', $webhook->id, $message->id));
|
||||
|
||||
$this->repository->destroyMessage($message);
|
||||
app('preferences')->mark();
|
||||
|
@ -67,6 +67,7 @@ class MessageController extends Controller
|
||||
public function index(Webhook $webhook): JsonResponse
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User tries to view messages of webhook #%d, but webhooks are DISABLED.', $webhook->id));
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
Log::channel('audit')->info(sprintf('User views messages of webhook #%d.', $webhook->id));
|
||||
@ -105,6 +106,7 @@ class MessageController extends Controller
|
||||
throw new FireflyException('200040: Webhook and webhook message are no match');
|
||||
}
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User tries to view message #%d of webhook #%d, but webhooks are DISABLED.', $message->id, $webhook->id));
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,7 @@ class ShowController extends Controller
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info('User tries to view all webhooks, but webhooks are DISABLED.');
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
|
||||
@ -105,6 +106,7 @@ class ShowController extends Controller
|
||||
public function show(Webhook $webhook): JsonResponse
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User tries to view webhook #%d, but webhooks are DISABLED.', $webhook->id));
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
|
||||
@ -128,6 +130,7 @@ class ShowController extends Controller
|
||||
public function triggerTransaction(Webhook $webhook, TransactionGroup $group): JsonResponse
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User tries to trigger webhook #%d on transaction group #%d, but webhooks are DISABLED.', $webhook->id, $group->id));
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
|
||||
|
@ -59,11 +59,12 @@ class StoreController extends Controller
|
||||
*/
|
||||
public function store(CreateRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info('User tries to store new webhook, but webhooks are DISABLED.', $data);
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
|
||||
$data = $request->getData();
|
||||
$webhook = $this->repository->store($data);
|
||||
$manager = $this->getManager();
|
||||
|
||||
|
@ -58,6 +58,7 @@ class SubmitController extends Controller
|
||||
public function submit(Webhook $webhook): JsonResponse
|
||||
{
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User tries to submit webhook #%d, but webhooks are DISABLED.', $webhook->id));
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
|
||||
|
@ -59,11 +59,12 @@ class UpdateController extends Controller
|
||||
*/
|
||||
public function update(Webhook $webhook, UpdateRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User tries to update webhook #%d, but webhooks are DISABLED.', $webhook->id), $data);
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
|
||||
$data = $request->getData();
|
||||
$webhook = $this->repository->update($webhook, $data);
|
||||
$manager = $this->getManager();
|
||||
|
||||
|
@ -59,10 +59,11 @@ class CreateController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
Log::channel('audit')->info('User visits webhook create page.');
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info('User visits webhook create page, but webhooks are DISABLED.');
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
Log::channel('audit')->info('User visits webhook create page.');
|
||||
$previousUrl = $this->rememberPreviousUrl('webhooks.create.url');
|
||||
|
||||
return view('webhooks.create', compact('previousUrl'));
|
||||
|
@ -63,10 +63,11 @@ class DeleteController extends Controller
|
||||
*/
|
||||
public function index(Webhook $webhook)
|
||||
{
|
||||
Log::channel('audit')->info('User visits webhook delete page.');
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info('User visits webhook delete page, but webhooks are DISABLED.');
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
Log::channel('audit')->info('User visits webhook delete page.');
|
||||
$subTitle = (string)trans('firefly.delete_webhook', ['title' => $webhook->title]);
|
||||
$this->rememberPreviousUrl('webhooks.delete.url');
|
||||
|
||||
|
@ -62,10 +62,11 @@ class EditController extends Controller
|
||||
*/
|
||||
public function index(Webhook $webhook)
|
||||
{
|
||||
Log::channel('audit')->info('User visits webhook edit page.');
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info('User visits webhook edit page, but webhooks are DISABLED.');
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
Log::channel('audit')->info('User visits webhook edit page.');
|
||||
$subTitle = (string)trans('firefly.edit_webhook', ['title' => $webhook->title]);
|
||||
$this->rememberPreviousUrl('webhooks.edit.url');
|
||||
|
||||
|
@ -55,10 +55,11 @@ class IndexController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
Log::channel('audit')->info('User visits webhook index page.');
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info('User visits webhook index page, but webhooks are DISABLED.');
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
Log::channel('audit')->info('User visits webhook index page.');
|
||||
|
||||
return view('webhooks.index');
|
||||
}
|
||||
|
@ -62,10 +62,11 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function index(Webhook $webhook)
|
||||
{
|
||||
Log::channel('audit')->info(sprintf('User visits webhook #%d page.', $webhook->id));
|
||||
if(false === config('firefly.allow_webhooks')) {
|
||||
Log::channel('audit')->info(sprintf('User visits webhook #%d page, but webhooks are DISABLED.', $webhook->id));
|
||||
throw new NotFoundHttpException('Webhooks are not enabled.');
|
||||
}
|
||||
Log::channel('audit')->info(sprintf('User visits webhook #%d page.', $webhook->id));
|
||||
$subTitle = (string)trans('firefly.show_webhook', ['title' => $webhook->title]);
|
||||
|
||||
return view('webhooks.show', compact('webhook', 'subTitle'));
|
||||
|
Loading…
Reference in New Issue
Block a user