Files
doktainer-upstream/src/components/SensitiveConnectionValue.tsx
T
KodekaTeam 8dac31b71f feat: implement sensitive data redaction for viewer roles
- 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.
2026-08-09 00:37:15 +07:00

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>
);
}