From eff0ac03cb1e6b3fcec1cb35cc12dd83ee1323a4 Mon Sep 17 00:00:00 2001 From: kristuff Date: Thu, 14 May 2020 21:23:51 +0200 Subject: [PATCH] initial commit --- README.md | 2 ++ lib/ApiDefintion.php | 2 +- lib/ApiManager.php | 11 ++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5d1d989..2d55b09 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ see [kristuff/abuseipdb-cli](https://github.com/kristuff/abuseipdb-cli) for the CLI version +***under construction, for now, just check part is implemented*** + Requirements ------------ - PHP >= 7.1 diff --git a/lib/ApiDefintion.php b/lib/ApiDefintion.php index 2571182..ede640a 100644 --- a/lib/ApiDefintion.php +++ b/lib/ApiDefintion.php @@ -87,7 +87,7 @@ abstract class ApiDefintion 'hack' => ['15', 'Hacking', false], // Attempts at SQL injection. - 'sql' => ['16', 'SQL Injection'], true, + 'sql' => ['16', 'SQL Injection', true], // Email sender spoofing. 'spoof' => ['17', 'Spoofing', true], diff --git a/lib/ApiManager.php b/lib/ApiManager.php index b90c281..b3b2803 100644 --- a/lib/ApiManager.php +++ b/lib/ApiManager.php @@ -79,7 +79,9 @@ class ApiManager extends ApiDefintion return array( 'userId' => $this->aipdbUserId, 'apiKey' => $this->aipdbApiKey, - 'selfIps' => $this->selfIps, + + // TODO 'selfIps' => $this->selfIps, + // TODO default report cat ); } @@ -92,11 +94,14 @@ class ApiManager extends ApiDefintion * * @return \Kristuff\AbuseIPDB\ApiManager */ - public static function fromConfigstring(string $configPath) + public static function fromConfigFile(string $configPath) { //todo check file exist $config = self::loadJsonFile($configPath); - return new ApiManager($config->api_key, $config->user_id, $config->self_ips); + + // TODO $config->self_ips + // TODO other options + return new ApiManager($config->api_key, $config->user_id); } /**