1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-27 15:00:11 +02:00

refactor(core): move Access API in the it is own endpoint folder

This commit is contained in:
Awilum
2020-05-24 20:05:12 +03:00
parent 171170f03d
commit a76d99b29c
3 changed files with 22 additions and 8 deletions

View File

@@ -128,6 +128,7 @@ include_once 'dependencies.php';
/**
* Include API ENDPOINTS
*/
include_once 'endpoints/access/access.php';
include_once 'endpoints/delivery/entries.php';
include_once 'endpoints/delivery/registry.php';
include_once 'endpoints/delivery/config.php';

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
/**
* Flextype (http://flextype.org)
* Founded by Sergey Romanenko and maintained by Flextype Community.
*/
namespace Flextype;
use Flextype\Component\Filesystem\Filesystem;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
/**
* Validate access token
*/
function validate_access_token($token) : bool
{
return Filesystem::has(PATH['project'] . '/tokens/access/' . $token . '/token.yaml');
}

View File

@@ -29,14 +29,6 @@ function validate_management_entries_token($token) : bool
return Filesystem::has(PATH['project'] . '/tokens/management/entries/' . $token . '/token.yaml');
}
/**
* Validate access token
*/
function validate_access_token($token) : bool
{
return Filesystem::has(PATH['project'] . '/tokens/access/' . $token . '/token.yaml');
}
/**
* Fetch entry(entries)
*