Files
Anthony Stirling 3bf0019d7c Webhook policy source (#7051)
# Description of Changes
Create custom webhooks as a source, allows file pushes toa custom made
endpoint with custom auth ID

- Adds webhook as a policy source: external systems push documents to a
receiver endpoint, which stages the files locally and triggers the
policy run
- Requests are authenticated with HMAC signatures; receiver hardened
with bounded body reads and server-minted IDs
- Uses the same team-scoped IntegrationConfig connection model as the S3
source, with matching portal UI (source type, icon, wizard)
- Includes a policies-gated Cucumber feature covering the receiver
end-to-end

---

## Checklist

### General

- [ ] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [ ] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md)
(if applicable)
- [ ] I have performed a self-review of my own code
- [ ] My changes generate no new warnings

### Documentation

- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

### Translations (if applicable)

- [ ] I ran
[`scripts/counter_translation.py`](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/docs/counter_translation.md)

### UI Changes (if applicable)

- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)

### Testing (if applicable)

- [ ] I have run `task check` to verify linters, typechecks, and tests
pass
- [ ] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#7-testing)
for more details.
2026-07-22 12:33:53 +00:00

26 lines
1.3 KiB
Gherkin

@policies @webhook
Feature: Webhook input source
# Requires the proprietary policy feature (webhook sources). Scenarios are
# skipped automatically when webhook sources are unavailable (see environment.py).
# A webhook source mints a delivery URL + signing secret; senders POST signed
# documents which are spooled for the referencing policies.
Scenario: A validly signed delivery is accepted
Given I create a webhook source named "Cucumber webhook"
When I deliver "hello from cucumber" to the webhook with a valid signature
Then the webhook response status should be 202
Scenario: A wrongly signed delivery is rejected
Given I create a webhook source named "Cucumber webhook reject"
When I deliver "tampered body" to the webhook with signature "sha256=deadbeef"
Then the webhook response status should be 401
Scenario: Delivering to an unknown webhook id is not found
When I deliver "orphan" to webhook id "doesnotexistwebhook0"
Then the webhook response status should be 404
Scenario: The signing secret is revealed once on create then masked on read
Given I create a webhook source named "Cucumber webhook secret"
Then the webhook create response includes a signing secret
And reading the webhook source back masks the signing secret