fix(SEC-WEB-37): Gate federation mock data behind NODE_ENV check
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:
Jason Woltje
2026-02-06 18:22:12 -06:00
parent 12fa093f58
commit 1005b7969c
3 changed files with 274 additions and 71 deletions

View File

@@ -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."