feat: support default login url expiry

This commit is contained in:
Marek Miklewicz
2026-06-30 20:21:53 +02:00
parent e2814fd81c
commit 4a1c9d0db4
7 changed files with 35 additions and 11 deletions
+14
View File
@@ -51,6 +51,20 @@ test('remote login url client builds helper ssh command when mode is helper', fu
assert_same('1782810000', $command[$pos + 8]);
});
test('remote login url client omits expiry when ttl is zero', function (): void {
$settings = Settings::fromArray([
'MAIL_LOGIN_TARGET_BASE_URL' => 'https://mx1.domena.pl:2222',
'MAIL_LOGIN_SSH_HOST' => 'mx1.domena.pl',
'MAIL_LOGIN_SSH_IDENTITY' => '/secure/key',
'MAIL_LOGIN_SSH_KNOWN_HOSTS' => '/secure/known_hosts',
'LOGIN_KEY_TTL' => '0',
]);
$request = new LoginUrlRequest('mxtest', 'h4.domena.pl', 'h4', 0, true, '198.51.100.10', '/', 1782810000);
$command = RemoteLoginUrlClient::buildCommand($settings, $request);
assert_not_contains('--expiry=', implode(' ', $command));
});
test('remote login url client validates helper output before returning it', function (): void {
$settings = Settings::fromArray(['MAIL_LOGIN_TARGET_BASE_URL' => 'https://mx1.domena.pl:2222']);
$request = new LoginUrlRequest('mxtest', 'h4.domena.pl', 'h4', 30, true, '198.51.100.10', '/', 1782810000);