- Introduced SensitiveConnectionValue component to handle redaction of sensitive connection details across the frontend. - Updated API to include canViewServerConnection and canViewEnvironmentValues functions to determine access based on user roles. - Enhanced backend response sanitization to remove sensitive data for viewer roles, ensuring no sensitive information is exposed in API responses. - Applied redaction logic in various components including ServersTable, DomainsTable, and EnvironmentHeader to maintain UI consistency while hiding sensitive information. - Added comprehensive audit documentation outlining the implementation and maintenance rules for sensitive data handling.
36 lines
874 B
TypeScript
36 lines
874 B
TypeScript
interface SensitiveConnectionValueProps {
|
|
value?: string | null;
|
|
isRedacted: boolean;
|
|
}
|
|
|
|
/** Keeps connection fields discoverable without exposing their values to viewers. */
|
|
export default function SensitiveConnectionValue({
|
|
value,
|
|
isRedacted,
|
|
}: SensitiveConnectionValueProps) {
|
|
if (!isRedacted) {
|
|
return <>{value || "—"}</>;
|
|
}
|
|
|
|
return (
|
|
<span
|
|
aria-label="Connection address hidden for viewer"
|
|
title="Connection address hidden"
|
|
style={{
|
|
display: "inline-flex",
|
|
alignItems: "center",
|
|
borderRadius: 4,
|
|
padding: "2px 7px",
|
|
background: "var(--bg-input)",
|
|
border: "1px solid var(--border)",
|
|
color: "var(--text-muted)",
|
|
fontSize: 10,
|
|
letterSpacing: "0.08em",
|
|
userSelect: "none",
|
|
}}
|
|
>
|
|
••••••••••••
|
|
</span>
|
|
);
|
|
}
|