feat(auth): include authentication in workspace and tht diagnostics
This commit is contained in:
@@ -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,
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user