feat: 외부 호출이 불가능한 API 타입 정의
This commit is contained in:
@@ -53,6 +53,9 @@ class APIHelper
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$obj = buildAPIExecutorClass($actionPath, $rootPath, $actionArgs);
|
$obj = buildAPIExecutorClass($actionPath, $rootPath, $actionArgs);
|
||||||
|
if(!$obj::$allowExternalAPI){
|
||||||
|
Json::dieWithReason('외부에서는 호출할 수 없습니다.');
|
||||||
|
}
|
||||||
$validateResult = $obj->validateArgs();
|
$validateResult = $obj->validateArgs();
|
||||||
if ($validateResult !== null) {
|
if ($validateResult !== null) {
|
||||||
$logDB->insert('api_log', [
|
$logDB->insert('api_log', [
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ abstract class BaseAPI
|
|||||||
const REQ_READ_ONLY = 4;
|
const REQ_READ_ONLY = 4;
|
||||||
|
|
||||||
static array $sensitiveArgs = [];
|
static array $sensitiveArgs = [];
|
||||||
|
static bool $allowExternalAPI = true;
|
||||||
|
|
||||||
public function getFilteredArgs(): array {
|
public function getFilteredArgs(): array {
|
||||||
$filteredArgs = $this->args;
|
$filteredArgs = $this->args;
|
||||||
|
|||||||
Reference in New Issue
Block a user