Skip to content

Commit 9af0ba4

Browse files
committed
fix(webapp): invalidate the webhook endpoint cache after a dashboard secret change
Rotating or generating a webhook signing secret from the dashboard now invalidates the engine's cached endpoint immediately, so deliveries are verified against the new secret right away instead of being rejected for up to the cache TTL. The HTTP API route already did this; the dashboard generate and set/rotate actions now match.
1 parent 681f566 commit 9af0ba4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.webhooks.endpoints.$endpointParam

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.webhooks.endpoints.$endpointParam/route.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import {
4646
} from "~/presenters/v3/WebhookDetailPresenter.server";
4747
import { clickhouseFactory } from "~/services/clickhouse/clickhouseFactoryInstance.server";
4848
import { getSecretStore } from "~/services/secrets/secretStore.server";
49+
import { webhookEngine } from "~/v3/webhookEngine.server";
4950
import { requireUser } from "~/services/session.server";
5051
import { docsPath, EnvironmentParamSchema, v3WebhookTaskPath } from "~/utils/pathBuilder";
5152
import { parseFiniteInt } from "~/utils/searchParams";
@@ -180,6 +181,7 @@ export const action = async ({ request, params }: ActionFunctionArgs) => {
180181
where: { id: endpoint.id },
181182
data: { signingSecretKey: secretKey },
182183
});
184+
webhookEngine.invalidateEndpoint(endpoint.opaqueId);
183185
return { success: true as const, generatedSecret: secret };
184186
}
185187

@@ -193,6 +195,7 @@ export const action = async ({ request, params }: ActionFunctionArgs) => {
193195
where: { id: endpoint.id },
194196
data: { signingSecretKey: secretKey },
195197
});
198+
webhookEngine.invalidateEndpoint(endpoint.opaqueId);
196199

197200
return { success: true as const };
198201
};

0 commit comments

Comments
 (0)