- 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.
49 lines
929 B
PHP
49 lines
929 B
PHP
<?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();
|
|
}
|
|
} |