Skip to content

Commit

Permalink
add security salt
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Apr 14, 2026
1 parent 8a49f90 commit 6efb22b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Cake\Database\Driver\Postgres;
use Cake\Datasource\ConnectionManager;
use Cake\TestSuite\ConnectionHelper;
use Cake\Utility\Security;
use Migrations\TestSuite\Migrator;

/**
Expand All @@ -34,6 +35,14 @@

require dirname(__DIR__) . '/config/bootstrap.php';

// Ensure Security salt is set for tests (needed by CSRF middleware, hashes, etc).
// In CI we inject it via env (COMANAGE_REGISTRY_SECURITY_SALT).
if (!Security::getSalt()) {
$salt = getenv('COMANAGE_REGISTRY_SECURITY_SALT') ?: 'phpunit-security-salt';
Security::setSalt($salt);
}


if (empty($_SERVER['HTTP_HOST']) && !Configure::read('App.fullBaseUrl')) {
Configure::write('App.fullBaseUrl', 'http://localhost');
}
Expand Down

0 comments on commit 6efb22b

Please sign in to comment.