Skip to content

Commit bc1fe95

Browse files
feat(blocklist as a service): Rename blass into bass
1 parent ead8b4e commit bc1fe95

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

CHANGELOG.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ As far as possible, we try to adhere to [Symfony guidelines](https://symfony.com
1111

1212
---
1313

14-
## [4.3.0](https://github.com/crowdsecurity/php-cs-bouncer/releases/tag/v4.3.0) - 2025-05-??
15-
[_Compare with previous release_](https://github.com/crowdsecurity/php-cs-bouncer/compare/v4.2.0...HEAD)
14+
## [4.3.0](https://github.com/crowdsecurity/php-cs-bouncer/releases/tag/v4.3.0) - 2025-04-30
15+
[_Compare with previous release_](https://github.com/crowdsecurity/php-cs-bouncer/compare/v4.2.0...v4.3.0)
1616

17-
__This release is not published yet__
1817

1918
### Added
2019

21-
- Add `hasBlaasUri` to detect if the bouncer is connected to a Block As A Service Lapi
22-
- Add `resetUsageMetrics` to reset the usage metrics cache item
20+
- Add `hasBaasUri` method to detect if the bouncer is connected to a Block As A Service Lapi
21+
- Add `resetUsageMetrics` method to reset the usage metrics cache item
2322

2423
---
2524

src/AbstractBouncer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ abstract public function getRequestUserAgent(): string;
228228
/**
229229
* Check if the bouncer is connected to a "Blocklist as a service" Lapi.
230230
*/
231-
public function hasBlaasUri(): bool
231+
public function hasBaasUri(): bool
232232
{
233233
$url = $this->getRemediationEngine()->getClient()->getConfig('api_url');
234234

235-
return 0 === strpos($url, Constants::BLAAS_URL);
235+
return 0 === strpos($url, Constants::BAAS_URL);
236236
}
237237

238238
/**

src/Constants.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
*/
1919
class Constants extends RemConstants
2020
{
21-
/** @var string The URL prefix for Blocklist as a service LAPI */
22-
public const BLAAS_URL = 'https://admin.api.crowdsec.net';
21+
/** @var string The URL prefix for Blocklist As A Service LAPI */
22+
public const BAAS_URL = 'https://admin.api.crowdsec.net';
2323
/** @var int The duration we keep a captcha flow in cache */
2424
public const CACHE_EXPIRATION_FOR_CAPTCHA = 86400;
2525
/** @var string The "MEMCACHED" cache system */
@@ -33,7 +33,7 @@ class Constants extends RemConstants
3333
/** @var string Path for html templates folder (e.g. ban and captcha wall) */
3434
public const TEMPLATES_DIR = __DIR__ . '/templates';
3535
/** @var string The last version of this library */
36-
public const VERSION = 'v4.2.0';
36+
public const VERSION = 'v4.3.0';
3737
/** @var string The "disabled" x-forwarded-for setting */
3838
public const X_FORWARDED_DISABLED = 'no_forward';
3939
}

tests/Unit/AbstractBouncerTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
* @uses \CrowdSecBouncer\AbstractBouncer::handleBounceExclusion
7878
*
7979
* @covers \CrowdSecBouncer\AbstractBouncer::pushUsageMetrics
80-
* @covers \CrowdSecBouncer\AbstractBouncer::hasBlaasUri
80+
* @covers \CrowdSecBouncer\AbstractBouncer::hasBaasUri
8181
*/
8282
final class AbstractBouncerTest extends TestCase
8383
{
@@ -783,7 +783,7 @@ public function testHasBlockAsAServiceUri()
783783
$lapiRemediation = new LapiRemediation($configs, $client, $cache);
784784
$bouncer = $this->getMockForAbstractClass(AbstractBouncer::class, [$configs, $lapiRemediation]);
785785

786-
$result = $bouncer->hasBlaasUri();
786+
$result = $bouncer->hasBaasUri();
787787
$this->assertEquals(false, $result);
788788

789789
$configs = array_merge($this->configs, [
@@ -795,7 +795,7 @@ public function testHasBlockAsAServiceUri()
795795
$lapiRemediation = new LapiRemediation($configs, $client, $cache);
796796
$bouncer = $this->getMockForAbstractClass(AbstractBouncer::class, [$configs, $lapiRemediation]);
797797

798-
$result = $bouncer->hasBlaasUri();
798+
$result = $bouncer->hasBaasUri();
799799
$this->assertEquals(true, $result);
800800
}
801801

0 commit comments

Comments
 (0)