Add support for custom headers in webhook API
requested to merge gitlab-community/gitlab:455528-support-for-custom-webhook-headers-in-the-api into master
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA
What does this MR do and why?
Add support for custom headers in webhook API
Relates to Support for custom webhook headers in the API (#455528 - closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
API only changes
How to set up and validate locally
- Create a project hook using the API
{ "url": "some-url", "custom_headers": [{ "key": "some-key", "value": "some-value" }] }
- Open the UI and check that a hook with a
some-key
header has been set, test the webhook and see if the value is passed correctly - Edit the hook using the API
{ "custom_headers": [{ "key": "some-other-key", "value": "some-value" }] }
some-key
andsome-other-key
custom headers. - Use the set custom header endpoint:
PUT /projects/:id/hooks/:hook_id/custom_headers/some-key
{ "value": "some-new-value" }
- Delete a custom header:
DELETE /projects/:id/hooks/:hook_id/custom_headers/some-key
. You can check in the UI that the custom header was removed. - Repeat these steps for groups (if you have an active license)
Edited by Niklas van Schrick