Skip to content

Commit 73fb7cf

Browse files
committed
Prevent HTTP source requests if the org has runs disabled
1 parent 5431638 commit 73fb7cf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

apps/webapp/app/services/sources/handleHttpSource.server.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { workerQueue } from "../worker.server";
44
import { requestUrl } from "~/utils/requestUrl.server";
55
import { RuntimeEnvironmentType } from "@trigger.dev/database";
66
import { createHttpSourceRequest } from "~/utils/createHttpSourceRequest";
7+
import { logger } from "../logger.server";
78

89
export class HandleHttpSourceService {
910
#prismaClient: PrismaClient;
@@ -19,6 +20,7 @@ export class HandleHttpSourceService {
1920
endpoint: true,
2021
environment: true,
2122
secretReference: true,
23+
organization: true,
2224
},
2325
});
2426

@@ -30,6 +32,13 @@ export class HandleHttpSourceService {
3032
return { status: 200 };
3133
}
3234

35+
if (!triggerSource.organization.runsEnabled) {
36+
logger.debug("HandleHttpSourceService: Runs are disabled for this organization", {
37+
organizationId: triggerSource.organization.id,
38+
});
39+
return;
40+
}
41+
3342
if (!triggerSource.interactive) {
3443
const sourceRequest = await createHttpSourceRequest(request);
3544

0 commit comments

Comments
 (0)