feat: complete catalog sensitivity enhancements
This commit is contained in:
@@ -309,12 +309,9 @@ function copyS3Evidence(value: unknown): EvidenceSource | undefined {
|
||||
}
|
||||
|
||||
function copyEvidence(value: unknown, id: string): WorkspaceEvidence | undefined {
|
||||
// The backend's canonical YAML parser materializes the evidence schema version
|
||||
// in responses, even though the browser draft does not need to retain it.
|
||||
const source = exactRecord(value, ["schema_version", "source", "policy"]);
|
||||
const schemaVersion = source?.schema_version;
|
||||
if (!source) return undefined;
|
||||
if (!source) return undefined;
|
||||
const type = record(source.source)?.type;
|
||||
const evidenceSource = type === "filesystem"
|
||||
? copyFilesystemEvidence(source.source, id)
|
||||
@@ -325,7 +322,7 @@ function copyEvidence(value: unknown, id: string): WorkspaceEvidence | undefined
|
||||
: undefined;
|
||||
const policy = copyEvidencePolicy(source.policy);
|
||||
return (schemaVersion === 1 || schemaVersion === 2) && evidenceSource && policy
|
||||
? { source: evidenceSource, policy }
|
||||
? { schema_version: schemaVersion, source: evidenceSource, policy }
|
||||
: undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user