fix: resolve final review findings (wiki cache tenant isolation, meeting search pagination, ambient test)
This commit is contained in:
1 parent
e0aa91e388
commit
7097d1c174
8 files changed
+353
-21
No files matched your search
@@ -442,6 +442,26 @@ describe("OpenProjectClient (Mocked Unit Tests)", () => {
|
||||
expect(capturedHeaders?.get("Accept")).toContain("application/hal+json");
|
||||
});
|
||||
|
||||
test("getCacheKey returns unique key scoped to both baseUrl and apiKey", () => {
|
||||
const clientA = new OpenProjectClient({
|
||||
baseUrl: "https://openproject.example.com",
|
||||
apiKey: "user-key-a",
|
||||
});
|
||||
const clientB = new OpenProjectClient({
|
||||
baseUrl: "https://openproject.example.com",
|
||||
apiKey: "user-key-b",
|
||||
});
|
||||
const clientC = new OpenProjectClient({
|
||||
baseUrl: "https://other.example.com",
|
||||
apiKey: "user-key-a",
|
||||
});
|
||||
|
||||
expect(clientA.getCacheKey()).toBe("https://openproject.example.com#user-key-a");
|
||||
expect(clientB.getCacheKey()).toBe("https://openproject.example.com#user-key-b");
|
||||
expect(clientC.getCacheKey()).toBe("https://other.example.com#user-key-a");
|
||||
expect(clientA.getCacheKey()).not.toBe(clientB.getCacheKey());
|
||||
});
|
||||
|
||||
test("sanitizes API credentials from error messages", async () => {
|
||||
const secretKey = "super-secret-key-xyz-999";
|
||||
const mockFetch = async (): Promise<Response> => {
|
||||
|
||||
Reference in new issue
Block a user