Answer stability round 1: 0 🔴, 5 🟡 (1 misread); pin the revoke, redirect, 503 and URL-slash paths with tests, and stop calling an undeclared grant dormant

This commit is contained in:
2026-11-08 22:15:54 +01:00
parent 2de7e4d79c
commit 63c90ea3d6
4 changed files with 50 additions and 8 deletions
+9
View File
@@ -121,3 +121,12 @@ test("transactTuples PATCHes every insert and delete in one request (204 resolve
(e: unknown) => e instanceof KetoError && e.status === 400,
);
});
test("trailing slashes on the read and write URLs are stripped before a path is appended", async () => {
const { calls, fetchImpl } = recorder((url) => (url.startsWith("http://r") ? res(200, {}) : res(204)));
const client = createKetoClient({ fetchImpl, readUrl: "http://r//", writeUrl: "http://w/" });
await client.listRelations();
await client.transactTuples({ delete: [], insert: [{ namespace: "Permission", object: "a:read", relation: "granted", subject_id: USER }] });
assert.match(calls[0]!.url, /^http:\/\/r\/relation-tuples\?/);
assert.equal(calls[1]!.url, "http://w/admin/relation-tuples");
});