validate git repo urls and refs, require a secret for webhook triggers, tidy internal endpoint comments

This commit is contained in:
jarek committed 2026-07-31 10:10:56 +02:00
1 parent c18ee21a66
commit 0a9d4ad10f
10 files changed
+186 -91

No files matched your search

+5
View File
@@ -68,6 +68,11 @@ export const POST: RequestHandler = async (event) => {
return json({ error: 'A stack with this name already exists on this environment' }, { status: 409 });
}
// A secret is mandatory when the webhook is enabled.
if (data.webhookEnabled && !data.webhookSecret?.trim()) {
return json({ error: 'A webhook secret is required when the webhook is enabled' }, { status: 400 });
}
// Either repositoryId or new repo details (url, branch) must be provided
let repositoryId = data.repositoryId;