Varios cambios Co-authored-by: Juan Pablo Vial <jpvialb@incoviba.cl> Reviewed-on: #25
55 lines
1.5 KiB
PHP
55 lines
1.5 KiB
PHP
<?php
|
|
use Psr\Container\ContainerInterface;
|
|
|
|
return [
|
|
'urls' => function(ContainerInterface $container) {
|
|
$urls = [
|
|
'base' => $container->get('APP_URL') ?? '',
|
|
];
|
|
$urls['api'] = implode('/', [
|
|
$urls['base'],
|
|
'api'
|
|
]);
|
|
$urls['assets'] = implode('/', [
|
|
$urls['base'],
|
|
'assets'
|
|
]);
|
|
$urls['images'] = implode('/', [
|
|
$urls['assets'],
|
|
'images'
|
|
]);
|
|
return (object) $urls;
|
|
},
|
|
'apiUrls' => function(ContainerInterface $container) {
|
|
$permittedPaths = [
|
|
'/api'
|
|
];
|
|
$simplePaths = [
|
|
'/api/login',
|
|
'/api/logout'
|
|
];
|
|
function addTrailingSlash(array &$paths): array {
|
|
foreach ($paths as $path) {
|
|
if (!in_array(rtrim($path, '/') . '/', $paths)) {
|
|
$paths[] = rtrim($path, '/') . '/';
|
|
}
|
|
}
|
|
return $paths;
|
|
}
|
|
addTrailingSlash($permittedPaths);
|
|
addTrailingSlash($simplePaths);
|
|
return [
|
|
'permittedPaths' => $permittedPaths,
|
|
'simplePaths' => $simplePaths,
|
|
'externalPaths' => [
|
|
'/api/external' => [
|
|
'/toku/success' => [
|
|
'validator' => $container->get(Incoviba\Service\Venta\MediosPago\Toku::class),
|
|
'token' => $container->get('TOKU_TOKEN'),
|
|
]
|
|
],
|
|
]
|
|
];
|
|
}
|
|
];
|