WebSub / Webhook / Posthook

WebSub is a W3 standard https://www.w3.org/TR/websub/, previously known as PubSubHubbub, for managing http-post-hooks. This mainly describe how to interact and setup a post hook for MFN and it puts some requirements on the receiving end in order for proper verification of intent in receiving push notifications.

Usage overview

  • Required: setup a HTTP/HTTPS endpoint on your server that you would like to get a POST request when a new press release is published

  • Recommended: Use WebSub to setup the subscription in our system. This requires that the endpoint handles a WebSub challenge GET request as well. Alternatively we can setup the subscription manually.

URLs

hub.mfn.se is the endpoint where subscriptions is managed

Post

The data being pushed will be one NewsItem in the format described by the hub.topic. The following HTTP headers is always provider for reference, Content-type, Content-Disposition, X-Hub-Topic, X-Hub-Unsubscribe, X-Hub-Signature

IPs, Location and Validation

MFN is a HA distributed service running in the cloud, scaling up, down and recovering server failures according to its current need. This means that you should not expect the post hook to come from any particular IP, instead you should use X-Hub-Signature header in order to verify that MFN is indeed the sender. This along with a hard to predict endpoint as recipient url should ensure proper authentication of the content.

However, we can ensure that the traffic comes from pre-determine ip addresses if this is necessary for a working setup

Last updated