Files
lean-api/meta/definitions/software.php
T
Dave Mc Nicoll 4b86ac9e82 - 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.
2026-10-22 15:03:18 +00:00

65 lines
2.3 KiB
PHP

<?php
use Ulmus\ConnectionAdapter;
use function DI\{ get, env };
define('LEAN_API_PROJECT_PATH', $path = dirname(__DIR__, 2));
return [
'lean.api' => [
'picea' => [
'context' => Lean\Api\View::class,
'view' => [
[
'path' => implode(DIRECTORY_SEPARATOR, [ $path , "view", '' ]),
'order' => 99,
],
],
'asset' => [
[
'path' => implode(DIRECTORY_SEPARATOR, [ $path, "asset", '' ]),
'order' => 10
],
],
],
'cli' => [
'Lean\\Api\\Cli' => implode(DIRECTORY_SEPARATOR, [ $path, "src", "Cli", "" ]),
],
'ulmus' => [
'entities' => [ 'Lean\\Api\\Entity' => implode(DIRECTORY_SEPARATOR, [ $path, 'src', 'Entity', '' ]) ],
'adapters' => [
DI\get('lean.api:storage'),
]
],
'tell' => [
'json' => [
[
'path' => implode(DIRECTORY_SEPARATOR, [ $path, "meta", "i18n", "" ]),
'order' => 99,
],
]
],
'routes' => [
'Lean\\Api\\Controller' => implode(DIRECTORY_SEPARATOR, [ $path, "src", "Controller", "" ]),
],
],
'app.middlewares' => \DI\add([
# Lean\Api\Middleware\Security\CORSMiddleware::class,
# Lean\Api\Middleware\Security\RequestLogMiddleware::class,
]),
Lean\ApplicationStrategy\NotFoundDecoratorInterface::class => DI\autowire(Lean\Api\ApplicationStrategy\NotFoundDecorator::class),
Lean\ApplicationStrategy\MethodNotAllowedInterface::class => DI\autowire(Lean\Api\ApplicationStrategy\MethodNotAllowedDecorator::class),
Lean\Api\Factory\MessageFactoryInterface::class => DI\autowire(Lean\Api\Lib\Message::class),
Lean\Api\Factory\LeanApiFormFactoryInterface::class => DI\autowire(Lean\Api\Factory\LeanApiFormFactory::class),
Lean\Api\Lib\RenderCORS::class => DI\create(Lean\Api\Lib\RenderCORS::class)->constructor(get(\Psr\Http\Message\ServerRequestInterface::class), env('LEAN_API_CORS_ORIGIN', '*')),
# League\Route\Strategy\ApplicationStrategy::class => DI\autowire(Lean\Api\ApplicationStrategy::class),
];