Skip to content

fix(webhook-test): Hide exception details from webhook test response#7550

Open
matthewelwell wants to merge 6 commits into
mainfrom
fix/hide-exception-details
Open

fix(webhook-test): Hide exception details from webhook test response#7550
matthewelwell wants to merge 6 commits into
mainfrom
fix/hide-exception-details

Conversation

@matthewelwell
Copy link
Copy Markdown
Contributor

@matthewelwell matthewelwell commented May 20, 2026

Changes

This PR addresses 2 things:

  1. Validate URLs when creating or testing webhooks to validate for SSRF attacks.
  2. Previously the response from the API returned the raw python exception to the client on a failed webhook test. This exposed unnecessary detail to the client.
image

Note: I think there are FE improvements that can be made here, but it opens a bit of a can of worms regarding standardising error messages and FE rendering of them.

How did you test this code?

  1. Manually ran a test against a URL that failed and verified that the returned information was as expected.
  2. Added and updated existing unit tests to verify the SSRF validation behaviour, and error responses

@matthewelwell matthewelwell requested a review from a team as a code owner May 20, 2026 08:55
@matthewelwell matthewelwell requested review from khvn26 and removed request for a team May 20, 2026 08:55
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview May 20, 2026 3:39pm
flagsmith-frontend-preview Ignored Ignored Preview May 20, 2026 3:39pm
flagsmith-frontend-staging Ignored Ignored Preview May 20, 2026 3:39pm

Request Review

@github-actions github-actions Bot added api Issue related to the REST API fix labels May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-7550 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7550 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7550 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-7550 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api-test:pr-7550 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7550 Finished ✅ Results

@github-actions github-actions Bot added fix and removed fix labels May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  39 seconds
commit  c77dde9
info  🔄 Run: #16854 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  36.5 seconds
commit  c77dde9
info  🔄 Run: #16854 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  51.8 seconds
commit  c77dde9
info  🔄 Run: #16854 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  41.6 seconds
commit  c77dde9
info  🔄 Run: #16854 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  38.4 seconds
commit  fa80188
info  🔄 Run: #16855 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  38.8 seconds
commit  fa80188
info  🔄 Run: #16855 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  39.1 seconds
commit  fa80188
info  🔄 Run: #16855 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  56.6 seconds
commit  fa80188
info  🔄 Run: #16855 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  38.5 seconds
commit  0a05e84
info  🔄 Run: #16862 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  19 passed

Details

stats  19 tests across 15 suites
duration  1 minute, 9 seconds
commit  0a05e84
info  🔄 Run: #16862 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  39.5 seconds
commit  0a05e84
info  🔄 Run: #16862 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  50.1 seconds
commit  0a05e84
info  🔄 Run: #16862 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  43 seconds
commit  d31d339
info  🔄 Run: #16868 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  35.5 seconds
commit  d31d339
info  🔄 Run: #16868 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  55.3 seconds
commit  d31d339
info  🔄 Run: #16868 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  35.3 seconds
commit  d31d339
info  🔄 Run: #16868 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  38 seconds
commit  36a5868
info  🔄 Run: #16869 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.5 seconds
commit  36a5868
info  🔄 Run: #16869 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  19 passed

Details

stats  19 tests across 15 suites
duration  1 minute, 10 seconds
commit  36a5868
info  🔄 Run: #16869 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  53.9 seconds
commit  36a5868
info  🔄 Run: #16869 (attempt 1)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Visual Regression

19 screenshots compared. See report for details.
View full report

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.48%. Comparing base (24f4d1a) to head (36a5868).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #7550    +/-   ##
========================================
  Coverage   98.47%   98.48%            
========================================
  Files        1400     1404     +4     
  Lines       53034    53360   +326     
========================================
+ Hits        52224    52550   +326     
  Misses        810      810            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added fix and removed fix labels May 20, 2026
@github-actions github-actions Bot added fix and removed fix labels May 20, 2026
@github-actions github-actions Bot added fix and removed fix labels May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant