fix(v5): rotate agent tokens every fifteen minutes

This commit is contained in:
Andras Bacsai
2026-07-06 22:35:17 +02:00
parent 51ed86fe63
commit fbc6fd5ce5
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ class Kernel extends ConsoleKernel
// V5 host JWT rotation: re-mints and SSH-pushes a fresh host token
// before the on-disk token expires so coold reconnects stay authorized.
$this->scheduleInstance->job(new V5RotateAgentTokensJob)->hourly()->withoutOverlapping()->onOneServer();
$this->scheduleInstance->job(new V5RotateAgentTokensJob)->everyFifteenMinutes()->withoutOverlapping()->onOneServer();
if (isDev()) {
// Instance Jobs
+12
View File
@@ -48,3 +48,15 @@ it('schedules every production job with onOneServer', function () {
);
});
});
it('runs v5 agent token rotation often enough for the default ttl and refresh threshold', function () {
$schedule = app(Schedule::class);
$event = collect($schedule->events())->first(
fn ($e) => str_contains((string) $e->description, 'V5RotateAgentTokensJob')
);
expect($event)->not->toBeNull();
expect($event->expression)->toBe('*/15 * * * *');
expect($event->onOneServer)->toBeTrue();
});