PII 표시 토큰 누출 보정
This commit is contained in:
parent
61a41d1f08
commit
7cece90e33
19 changed files with 284 additions and 197 deletions
|
|
@ -43,6 +43,7 @@ import {
|
|||
} from "../lib/api";
|
||||
import { useAuth } from "../lib/auth";
|
||||
import { formatElapsed, formatTimecode, clamp01 } from "../lib/format";
|
||||
import { displayPiiSafeText } from "../lib/piiDisplay";
|
||||
import {
|
||||
parseVoicePracticeContext,
|
||||
voicePracticeSearch,
|
||||
|
|
@ -1001,7 +1002,7 @@ export default function Session() {
|
|||
(detail.turns ?? []).map((turn) => ({
|
||||
id: nextId(),
|
||||
speaker: turn.speaker === "client" ? "client" : "learner",
|
||||
text: turn.text,
|
||||
text: displayPiiSafeText(turn.text),
|
||||
turnSeq: turn.turn_seq,
|
||||
at: secondsBetween(detail.started_at, turn.created_at),
|
||||
})),
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import type {
|
|||
UserPrepostMeasureItem,
|
||||
UserPrepostMeasuresResponse,
|
||||
} from "../../lib/api";
|
||||
import { displayPiiSafeText } from "../../lib/piiDisplay";
|
||||
|
||||
export type PrepostMeasureName = UserPrepostMeasureItem["measure_name"];
|
||||
export type PrepostTimepoint = UserPrepostMeasureItem["timepoint"];
|
||||
|
|
@ -132,23 +133,8 @@ export function displayEvaluationRetryError(message: string) {
|
|||
return "AI 평가 재시도를 완료하지 못했습니다. 잠시 뒤 다시 실행해 주세요.";
|
||||
}
|
||||
|
||||
const REVIEW_DISPLAY_PLACEHOLDERS: Record<string, string> = {
|
||||
"[NAME]": "익명 내담자",
|
||||
"[ORG]": "소속 기관",
|
||||
"[PHONE]": "연락처",
|
||||
"[EMAIL]": "이메일",
|
||||
"[RRN]": "주민등록번호",
|
||||
"[ADDRESS]": "주소",
|
||||
};
|
||||
|
||||
export function displayTranscriptText(text: string) {
|
||||
let next = text;
|
||||
for (const [placeholder, label] of Object.entries(
|
||||
REVIEW_DISPLAY_PLACEHOLDERS,
|
||||
)) {
|
||||
next = next.split(placeholder).join(label);
|
||||
}
|
||||
return next;
|
||||
return displayPiiSafeText(text);
|
||||
}
|
||||
|
||||
export function shouldPollReviewReady(data: SessionReviewResponse) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue