w3c / websub

WebSub Spec in Social Web Working Group
https://w3c.github.io/websub/
285 stars 50 forks source link

High Level Architecture #144

Closed danielduhh closed 6 years ago

danielduhh commented 6 years ago

A high level architecture diagram would be useful for visualizing communication between publisher, hub & subscriber.

Also... I'm imagining each hub would need some kind of store to manage subscriptions/keys/callback urls, etc.. Any thoughts on that or examples of hub implementations ?

aaronpk commented 6 years ago

The diagrams here do a pretty good job of illustrating it: https://www.programmableweb.com/news/what-pubsubhubbub-push-styled-api-and-how-does-it-work/analysis/2017/04/03

I can take a stab at creating something similar that can be used in the spec.

I wrote an open source hub you can look at: https://github.com/aaronpk/Switchboard

danielduhh commented 6 years ago

@aaronpk thanks for the list of resources. I'm attempting to do the same in Node.js: https://github.com/danielduhh/websub-hub

I'm wondering - did you implement 5.3 Hub Verifies Intent of the Subscriber ? It seems odd that the callback url (probably a POST) would have a GET method that's solely responsible for responding to submission requests w/ challenge/mode/topic

aaronpk commented 6 years ago

@danielduhh Yeah that GET vs POST distinction is mentioned in the green "note" section here: https://www.w3.org/TR/websub/#verification-details

That verification of the subscriber is a required step, otherwise it would allow anyone to create WebSub subscriptions for arbitrary URLs. It's expected that the callback URL responds to both GET and POST requests, GET requests which just echo back the challenge, and POST requests that actually process the notification.

aaronpk commented 6 years ago

@danielduhh I've added a diagram to the high-level overview section. Please let me know if this is helpful and what you had in mind! https://w3c.github.io/websub/#high-level-protocol-flow

danielduhh commented 6 years ago

@aaronpk diagram looks great, thanks !