Skip to content

Commit

Permalink
fix: adjust tests for ipwhitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
Flo4604 committed Oct 13, 2024
1 parent 648dcd3 commit 86f2651
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/api/src/routes/legacy_keys_verifyKey.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe("with ip whitelist", () => {
name: "test",
authType: "key",
keyAuthId: keyAuthId,
ipWhitelist: JSON.stringify(["100.100.100.100"]),
ipWhitelist: ["100.100.100.100"].join(","),
createdAt: new Date(),
deletedAt: null,
});
Expand Down Expand Up @@ -177,7 +177,7 @@ describe("with ip whitelist", () => {
name: "test",
authType: "key",
keyAuthId: keyAuthid,
ipWhitelist: JSON.stringify(["100.100.100.100"]),
ipWhitelist: ["100.100.100.100"].join(","),
createdAt: new Date(),
deletedAt: null,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/routes/v1_apis_getApi.happy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test("with ip whitelist", async (t) => {
id: newId("api"),
name: "with ip whitelist",
workspaceId: h.resources.userWorkspace.id,
ipWhitelist: JSON.stringify(["127.0.0.1"]),
ipWhitelist: ["127.0.0.1"].join(","),
createdAt: new Date(),
deletedAt: null,
};
Expand Down
5 changes: 3 additions & 2 deletions apps/api/src/routes/v1_keys_verifyKey.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ describe("when ratelimited", () => {
expect(res.body.identity!.externalId).toEqual(externalId);
});
});

describe("with ratelimit override", () => {
test("deducts the correct number of tokens", { timeout: 20000 }, async (t) => {
const h = await IntegrationHarness.init(t);
Expand Down Expand Up @@ -517,7 +518,7 @@ describe("with ip whitelist", () => {
name: "test",
authType: "key",
keyAuthId: keyAuthId,
ipWhitelist: JSON.stringify(["100.100.100.100"]),
ipWhitelist: ["100.100.100.100"].join(","),
createdAt: new Date(),
});

Expand Down Expand Up @@ -565,7 +566,7 @@ describe("with ip whitelist", () => {
name: "test",
authType: "key",
keyAuthId: keyAuthid,
ipWhitelist: JSON.stringify(["100.100.100.100"]),
ipWhitelist: ["100.100.100.100"].join(","),
createdAt: new Date(),
});

Expand Down

0 comments on commit 86f2651

Please sign in to comment.