diff --git a/CHANGELOG.md b/CHANGELOG.md index 4238c01..b5a7929 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,14 +5,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Public API +## SemVer public API -The purpose of this section is to declare the public API of this library as required by [item 1 of semantic versioning specification](https://semver.org/spec/v2.0.0.html#spec-item-1). - -The public API of this library consists of all public or protected methods, properties and constants belonging to the `src` folder. +The [public API](https://semver.org/spec/v2.0.0.html#spec-item-1) of this library consists of all public or protected methods, properties and constants belonging to the `src` folder. --- +## [3.0.0](https://github.com/crowdsecurity/php-lapi-client/releases/tag/v3.0.0) - 2023-03-09 +[_Compare with previous release_](https://github.com/crowdsecurity/php-lapi-client/compare/v2.0.0...v3.0.0) + +### Changed + + +- *Breaking change*: Use `crowdsec/common` `^2.0.0` dependency instead of `^1.2.0` +- *Breaking change*: If not null, the second param of `Bouncer` constructor must implement `RequestHandlerInterface` + + +--- ## [2.0.0](https://github.com/crowdsecurity/php-lapi-client/releases/tag/v2.0.0) - 2023-02-02 [_Compare with previous release_](https://github.com/crowdsecurity/php-lapi-client/compare/v1.0.1...v2.0.0) diff --git a/composer.json b/composer.json index e136cd6..6879462 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ }, "require": { "php": "^7.2.5 || ^8.0", - "crowdsec/common": "^1.2.0", + "crowdsec/common": "^2.0.0", "ext-json": "*", "symfony/config": "^4.4.44 || ^5.4.11 || ^6.0.11", "monolog/monolog": "^1.17 || ^2.1" diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.md index 93e6a55..2c37ed1 100644 --- a/docs/USER_GUIDE.md +++ b/docs/USER_GUIDE.md @@ -311,17 +311,17 @@ By default, the `Bouncer` object will do curl requests to call the LAPI. If for use curl then you can create your own request handler class and pass it as a second parameter of the `Bouncer` constructor. -Your custom request handler class must extend the `AbstractRequestHandler` class of the `crowdsec/common` dependency, -and you will have to explicitly write an `handle` method: +Your custom request handler class must implement the `RequestHandlerInterface` interface of the `crowdsec/common` +dependency, and you will have to explicitly write an `handle` method: ```php configure($configs); diff --git a/src/Constants.php b/src/Constants.php index 2c729f8..7dffc02 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -37,5 +37,5 @@ class Constants extends CommonConstants /** * @var string The current version of this library */ - public const VERSION = 'v2.0.0'; + public const VERSION = 'v3.0.0'; } diff --git a/tests/scripts/bouncer/decisions-filter.php b/tests/scripts/bouncer/decisions-filter.php index dc708c0..13f07a8 100644 --- a/tests/scripts/bouncer/decisions-filter.php +++ b/tests/scripts/bouncer/decisions-filter.php @@ -2,8 +2,8 @@ require_once __DIR__ . '/../../../vendor/autoload.php'; -use CrowdSec\LapiClient\Bouncer; use CrowdSec\Common\Logger\ConsoleLog; +use CrowdSec\LapiClient\Bouncer; $filter = isset($argv[1]) ? json_decode($argv[1], true) : []; $bouncerKey = $argv[2] ?? false; diff --git a/tests/scripts/bouncer/decisions-stream.php b/tests/scripts/bouncer/decisions-stream.php index 114ce4b..9460405 100644 --- a/tests/scripts/bouncer/decisions-stream.php +++ b/tests/scripts/bouncer/decisions-stream.php @@ -2,9 +2,9 @@ require_once __DIR__ . '/../../../vendor/autoload.php'; +use CrowdSec\Common\Logger\ConsoleLog; use CrowdSec\LapiClient\Bouncer; use CrowdSec\LapiClient\Constants; -use CrowdSec\Common\Logger\ConsoleLog; $startup = isset($argv[1]) ? (bool) $argv[1] : false; $filter = isset($argv[2]) ? json_decode($argv[2], true)