feat: complete catalog sensitivity enhancements
This commit is contained in:
@@ -70,17 +70,52 @@ test("accepts the evidence schema version materialized by the backend", async ()
|
||||
})));
|
||||
|
||||
await expect(getWorkspace("psd-clinical")).resolves.toEqual({
|
||||
workspace: {
|
||||
...persistedWorkspace,
|
||||
evidence: {
|
||||
source: persistedWorkspace.evidence.source,
|
||||
policy: persistedWorkspace.evidence.policy,
|
||||
},
|
||||
},
|
||||
workspace: persistedWorkspace,
|
||||
revision,
|
||||
});
|
||||
});
|
||||
|
||||
test("validates a workspace read from the backend without losing its Evidence schema version", async () => {
|
||||
const persistedWorkspace = {
|
||||
...workspace,
|
||||
evidence: {
|
||||
schema_version: 1,
|
||||
source: {
|
||||
type: "filesystem",
|
||||
uri: "psd-clinical/evidence",
|
||||
patterns: ["curated/**/*.md"],
|
||||
max_bytes: 10 * 1024 * 1024,
|
||||
},
|
||||
policy: { max_chunk_chars: 5000, retain_published_generations: 3 },
|
||||
},
|
||||
};
|
||||
let validationRequest: unknown;
|
||||
server.use(
|
||||
http.get("/api/workspaces/psd-clinical", () => HttpResponse.json({
|
||||
workspace: persistedWorkspace,
|
||||
revision,
|
||||
})),
|
||||
http.post("/api/workspaces/validate", async ({ request }) => {
|
||||
validationRequest = await request.json();
|
||||
return HttpResponse.json({
|
||||
workspace: persistedWorkspace,
|
||||
contract: {},
|
||||
activatable: true,
|
||||
diagnostics: [],
|
||||
authentication: {
|
||||
ready: true,
|
||||
mode: "local",
|
||||
checks: [{ level: "info", code: "auth_ready", message: "Authentication is ready." }],
|
||||
},
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
||||
const loaded = await getWorkspace("psd-clinical");
|
||||
await expect(validateWorkspace(loaded.workspace)).resolves.toMatchObject({ activatable: true });
|
||||
expect(validationRequest).toEqual({ workspace: persistedWorkspace });
|
||||
});
|
||||
|
||||
test("decodes runtime requirements but rejects any secret value returned by the server", async () => {
|
||||
server.use(http.get(
|
||||
"/api/workspaces/psd-clinical/runtime-configuration",
|
||||
|
||||
Reference in New Issue
Block a user