feat: API에서 민감한 argument 지정

This commit is contained in:
Hide_D committed 2022-11-05 14:59:52 +09:00
1 parent 30d99c6fc3
commit e93d9e6cf5
3 files changed
+15

No files matched your search

+12
View File
@@ -10,6 +10,18 @@ abstract class BaseAPI
const REQ_GAME_LOGIN = 2;
const REQ_READ_ONLY = 4;
static array $sensitiveArgs = [];
public function getFilteredArgs(): array {
$filteredArgs = $this->args;
foreach (static::$sensitiveArgs as $argName) {
if (isset($filteredArgs[$argName])) {
$filteredArgs[$argName] = '***';
}
}
return $filteredArgs;
}
protected array $args;
protected string $rootPath;
public function __construct(string $rootPath, array $args)