- Added a new CSRF token verification Middleware.
- Added a new ActionLog middleware to catch every modifying request and save the changes made and the user who did. - Added a new RequestLog to catch every request made whenever required.
This commit is contained in:
1 parent
9571c6a462
commit
4b86ac9e82
42 files changed
+1331
-148
No files matched your search
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Lean\Api\Form\Security;
|
||||
|
||||
use CSSLSJ\TransportScolaire\Api\{Entity};
|
||||
use Lean\Api\Attribute\ContextField;
|
||||
use Lean\Api\Lib\FormContext;
|
||||
|
||||
#[ContextField(description: "")]
|
||||
class RequestLogContext extends FormContext
|
||||
{
|
||||
#[ContextField]
|
||||
public ? int $user_id;
|
||||
|
||||
#[ContextField]
|
||||
public string $method;
|
||||
|
||||
#[ContextField]
|
||||
public string $endpoint;
|
||||
|
||||
#[ContextField]
|
||||
public string $ipv4;
|
||||
|
||||
#[ContextField]
|
||||
public string $ipv6;
|
||||
|
||||
#[ContextField]
|
||||
public array $request_headers;
|
||||
|
||||
#[ContextField]
|
||||
public array $request_body;
|
||||
|
||||
#[ContextField]
|
||||
public int $status_code;
|
||||
|
||||
#[ContextField]
|
||||
public array $response_headers;
|
||||
|
||||
#[ContextField]
|
||||
public string $response_body;
|
||||
|
||||
#[ContextField]
|
||||
public float $duration;
|
||||
|
||||
public function valid(? \Lean\Api\Entity\Security\ApiRequestLog $requestLog = null): bool
|
||||
{
|
||||
return parent::valid();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user