Export KetoError from the plugin barrel, and delete a group's grants and parent memberships when its last member leaves
CI / full-gate (push) Failing after 54s

This commit is contained in:
2026-11-17 01:04:16 +01:00
parent 852137982d
commit 37e7227dea
6 changed files with 129 additions and 18 deletions
+10
View File
@@ -22,3 +22,13 @@ test("plugin-api re-exports the stable author value surface", () => {
assert.equal(api.safeUrl("javascript:alert(1)"), "#"); // the URL sanitiser for rendering untrusted hrefs
assert.equal(api.definePlugin({ apiVersion: "1.0.0" }).apiVersion, "1.0.0"); // identity helper works through the barrel
});
// A system plugin tells an Ory failure apart by `instanceof`; each client's error class must be the barrel's.
test("plugin-api re-exports the Ory error classes a ctx.system client throws", async () => {
const { KetoError } = await import("../auth/keto-client.ts");
assert.equal(api.KetoError, KetoError);
for (const name of ["KratosError", "HydraError", "KetoError"] as const) {
assert.equal(typeof api[name], "function", `missing export: ${name}`);
}
});
+1
View File
@@ -46,6 +46,7 @@ export type { ExpandTree, KetoClient, RelationQuery, RelationTuple, SubjectSet }
export type { HydraAdmin, OAuth2Client } from "../auth/hydra-admin.ts";
export { KratosError } from "../auth/kratos-public.ts";
export { HydraError } from "../auth/hydra-admin.ts";
export { KetoError } from "../auth/keto-client.ts";
// Sanitise an untrusted URL (upstream/user data) before rendering it in an href/src — partials
// escape text but not URL schemes, so a `javascript:`/`data:` URL would be live XSS (see docs).
export { safeUrl } from "../http/safe-url.ts";