feat(servers): hint that disabling password login leaves key-only access
Adds a muted one-line hint on the SSH-Passwort-Login checklist row while password auth is still on, so the operator knows access becomes SSH-key only (and to deposit a key first) before toggling — mirroring the lockout guard. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>feat/v1-foundation
parent
21ee81f742
commit
a5c518822b
|
|
@ -11,6 +11,7 @@ return [
|
||||||
'status_warning' => 'Warnung',
|
'status_warning' => 'Warnung',
|
||||||
'status_offline' => 'Offline',
|
'status_offline' => 'Offline',
|
||||||
'status_pending' => 'Initialisierung',
|
'status_pending' => 'Initialisierung',
|
||||||
|
'ssh_key_only_hint' => 'Nach dem Deaktivieren ist der Zugang nur per SSH-Key möglich — Key zuerst hinterlegen.',
|
||||||
|
|
||||||
// ── Index: header ─────────────────────────────────────────────────────
|
// ── Index: header ─────────────────────────────────────────────────────
|
||||||
'fleet_eyebrow' => 'Flotte',
|
'fleet_eyebrow' => 'Flotte',
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ return [
|
||||||
'status_warning' => 'Warning',
|
'status_warning' => 'Warning',
|
||||||
'status_offline' => 'Offline',
|
'status_offline' => 'Offline',
|
||||||
'status_pending' => 'Initializing',
|
'status_pending' => 'Initializing',
|
||||||
|
'ssh_key_only_hint' => 'After disabling, access is SSH-key only — deposit a key first.',
|
||||||
|
|
||||||
// ── Index: header ─────────────────────────────────────────────────────
|
// ── Index: header ─────────────────────────────────────────────────────
|
||||||
'fleet_eyebrow' => 'Fleet',
|
'fleet_eyebrow' => 'Fleet',
|
||||||
|
|
|
||||||
|
|
@ -211,6 +211,10 @@
|
||||||
@endif
|
@endif
|
||||||
</p>
|
</p>
|
||||||
<p class="truncate font-mono text-[11px] text-ink-3">{{ $supported ? $check['detail'] : $check['reason'] }}</p>
|
<p class="truncate font-mono text-[11px] text-ink-3">{{ $supported ? $check['detail'] : $check['reason'] }}</p>
|
||||||
|
{{-- Key-only warning: disabling password login leaves SSH-key access only. --}}
|
||||||
|
@if ($supported && $check['key'] === 'ssh_password' && $check['featureOn'])
|
||||||
|
<p class="mt-0.5 font-mono text-[11px] text-ink-4">{{ __('servers.ssh_key_only_hint') }}</p>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@if ($supported)
|
@if ($supported)
|
||||||
@if ($check['key'] === 'fail2ban')
|
@if ($check['key'] === 'fail2ban')
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use App\Livewire\Servers\Show;
|
||||||
|
use App\Models\Server;
|
||||||
|
use App\Models\User;
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Livewire\Features\SupportTesting\Testable;
|
||||||
|
use Livewire\Livewire;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class ServerShowSshHintTest extends TestCase
|
||||||
|
{
|
||||||
|
use RefreshDatabase;
|
||||||
|
|
||||||
|
private function show(array $hardening): Testable
|
||||||
|
{
|
||||||
|
$this->actingAs(User::factory()->create());
|
||||||
|
$server = Server::create(['name' => 's', 'ip' => '10.0.0.9', 'ssh_port' => 22, 'status' => 'online']);
|
||||||
|
|
||||||
|
return Livewire::test(Show::class, ['server' => $server])->set('ready', true)->set('hardening', $hardening);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_key_only_hint_shown_when_password_login_on(): void
|
||||||
|
{
|
||||||
|
$this->show([
|
||||||
|
['key' => 'ssh_password', 'label' => 'SSH-Passwort-Login', 'detail' => 'PasswordAuthentication yes', 'featureOn' => true, 'secure' => false, 'supported' => true, 'reason' => null, 'neutral' => false],
|
||||||
|
])->assertSee(__('servers.ssh_key_only_hint'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_key_only_hint_hidden_when_password_login_off(): void
|
||||||
|
{
|
||||||
|
$this->show([
|
||||||
|
['key' => 'ssh_password', 'label' => 'SSH-Passwort-Login', 'detail' => 'PasswordAuthentication no', 'featureOn' => false, 'secure' => true, 'supported' => true, 'reason' => null, 'neutral' => false],
|
||||||
|
])->assertDontSee(__('servers.ssh_key_only_hint'));
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue