fix(nextcloud-files): IN-03 sichtbare Warnung bei einer http-Adresse
- Einstellungen zeigen bei http:// einen Warnhinweis: Passwoerter und App-Passwoerter gehen unverschluesselt durch das Netz; https bleibt ohne Hinweis - Anleitung Administration nennt die Warnung Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -221,6 +221,14 @@ export function SettingsTab({ onChanged }: { onChanged: () => void }) {
|
||||
setConfirmCount(null);
|
||||
}}
|
||||
/>
|
||||
{/^http:\/\//i.test(address.trim()) && (
|
||||
<p
|
||||
role="status"
|
||||
className="rounded border border-status-warn/40 bg-status-warn/12 px-3 py-2 text-sm text-status-warn-fg"
|
||||
>
|
||||
{t('address.insecure')}
|
||||
</p>
|
||||
)}
|
||||
{!isAdmin && (
|
||||
<p id="nextcloud-files-address-admin-only" className="text-xs text-muted-foreground">
|
||||
{t('address.adminOnly')}
|
||||
|
||||
@@ -287,6 +287,14 @@ describe('SettingsTab', () => {
|
||||
expect(mockSaveSettings).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('eine http-Adresse zeigt eine sichtbare Warnung, https nicht (IN-03)', async () => {
|
||||
const input = await openSettings();
|
||||
await waitFor(() => expect((input as HTMLInputElement).value).toBe('https://cloud.example'));
|
||||
expect(screen.queryByText(/nicht verschlüsselt/)).toBeNull();
|
||||
fireEvent.change(input, { target: { value: 'http://cloud.intern' } });
|
||||
expect(screen.getByText(/nicht verschlüsselt/)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('die Hinweiskarte nennt den Befehl fuer die Ausnahmeliste', async () => {
|
||||
await openSettings();
|
||||
expect(screen.getByText(/occ config:app:set bruteForce whitelist_0/)).toBeTruthy();
|
||||
|
||||
Reference in New Issue
Block a user