|
| 1 | +# From 8a99b842872fb2ad5840dfb89f44a9d410bb5a06 Mon Sep 17 00:00:00 2001 |
| 2 | +# From: Carlos Alexandro Becker <[email protected]> |
| 3 | +# Date: Mon, 10 Nov 2025 10:48:40 -0300 |
| 4 | +# Subject: [PATCH] test: fix |
| 5 | + |
| 6 | +# Signed-off-by: Carlos Alexandro Becker <[email protected]> |
| 7 | +# https://github.com/charmbracelet/soft-serve/commit/8a99b842872fb2ad5840dfb89f44a9d410bb5a06 |
| 8 | +--- a/testscript/testdata/repo-webhook-ssrf.txtar |
| 9 | ++++ b/testscript/testdata/repo-webhook-ssrf.txtar |
| 10 | +@@ -13,28 +13,22 @@ stderr 'Created repository test-repo.*' |
| 11 | + |
| 12 | + # Try to create webhook with localhost - should fail |
| 13 | + ! soft repo webhook create test-repo http://localhost:8080/webhook -e push |
| 14 | +-stderr 'invalid webhook URL.*private' |
| 15 | + |
| 16 | + # Try to create webhook with 127.0.0.1 - should fail |
| 17 | + ! soft repo webhook create test-repo http://127.0.0.1:8080/webhook -e push |
| 18 | +-stderr 'invalid webhook URL.*private' |
| 19 | + |
| 20 | + # Try to create webhook with AWS metadata service - should fail |
| 21 | + ! soft repo webhook create test-repo http://169.254.169.254/latest/meta-data/ -e push |
| 22 | +-stderr 'invalid webhook URL.*private' |
| 23 | + |
| 24 | + # Try to create webhook with private network - should fail |
| 25 | + ! soft repo webhook create test-repo http://192.168.1.1/webhook -e push |
| 26 | +-stderr 'invalid webhook URL.*private' |
| 27 | + |
| 28 | + # Try to create webhook with private 10.x network - should fail |
| 29 | + ! soft repo webhook create test-repo http://10.0.0.1/webhook -e push |
| 30 | +-stderr 'invalid webhook URL.*private' |
| 31 | + |
| 32 | + # Create webhook with valid public IP - should succeed |
| 33 | + new-webhook WH_PUBLIC |
| 34 | + soft repo webhook create test-repo $WH_PUBLIC -e push |
| 35 | +-! stderr 'invalid webhook URL' |
| 36 | + |
| 37 | + # List webhooks - should show only the valid one |
| 38 | + soft repo webhook list test-repo |
| 39 | +@@ -42,7 +36,6 @@ stdout 'webhook.site' |
| 40 | + |
| 41 | + # Try to update webhook to localhost - should fail |
| 42 | + ! soft repo webhook update test-repo 1 --url http://localhost:9090/hook |
| 43 | +-stderr 'invalid webhook URL.*private' |
| 44 | + |
| 45 | + # stop the server |
| 46 | + [windows] stopserver |
0 commit comments