fix(SEC-WEB-37): Gate federation mock data behind NODE_ENV check
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Replace exported const mockConnections with getMockConnections() function that returns mock data only when NODE_ENV === "development". In production and test environments, returns an empty array as defense-in-depth alongside the existing ComingSoon page gate (SEC-WEB-4). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,7 @@ import { ConnectionList } from "@/components/federation/ConnectionList";
|
||||
import { InitiateConnectionDialog } from "@/components/federation/InitiateConnectionDialog";
|
||||
import { ComingSoon } from "@/components/ui/ComingSoon";
|
||||
import {
|
||||
mockConnections,
|
||||
getMockConnections,
|
||||
FederationConnectionStatus,
|
||||
type ConnectionDetails,
|
||||
} from "@/lib/api/federation";
|
||||
@@ -54,7 +54,7 @@ function ConnectionsPageContent(): React.JSX.Element {
|
||||
|
||||
// Using mock data for now (development only)
|
||||
await new Promise((resolve) => setTimeout(resolve, 500)); // Simulate network delay
|
||||
setConnections(mockConnections);
|
||||
setConnections(getMockConnections());
|
||||
} catch (err) {
|
||||
setError(
|
||||
err instanceof Error ? err.message : "Unable to load connections. Please try again."
|
||||
|
||||
Reference in New Issue
Block a user