feat: 외부 호출이 불가능한 API 타입 정의

This commit is contained in:
2023-03-09 02:17:41 +09:00
parent ebaf63d541
commit fdef4caa65
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -53,6 +53,9 @@ class APIHelper
try {
$obj = buildAPIExecutorClass($actionPath, $rootPath, $actionArgs);
if(!$obj::$allowExternalAPI){
Json::dieWithReason('외부에서는 호출할 수 없습니다.');
}
$validateResult = $obj->validateArgs();
if ($validateResult !== null) {
$logDB->insert('api_log', [
+1
View File
@@ -11,6 +11,7 @@ abstract class BaseAPI
const REQ_READ_ONLY = 4;
static array $sensitiveArgs = [];
static bool $allowExternalAPI = true;
public function getFilteredArgs(): array {
$filteredArgs = $this->args;