Skip to content

Commit 495e08d

Browse files
committed
fix(webapp): bound the api-key task identifier list filter
New site from main. The count is compared against selectedTasks.length, so only the filter value is wrapped; duplicates in the IN list do not change the row count, leaving that comparison intact.
1 parent b8fd357 commit 495e08d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/webapp/app/models/api-key.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { PrismaClient, RuntimeEnvironment } from "@trigger.dev/database";
22
import type { HostRbacController } from "@trigger.dev/rbac";
33
import { customAlphabet } from "nanoid";
44
import { MAX_API_KEY_TASK_IDENTIFIERS } from "~/consts";
5-
import { prisma } from "~/db.server";
5+
import { boundedIn, prisma } from "~/db.server";
66
import { RuntimeEnvironmentType } from "~/database-types";
77
import { canIssueAdditionalApiKeys } from "~/services/additionalApiKeyIssuance.server";
88
import { apiKeyTelemetry, type ApiKeyTelemetry } from "~/services/apiKeyTelemetry.server";
@@ -165,7 +165,7 @@ export async function createEnvironmentApiKey(
165165
const matchingTasks = await prismaClient.taskIdentifier.count({
166166
where: {
167167
runtimeEnvironmentId: taskEnvironmentId,
168-
slug: { in: selectedTasks },
168+
slug: { in: boundedIn(selectedTasks) },
169169
runtimeEnvironment: {
170170
OR: [{ id: environment.id }, { parentEnvironmentId: environment.id }],
171171
},

0 commit comments

Comments
 (0)