feat: add CrowdSec API key status handling and warning component
- Implemented `getCrowdsecKeyStatus` API call to retrieve the current status of the CrowdSec API key. - Created `CrowdSecKeyWarning` component to display warnings when the API key is rejected. - Integrated `CrowdSecKeyWarning` into the Security page, ensuring it only shows when relevant. - Updated i18n initialization in main.tsx to prevent race conditions during rendering. - Enhanced authentication setup in tests to handle various response statuses more robustly. - Adjusted security tests to accept broader error responses for import validation.
This commit is contained in:
@@ -11,6 +11,7 @@ import { toast } from '../utils/toast'
|
||||
import { ConfigReloadOverlay } from '../components/LoadingStates'
|
||||
import { LiveLogViewer } from '../components/LiveLogViewer'
|
||||
import { SecurityNotificationSettingsModal } from '../components/SecurityNotificationSettingsModal'
|
||||
import { CrowdSecKeyWarning } from '../components/CrowdSecKeyWarning'
|
||||
import { PageShell } from '../components/layout/PageShell'
|
||||
import {
|
||||
Card,
|
||||
@@ -352,6 +353,11 @@ export default function Security() {
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
{/* CrowdSec Key Rejection Warning */}
|
||||
{status.cerberus?.enabled && (crowdsecStatus?.running ?? status.crowdsec.enabled) && (
|
||||
<CrowdSecKeyWarning />
|
||||
)}
|
||||
|
||||
{/* Admin Whitelist Section */}
|
||||
{status.cerberus?.enabled && (
|
||||
<Card>
|
||||
|
||||
Reference in New Issue
Block a user