18. Developer DayGoogle 2010
OAuth
1.Your application gets an unauthorized request token
from the Service Provider’s authorization server.
Your
Application
Service
ProviderGet unauthorized
request token
34. Developer DayGoogle 2010
PubSubHubbub
2.Subscriber POSTs subscription request to the Hub.
The request contains the URL where the Hub
should POST new updates to the Subscriber.
Publisher SubscriberHub
I want to
subscribe to feed
X. Send updates to
this URL
35. Developer DayGoogle 2010
PubSubHubbub
3.Hub hits the URL to verify the request was
authentic; Subscriber responds with confirmation to
the Hub.
Publisher SubscriberHub
Hey there! Did
you really send this
request?
36. Developer DayGoogle 2010
PubSubHubbub
3.Hub hits the URL to verify the request was
authentic; Subscriber responds with confirmation to
the Hub.
Publisher SubscriberHub
Yup, that was
really me, not a
DoS attacker.
37. Developer DayGoogle 2010
PubSubHubbub
4.a) Publisher notifies Hub about updates by
POSTing feed URLs to the Hub; Hub pulls the feed
again to find new entries.
I have new
content for feed
X for you!
Publisher SubscriberHub
38. Developer DayGoogle 2010
PubSubHubbub
Give me
your latest
content for feed
X, please.
Publisher SubscriberHub
4.a) Publisher notifies Hub about updates by
POSTing feed URLs to the Hub; Hub pulls the feed
again to find new entries.
39. Developer DayGoogle 2010
PubSubHubbub
Here you go.
Publisher SubscriberHub
4.a) Publisher notifies Hub about updates by
POSTing feed URLs to the Hub; Hub pulls the feed
again to find new entries.
40. Developer DayGoogle 2010
PubSubHubbub
4.b) If the Publisher does not inform the Hub, the Hub
will periodically poll the Publisher’s feed for new
updates.
Give me
your latest
content for feed
X, please.
Publisher SubscriberHub
41. Developer DayGoogle 2010
PubSubHubbub
Here you go.
Publisher SubscriberHub
4.b) If the Publisher does not inform the Hub, the Hub
will periodically poll the Publisher’s feed for new
updates.
42. Developer DayGoogle 2010
PubSubHubbub
New update
to feed X! Here
you go.
Publisher SubscriberHub
5.When Hub receives new update to feed X, it POSTs
the update to the Subscriber’s endpoint URL.
43. Developer DayGoogle 2010
PubSubHubbub
New update
to feed X! Here
you go.
Publisher SubscriberHub
6.If feed X has multiple subscribers, the Hub sends
updates to all of them. This reduces load on the
Publisher.
SubscriberSubscriberSubscriberSubscriberSubscriber
47. Developer DayGoogle 2010
Salmon
Source Aggregator
PubSubHubbub
I have a new
entry
1.New entry is posted on Source, pushed to
subscribers via mechanisms such as
PubSubHubbub, and re-published by an
Aggregator.
48. Developer DayGoogle 2010
Salmon
Source Aggregator
A new entry? I
will re-publish it
right away.
1.New entry is posted on Source, pushed to
subscribers via mechanisms such as
PubSubHubbub, and re-published by an
Aggregator.
PubSubHubbub
49. Developer DayGoogle 2010
Salmon
Source Aggregator
Salmon
I have a new
comment on that
entry from you!
2.New comment is posted on the Aggregator. It
pushes the comment back upstream to the Source
using Salmon
50. Developer DayGoogle 2010
Salmon
Source Aggregator
2.New comment is posted on the Aggregator. It
pushes the comment back upstream to the Source
using Salmon
A new comment? I
will publish it in the thread
right away [*].
Salmon
[*] After using magic security pixie dust to verify provenance.
120. Developer DayGoogle 2010
Sign-In & Auth for Buzz
request_token =
client.fetch_oauth_request_token(
'http://example.com/oauth/callback/'
)
# Save request token to the data store
authorization_url =
client.build_oauth_authorization_url(
request_token
)
124. Developer DayGoogle 2010
Sign-In & Auth for Buzz
verifier = request.get('oauth_verifier')
# Lookup request_token in data store
client.oauth_request_token = request_token
access_token =
client.fetch_oauth_access_token(verifier)
# Save access token to the data store
132. Developer DayGoogle 2010
Board Marked
if post.attachments:
for attachment in post.attachments:
if attachment.type == 'article':
self.award_badge('share')
break
if post.geocode and
post.actor.id != self.key().name():
self.award_badge('geo')
elif post.geocode:
self.award_badge('mobile')
133. Developer DayGoogle 2010
Board Marked
# Create the attachments for the post
badge_attachment = buzz.Attachment(
type='photo', enclosure=badge.badge_icon
)
link_attachment = buzz.Attachment(
type='article',
title='Buzz Bingo',
uri='http://buzz-bingo.appspot.com/'
)
134. Developer DayGoogle 2010
Board Marked
# Assemble our announcement Buzz post
badge_post = buzz.Post(
content=post_content,
attachments=[
badge_attachment,
link_attachment
],
geocode=VENUE_GEOCODE,
place_id=VENUE_PLACE_ID
)
# Create the post
self.client.create_post(badge_post)