-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for per feed webhook #3112
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please rebase your pull-request to solve the merge conflicts. There is also some minor linter issues and missing translations that prevent the unit tests to pass.
I will rebase and fix the issues later today, draft until done |
fyi, the linter is still failing. |
should be good now |
95988fb
to
a0dc678
Compare
Did you follow the guidelines?
This PR adds support for webhooks on a per feed basis as well as a default webhook url which serves as a catch all: The old webhook url has been changed to act as the default webhook url which is used when there is none set for the feed. This also maintains backwards compatibility.
Renamed webhook integration settings:
![image](https://private-user-images.githubusercontent.com/44981748/407053206-4c154878-8b99-44f5-b431-30fd3c53b679.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MTQ2MjgsIm5iZiI6MTczOTUxNDMyOCwicGF0aCI6Ii80NDk4MTc0OC80MDcwNTMyMDYtNGMxNTQ4NzgtOGI5OS00NGY1LWI0MzEtMzBmZDNjNTNiNjc5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDA2MjUyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU4NmI1OTAyMDExOGY5M2FjMDUwYjk0OGM3Y2VmY2Q5OWU3NDMyNzUxOTBkZTI4OTExNTRiNzUxODVlMTc5NjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.oG68VhpJ8JWEt8XIrecw0Kq2r0aNkhe4QKxiVXR8ibM)
New per feed webhook url field:
![image](https://private-user-images.githubusercontent.com/44981748/407052454-2de53515-fd28-4e31-8e13-8100749f6157.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MTQ2MjgsIm5iZiI6MTczOTUxNDMyOCwicGF0aCI6Ii80NDk4MTc0OC80MDcwNTI0NTQtMmRlNTM1MTUtZmQyOC00ZTMxLThlMTMtODEwMDc0OWY2MTU3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDA2MjUyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk2YzljZWU5ZmY0ZDFlMTE2MjBlODM0MTA0YTlhMzBlYjViNTg1NzlmNjZkMDZlMzEyNGNhMmJmZjY5Y2ZlMTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.p-41UwikIWZ0YwSkg3u_rRA7P-mMSazxmxlBPlY5TZM)
Solves/fixes:
Inspired by: #2039
Please note that all the webhooks share the same secret, this was done to keep the changes minimal.
information used in tests:
Only default webhook url set with multiple feeds (old behaviour):
![image](https://private-user-images.githubusercontent.com/44981748/407058402-d69451e5-21ca-49cd-9a12-48c6bfd804f5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MTQ2MjgsIm5iZiI6MTczOTUxNDMyOCwicGF0aCI6Ii80NDk4MTc0OC80MDcwNTg0MDItZDY5NDUxZTUtMjFjYS00OWNkLTlhMTItNDhjNmJmZDgwNGY1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDA2MjUyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA4OTFiYmFiZDE2YWI0NjBmZDE4ZmMzMzc3MGNiMzJjMmJiOTFiNjNhOTc1NThhYzM1ZDcwYjUxMmVlODkzZDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.SNkDhKNDu7h1DTwM2qHCoHAc26YJbRpqFcRoatT-7xE)
This makes 1 request per feed, since i tested with 2 feeds i got 2 messages.
Feed with custom url:
Set custom url.
![image](https://private-user-images.githubusercontent.com/44981748/407056082-6179b302-bbf0-484b-87a4-dca3edda797c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MTQ2MjgsIm5iZiI6MTczOTUxNDMyOCwicGF0aCI6Ii80NDk4MTc0OC80MDcwNTYwODItNjE3OWIzMDItYmJmMC00ODRiLTg3YTQtZGNhM2VkZGE3OTdjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDA2MjUyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRkMTk5MGIzMDFmZTU2MGI2YTJjMWIzOTU5MTE3NGUyMzRhMzQ2MDhkNjczNmFjZmZiYTdkZTdjMjk3MzQxYzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.EeU142sEFXg5LiBp5jCCW5r5RIHhSmqHbck74XWMGg4)
Webhook output.
![image](https://private-user-images.githubusercontent.com/44981748/407058631-bca6fb74-e5f1-4864-be7e-3d8ec7a144f3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MTQ2MjgsIm5iZiI6MTczOTUxNDMyOCwicGF0aCI6Ii80NDk4MTc0OC80MDcwNTg2MzEtYmNhNmZiNzQtZTVmMS00ODY0LWJlN2UtM2Q4ZWM3YTE0NGYzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDA2MjUyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIzZDE2OWVlODU1YjRiYjhkNjUzMzJmYzViZDkxYWEwNjc0YjViY2QyNjdkODU5NWZmYTJlOTIzMmIzMzgyYTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.SJ1bkl7MrylPhD_57qrBuUDln8pMDQPnV2mZBGE4v2Q)