feat(auth): include authentication in workspace and tht diagnostics

This commit is contained in:
2026-08-17 15:51:16 +02:00
parent cb0e873ed7
commit 3ed00ff086
19 changed files with 1050 additions and 34 deletions
+38
View File
@@ -8,6 +8,8 @@ import {
getWorkspaceRuntimeConfiguration,
listWorkspaces,
saveWorkspaceSecrets,
testWorkspace,
validateWorkspace,
} from "./workspaces";
const workspace = canonicalWorkspaceFixture("psd-clinical");
@@ -98,3 +100,39 @@ test("forget targets one declared requirement", async () => {
.resolves.toEqual(runtimeConfiguration);
expect(called).toBe(true);
});
test("decodes the shared authentication diagnostics on static validation and live connection tests", async () => {
const authentication = {
ready: false,
mode: "oidc" as const,
checks: [{
level: "error" as const,
code: "oidc_mapped_group_missing" as const,
field: "Thoth Administrators",
message: "A configured authorization group does not exist.",
}],
};
server.use(
http.post("/api/workspaces/validate", () => HttpResponse.json({
workspace,
contract: {},
activatable: false,
diagnostics: [],
authentication,
})),
http.post("/api/workspaces/psd-clinical/test", () => HttpResponse.json({
activatable: false,
diagnostics: [],
authentication,
})),
);
await expect(validateWorkspace(workspace)).resolves.toMatchObject({
activatable: false,
authentication,
});
await expect(testWorkspace("psd-clinical")).resolves.toMatchObject({
activatable: false,
authentication,
});
});