Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/auth/challenge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ describe("challenge API rate limiting and abuse prevention", () => {
expect(statusCode).toBe(200);
expect(responseData.token).toBeTruthy();
expect(responseData.challenge).toContain("prompt-hash unlock:");
expect(responseData.nonce).toBeTruthy();
expect(responseData.challenge).toContain(String(responseData.nonce));
expect(responseData.expiresAt).toBeGreaterThan(Date.now());
});

it("returns MISSING_FIELDS for malformed bodies", async () => {
Expand Down
2 changes: 1 addition & 1 deletion api/bundles/unlock.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}));

vi.mock("../../src/lib/observability/replayProtection", () => ({
checkReplayProtection: vi.fn().mockResolvedValue({ valid: true }),
checkUnlockReplayProtection: vi.fn().mockResolvedValue({ valid: true }),
}));

vi.mock("../../src/lib/observability/metrics", () => ({
Expand Down Expand Up @@ -178,7 +178,7 @@
address: buyer.publicKey(),
signedMessage: wrongSignature,
});
expect(statusCode).toBe(401);

Check failure on line 181 in api/bundles/unlock.test.ts

View workflow job for this annotation

GitHub Actions / Unit & Component Tests

api/bundles/unlock.test.ts > bundle unlock API abuse protection & lockout > locks account after 5 failed authentication attempts on bundle unlock

AssertionError: expected 403 to be 401 // Object.is equality - Expected + Received - 401 + 403 ❯ api/bundles/unlock.test.ts:181:26
expect(responseData.code).toBe(ErrorCode.INVALID_SIGNATURE);
}

Expand Down
Loading
Loading