This repository was archived by the owner on Jan 31, 2019. It is now read-only.
Commit d3def88
committed
Add support for custom HTTP predelivery callbacks
This approach will allow us to define last minute callbacks before
performing the HTTP delivery to webhook consumers. Now in the webhook
application that relies on github-services, we can do something like
this:
```ruby
service = Service::Web.new
if webhook.needs_signed_header?
service.before_delivery do |url, payload, headers, params|
signature = public_key.sign(message: payload)
headers['GITHUB-PUBLIC-KEY-SIGNATURE'] = signature
end
end
```1 parent e03332d commit d3def88
1 file changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| 488 | + | |
488 | 489 | | |
489 | 490 | | |
490 | 491 | | |
| |||
502 | 503 | | |
503 | 504 | | |
504 | 505 | | |
| 506 | + | |
505 | 507 | | |
506 | 508 | | |
507 | 509 | | |
| |||
601 | 603 | | |
602 | 604 | | |
603 | 605 | | |
604 | | - | |
| 606 | + | |
605 | 607 | | |
606 | 608 | | |
607 | 609 | | |
| |||
633 | 635 | | |
634 | 636 | | |
635 | 637 | | |
636 | | - | |
| 638 | + | |
637 | 639 | | |
638 | 640 | | |
639 | 641 | | |
640 | 642 | | |
641 | 643 | | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
642 | 648 | | |
643 | 649 | | |
644 | 650 | | |
645 | | - | |
| 651 | + | |
646 | 652 | | |
647 | | - | |
| 653 | + | |
648 | 654 | | |
649 | 655 | | |
650 | 656 | | |
| |||
854 | 860 | | |
855 | 861 | | |
856 | 862 | | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
857 | 867 | | |
858 | 868 | | |
859 | 869 | | |
| |||
0 commit comments