Files
coolify/tests/Unit/ApplicationDeploymentRemoteSecretValueTest.php
T
Andras Bacsai 91d4467322 feat(secrets): resolve integrations across deployments and databases
Add secret manager integration links and API support, resolve referenced credentials in database startup commands, and improve environment variable handling and filtering.
2026-08-23 21:33:00 +02:00

15 lines
770 B
PHP

<?php
use App\Jobs\ApplicationDeploymentJob;
it('quotes JSON remote secrets so compose treats their contents literally', function (string $value, string $expected) {
$job = (new ReflectionClass(ApplicationDeploymentJob::class))->newInstanceWithoutConstructor();
$method = new ReflectionMethod(ApplicationDeploymentJob::class, 'format_remote_secret_value');
expect($method->invoke($job, $value))->toBe($expected);
})->with([
'object containing a variable reference' => ['{"password":"$ecret"}', '\'{"password":"$ecret"}\''],
'array containing a comment marker' => ['["value # not a comment"]', '\'["value # not a comment"]\''],
'object containing an apostrophe' => ['{"password":"it\'s $ecret"}', '"{\\"password\\":\\"it\'s $$ecret\\"}"'],
]);