<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.mozilla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sdasilva</id>
	<title>MozillaWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mozilla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sdasilva"/>
	<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/Special:Contributions/Sdasilva"/>
	<updated>2026-08-14T05:32:29Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-05-03&amp;diff=304821</id>
		<title>CloudServices/Meetings/2011-05-03</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-05-03&amp;diff=304821"/>
		<updated>2011-05-03T05:40:55Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Notifications (Shane/Alex) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MeetingInfo&lt;br /&gt;
|dayOfWeek=Tuesday&lt;br /&gt;
|est=12:15 PM&lt;br /&gt;
|pst=9:15 AM&lt;br /&gt;
|utc=5:15 PM&lt;br /&gt;
|room=Mozilla HQ, North Bridge&lt;br /&gt;
|confId=8616&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[https://mail.mozilla.com/home/rnewman@mozilla.com/Services%20Team%20Availability.html Who&#039;s away?]&#039;&#039;&#039;: rnewman.&lt;br /&gt;
&lt;br /&gt;
= Technical  =&lt;br /&gt;
&lt;br /&gt;
== Ops  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Engineering ==&lt;br /&gt;
&lt;br /&gt;
=== Python Sync Server (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Python Registration Server (reg/sreg) (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
* will work this week on some sreg changes w/ Toby. Everything should be ready next monday&lt;br /&gt;
&lt;br /&gt;
=== PHP Sync Server (Toby) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Identity Server (JR/rnewman) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== F1 (Share) (Philipp/Tarek) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Firefox Home (Stefan) ===&lt;br /&gt;
&lt;br /&gt;
=== Sync Client (rnewman) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Monitoring and Blocking (rtilder) ===&lt;br /&gt;
&lt;br /&gt;
=== Notifications (Shane/Alex) ===&lt;br /&gt;
* Neither of us are here anymore, but thanks for still putting our names in the header :)&lt;br /&gt;
&lt;br /&gt;
=== QA (tracy) ===&lt;br /&gt;
&lt;br /&gt;
= Deployment Requests =&lt;br /&gt;
&lt;br /&gt;
As per the [[Services/Process/ServerReleaseProcess|production release process]] any production change requests for the next release window (Monday afternoon) must be called out here by the developer requesting the update, with all required bugs/test plans already complete by the start of the meeting.&lt;br /&gt;
&lt;br /&gt;
* keyexchange 0.3-1, {{bug|650328}}&lt;br /&gt;
* Python Registration Server, {{bug|654148}}&lt;br /&gt;
* sreg/reg update OS in staging - need a bug&lt;br /&gt;
&lt;br /&gt;
= Metrics  =&lt;br /&gt;
&lt;br /&gt;
= Product =&lt;br /&gt;
&lt;br /&gt;
= Security =&lt;br /&gt;
&lt;br /&gt;
= Marketing  =&lt;br /&gt;
&lt;br /&gt;
= Roundtable  =&lt;br /&gt;
&lt;br /&gt;
== Notes and actions ==&lt;br /&gt;
&lt;br /&gt;
== Follow ups from last week ==&lt;br /&gt;
&lt;br /&gt;
=== Other issues ===&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-05-03&amp;diff=304820</id>
		<title>CloudServices/Meetings/2011-05-03</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-05-03&amp;diff=304820"/>
		<updated>2011-05-03T05:40:25Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Notifications (Shane/Alex) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MeetingInfo&lt;br /&gt;
|dayOfWeek=Tuesday&lt;br /&gt;
|est=12:15 PM&lt;br /&gt;
|pst=9:15 AM&lt;br /&gt;
|utc=5:15 PM&lt;br /&gt;
|room=Mozilla HQ, North Bridge&lt;br /&gt;
|confId=8616&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[https://mail.mozilla.com/home/rnewman@mozilla.com/Services%20Team%20Availability.html Who&#039;s away?]&#039;&#039;&#039;: rnewman.&lt;br /&gt;
&lt;br /&gt;
= Technical  =&lt;br /&gt;
&lt;br /&gt;
== Ops  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Engineering ==&lt;br /&gt;
&lt;br /&gt;
=== Python Sync Server (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Python Registration Server (reg/sreg) (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
* will work this week on some sreg changes w/ Toby. Everything should be ready next monday&lt;br /&gt;
&lt;br /&gt;
=== PHP Sync Server (Toby) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Identity Server (JR/rnewman) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== F1 (Share) (Philipp/Tarek) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Firefox Home (Stefan) ===&lt;br /&gt;
&lt;br /&gt;
=== Sync Client (rnewman) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Monitoring and Blocking (rtilder) ===&lt;br /&gt;
&lt;br /&gt;
=== Notifications (Shane/Alex) ===&lt;br /&gt;
* Neither of us are here, but thanks for still putting our names in the header :)&lt;br /&gt;
&lt;br /&gt;
=== QA (tracy) ===&lt;br /&gt;
&lt;br /&gt;
= Deployment Requests =&lt;br /&gt;
&lt;br /&gt;
As per the [[Services/Process/ServerReleaseProcess|production release process]] any production change requests for the next release window (Monday afternoon) must be called out here by the developer requesting the update, with all required bugs/test plans already complete by the start of the meeting.&lt;br /&gt;
&lt;br /&gt;
* keyexchange 0.3-1, {{bug|650328}}&lt;br /&gt;
* Python Registration Server, {{bug|654148}}&lt;br /&gt;
* sreg/reg update OS in staging - need a bug&lt;br /&gt;
&lt;br /&gt;
= Metrics  =&lt;br /&gt;
&lt;br /&gt;
= Product =&lt;br /&gt;
&lt;br /&gt;
= Security =&lt;br /&gt;
&lt;br /&gt;
= Marketing  =&lt;br /&gt;
&lt;br /&gt;
= Roundtable  =&lt;br /&gt;
&lt;br /&gt;
== Notes and actions ==&lt;br /&gt;
&lt;br /&gt;
== Follow ups from last week ==&lt;br /&gt;
&lt;br /&gt;
=== Other issues ===&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-04-26&amp;diff=302712</id>
		<title>CloudServices/Meetings/2011-04-26</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-04-26&amp;diff=302712"/>
		<updated>2011-04-26T16:23:10Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MeetingInfo&lt;br /&gt;
|dayOfWeek=Tuesday&lt;br /&gt;
|est=12:15 PM&lt;br /&gt;
|pst=9:15 AM&lt;br /&gt;
|utc=5:15 PM&lt;br /&gt;
|room=Mozilla HQ, North Bridge&lt;br /&gt;
|confId=8616&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[https://mail.mozilla.com/home/rnewman@mozilla.com/Services%20Team%20Availability.html Who&#039;s away?]&#039;&#039;&#039;: philiKON.&lt;br /&gt;
&lt;br /&gt;
= Technical  =&lt;br /&gt;
&lt;br /&gt;
== Ops  ==&lt;br /&gt;
*Build for loadtest cluster in SCL2 blocked on NetOps (bug [https://bugzilla.mozilla.org/show_bug.cgi?id=649212 649212]). Actively working with NetOps to move forward.&lt;br /&gt;
&lt;br /&gt;
== Engineering ==&lt;br /&gt;
&lt;br /&gt;
=== Python Sync Server (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
* waiting for the test cluster to work out the deployment w/ Pete&lt;br /&gt;
&lt;br /&gt;
=== Python Registration Server (reg/sreg) (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
* will work this week on some sreg changes w/ Toby. Everything should be ready next monday&lt;br /&gt;
&lt;br /&gt;
=== PHP Sync Server (Toby) ===&lt;br /&gt;
Updates to handle new LDAP schema deployed yesterday. No problems noted.&lt;br /&gt;
&lt;br /&gt;
=== Identity Server (JR/rnewman) ===&lt;br /&gt;
* added write checking to mongo db storage&lt;br /&gt;
* clean up of display pages (more consistent UI)&lt;br /&gt;
* added test cases for new functions&lt;br /&gt;
* began work on redis rebuild for new system&lt;br /&gt;
* Stefan booting work environment&lt;br /&gt;
&lt;br /&gt;
Next:&lt;br /&gt;
&lt;br /&gt;
* finish redis rebuild.&lt;br /&gt;
* review w/ Thunder&lt;br /&gt;
* send code to QA for testing&lt;br /&gt;
&lt;br /&gt;
=== F1 (Share) (Philipp/Tarek) ===&lt;br /&gt;
&lt;br /&gt;
* Server-side&lt;br /&gt;
** working on the libmemcached client to talk to membase this week [tarek]&lt;br /&gt;
* Client&lt;br /&gt;
** {{bug|651668}} tracks minimal landing in Firefox&lt;br /&gt;
** {{bug|642684}} tracks final UX for minimal landing&lt;br /&gt;
&lt;br /&gt;
=== Firefox Home (Stefan) ===&lt;br /&gt;
&lt;br /&gt;
=== Sync Client (rnewman) ===&lt;br /&gt;
&lt;br /&gt;
Handed off to QA (thanks philiKON for the bug list):&lt;br /&gt;
&lt;br /&gt;
* Bug 649783 [STRs]: don&#039;t attempt to delete client-specific data if Sync doesn&#039;t have a cluster URL.&lt;br /&gt;
* Bug 649739 [qa-]: send userabort reason for J-PAKE cancelation.&lt;br /&gt;
* Bug 648371 [qa-]: Convert async tests to use run_next_test helper.&lt;br /&gt;
* Bug 646910 [qa-]: attempt to fix random orange in test_clients_engine.&lt;br /&gt;
* Bug 645918 [qa-]: attempt to fix random orange in test_bookmarks_engine.&lt;br /&gt;
* Bug 650208 [STRs]: More considered handling of key generation&lt;br /&gt;
* Bug 651596 [qa-]: eliminate IWeaveCrypto.&lt;br /&gt;
* Bug 652182 [qa-]: eliminate Resource status == 0 check missed in landing of Bug 623080.&lt;br /&gt;
* Bug 652666 [STRs]: fix a missing rename in prefs engine.&lt;br /&gt;
* Bug 652341 [STRs] - Firefox Sync key document doesn&#039;t align to the right on RTL&lt;br /&gt;
&lt;br /&gt;
We have the Alder branch for [[Services/Sync/FxSync/WarOnSync|War on Sync]], and I&#039;m busy [https://github.com/rnewman/alder hacking away on GitHub].&lt;br /&gt;
&lt;br /&gt;
=== Monitoring and Blocking (rtilder) ===&lt;br /&gt;
&lt;br /&gt;
=== Notifications (Shane/Alex) ===&lt;br /&gt;
==== Client ====&lt;br /&gt;
*Got together a TODO list for remaining items.&lt;br /&gt;
*Currently working on a more centralized error handling to prevent random English strings moving around in code ( and will l10n them after).&lt;br /&gt;
*Most work involved in cleaning up the code for ease of readability.&lt;br /&gt;
*Will also work on writing a complete set of tests for AMQP (or document them in the least).&lt;br /&gt;
==== Server ====&lt;br /&gt;
* Finished harnessing and writing tests for Client Agent&lt;br /&gt;
* Now beginning process of writing documentation/general brain dump for server to get successor up to speed faster&lt;br /&gt;
&lt;br /&gt;
=== QA (tracy) ===&lt;br /&gt;
* Sync s-c client sign-off EOD today (4/26)&lt;br /&gt;
* Expecting hand-off from server team on Wednesday. Will sign-off by EOD Friday (4/29)&lt;br /&gt;
* Finalize services QA plan based on the strategy of weekly pushes of s-c to m-c.&lt;br /&gt;
* Tony is in the process of interviewing a few candidates for services QA positions. &lt;br /&gt;
* Meeting with thunder today to discuss QA for Identity.&lt;br /&gt;
&lt;br /&gt;
= Deployment Requests =&lt;br /&gt;
&lt;br /&gt;
As per the [[Services/Process/ServerReleaseProcess|production release process]] any production change requests for the next release window (Monday afternoon) must be called out here by the developer requesting the update, with all required bugs/test plans already complete by the start of the meeting.&lt;br /&gt;
&lt;br /&gt;
== Key Exchange Server ==&lt;br /&gt;
&lt;br /&gt;
* keyexchange 0.3-1, {{bug|650328}}&lt;br /&gt;
&lt;br /&gt;
== Python Reg/Sreg ==&lt;br /&gt;
&lt;br /&gt;
Likely to happen after Tarek and Toby talk today. Will have details this afternoon.&lt;br /&gt;
&lt;br /&gt;
= Metrics  =&lt;br /&gt;
&lt;br /&gt;
= Product =&lt;br /&gt;
&lt;br /&gt;
= Security =&lt;br /&gt;
&lt;br /&gt;
= Marketing  =&lt;br /&gt;
&lt;br /&gt;
= Roundtable  =&lt;br /&gt;
&lt;br /&gt;
* Last chance to harass Justin&lt;br /&gt;
&lt;br /&gt;
== Notes and actions ==&lt;br /&gt;
&lt;br /&gt;
== Follow ups from last week ==&lt;br /&gt;
&lt;br /&gt;
=== Other issues ===&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-04-26&amp;diff=302710</id>
		<title>CloudServices/Meetings/2011-04-26</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-04-26&amp;diff=302710"/>
		<updated>2011-04-26T16:22:20Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Notifications (Shane/Alex) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MeetingInfo&lt;br /&gt;
|dayOfWeek=Tuesday&lt;br /&gt;
|est=12:15 PM&lt;br /&gt;
|pst=9:15 AM&lt;br /&gt;
|utc=5:15 PM&lt;br /&gt;
|room=Mozilla HQ, North Bridge&lt;br /&gt;
|confId=8616&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[https://mail.mozilla.com/home/rnewman@mozilla.com/Services%20Team%20Availability.html Who&#039;s away?]&#039;&#039;&#039;: philiKON.&lt;br /&gt;
&lt;br /&gt;
= Technical  =&lt;br /&gt;
&lt;br /&gt;
== Ops  ==&lt;br /&gt;
*Build for loadtest cluster in SCL2 blocked on NetOps (bug [https://bugzilla.mozilla.org/show_bug.cgi?id=649212 649212]). Actively working with NetOps to move forward.&lt;br /&gt;
&lt;br /&gt;
== Engineering ==&lt;br /&gt;
&lt;br /&gt;
=== Python Sync Server (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
* waiting for the test cluster to work out the deployment w/ Pete&lt;br /&gt;
&lt;br /&gt;
=== Python Registration Server (reg/sreg) (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
* will work this week on some sreg changes w/ Toby. Everything should be ready next monday&lt;br /&gt;
&lt;br /&gt;
=== PHP Sync Server (Toby) ===&lt;br /&gt;
Updates to handle new LDAP schema deployed yesterday. No problems noted.&lt;br /&gt;
&lt;br /&gt;
=== Identity Server (JR/rnewman) ===&lt;br /&gt;
&lt;br /&gt;
=== F1 (Share) (Philipp/Tarek) ===&lt;br /&gt;
&lt;br /&gt;
* Server-side&lt;br /&gt;
** working on the libmemcached client to talk to membase this week [tarek]&lt;br /&gt;
* Client&lt;br /&gt;
** {{bug|651668}} tracks minimal landing in Firefox&lt;br /&gt;
** {{bug|642684}} tracks final UX for minimal landing&lt;br /&gt;
&lt;br /&gt;
=== Firefox Home (Stefan) ===&lt;br /&gt;
&lt;br /&gt;
=== Sync Client (rnewman) ===&lt;br /&gt;
&lt;br /&gt;
Handed off to QA (thanks philiKON for the bug list):&lt;br /&gt;
&lt;br /&gt;
* Bug 649783 [STRs]: don&#039;t attempt to delete client-specific data if Sync doesn&#039;t have a cluster URL.&lt;br /&gt;
* Bug 649739 [qa-]: send userabort reason for J-PAKE cancelation.&lt;br /&gt;
* Bug 648371 [qa-]: Convert async tests to use run_next_test helper.&lt;br /&gt;
* Bug 646910 [qa-]: attempt to fix random orange in test_clients_engine.&lt;br /&gt;
* Bug 645918 [qa-]: attempt to fix random orange in test_bookmarks_engine.&lt;br /&gt;
* Bug 650208 [STRs]: More considered handling of key generation&lt;br /&gt;
* Bug 651596 [qa-]: eliminate IWeaveCrypto.&lt;br /&gt;
* Bug 652182 [qa-]: eliminate Resource status == 0 check missed in landing of Bug 623080.&lt;br /&gt;
* Bug 652666 [STRs]: fix a missing rename in prefs engine.&lt;br /&gt;
* Bug 652341 [STRs] - Firefox Sync key document doesn&#039;t align to the right on RTL&lt;br /&gt;
&lt;br /&gt;
We have the Alder branch for [[Services/Sync/FxSync/WarOnSync|War on Sync]], and I&#039;m busy [https://github.com/rnewman/alder hacking away on GitHub].&lt;br /&gt;
&lt;br /&gt;
=== Monitoring and Blocking (rtilder) ===&lt;br /&gt;
&lt;br /&gt;
=== Notifications (Shane/Alex) ===&lt;br /&gt;
==== Client ====&lt;br /&gt;
*Got together a TODO list for remaining items.&lt;br /&gt;
*Currently working on a more centralized error handling to prevent random English strings moving around in code ( and will l10n them after).&lt;br /&gt;
*Most work involved in cleaning up the code for ease of readability.&lt;br /&gt;
*Will also work on writing a complete set of tests for AMQP (or document them in the least).&lt;br /&gt;
==== Server ====&lt;br /&gt;
* Finished harnessing and writing tests for Client Agent&lt;br /&gt;
* Now beginning process of writing documentation for server for successor&lt;br /&gt;
&lt;br /&gt;
=== QA (tracy) ===&lt;br /&gt;
* Sync s-c client sign-off EOD today (4/26)&lt;br /&gt;
* Expecting hand-off from server team on Wednesday. Will sign-off by EOD Friday (4/29)&lt;br /&gt;
* Finalize services QA plan based on the strategy of weekly pushes of s-c to m-c.&lt;br /&gt;
* Tony is in the process of interviewing a few candidates for services QA positions. &lt;br /&gt;
* Meeting with thunder today to discuss QA for Identity.&lt;br /&gt;
&lt;br /&gt;
= Deployment Requests =&lt;br /&gt;
&lt;br /&gt;
As per the [[Services/Process/ServerReleaseProcess|production release process]] any production change requests for the next release window (Monday afternoon) must be called out here by the developer requesting the update, with all required bugs/test plans already complete by the start of the meeting.&lt;br /&gt;
&lt;br /&gt;
== Key Exchange Server ==&lt;br /&gt;
&lt;br /&gt;
* keyexchange 0.3-1, {{bug|650328}}&lt;br /&gt;
&lt;br /&gt;
== Python Reg/Sreg ==&lt;br /&gt;
&lt;br /&gt;
Likely to happen after Tarek and Toby talk today. Will have details this afternoon.&lt;br /&gt;
&lt;br /&gt;
= Metrics  =&lt;br /&gt;
&lt;br /&gt;
= Product =&lt;br /&gt;
&lt;br /&gt;
= Security =&lt;br /&gt;
&lt;br /&gt;
= Marketing  =&lt;br /&gt;
&lt;br /&gt;
= Roundtable  =&lt;br /&gt;
&lt;br /&gt;
* Last chance to harass Justin&lt;br /&gt;
&lt;br /&gt;
== Notes and actions ==&lt;br /&gt;
&lt;br /&gt;
== Follow ups from last week ==&lt;br /&gt;
&lt;br /&gt;
=== Other issues ===&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Server&amp;diff=299724</id>
		<title>CloudServices/Notifications/Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Server&amp;diff=299724"/>
		<updated>2011-04-15T23:43:18Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Provide Mechanism to Move Client to a Different POST Office */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following page contains a list of open discussion points about the &#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; server.&lt;br /&gt;
&lt;br /&gt;
= Hide Broker Behind HTTP REST API =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Can pool multiple connections into one connection (using multiple channels on that one connection)&lt;br /&gt;
* Simpler for developers to build their own client (just do long-lived HTTP requests)&lt;br /&gt;
* Better security by preventing direct access to broker (if broker has a security hole, we would need to wait for a fix)&lt;br /&gt;
* Allows us to abstract away how messages are routed&lt;br /&gt;
* Allows us to support idea #7 by returning a 302 directing client to the new POST Office&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Extra server overhead&lt;br /&gt;
&lt;br /&gt;
= Enforce Exclusive Queues =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Easy to do with AMQP&lt;br /&gt;
* Extra security: can tell if someone else is &amp;quot;snooping&amp;quot; on your queue and take action (create a new one, forward all messages to new queue, delete old queue)&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Can&#039;t &amp;quot;share&amp;quot; single queue amongst multiple clients (not sure if we even want this -- does it even make sense?)&lt;br /&gt;
&lt;br /&gt;
= Persistent POST Office Connections =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Makes it easier for us to detect a DoS attack? (Apple uses this approach with APNS)&lt;br /&gt;
* Allow web apps to send bulk transfer of notifications (very useful for bulk senders like GMail)&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Makes it more complicated for providers as it requires they have a pool of persistent connections with which to send notifications&lt;br /&gt;
* Adds complexity to POST Office so we can support it?&lt;br /&gt;
&lt;br /&gt;
= Implement TTLs for Queues (and Messages) =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Easy to do with RabbitMQ extensions (see http://www.rabbitmq.com/extensions.html#queue-ttl and http://www.rabbitmq.com/extensions.html#queue-leases)&lt;br /&gt;
* Prevents server from being flooded with old messages that will never be read&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Could this be annoying for users? Probably not so long as we have a long enough TTL and make it clear to users it&#039;s enforced.&lt;br /&gt;
&lt;br /&gt;
= Alert Providers When Subscription Cancelled =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Providers only send notifications to &amp;quot;active&amp;quot; subscriptions (saves resources)&lt;br /&gt;
== Cons ==&lt;br /&gt;
* To return error message from POST Office would be time consuming and would probably make the service incapable of large spikes in traffic (so we shouldn&#039;t do this)&lt;br /&gt;
* To return an error message asynchronously would require providers build a separate service for accepting cancellation messages. Another option is to have clients send a cancellation message, but this really should be done by the Client Agent to maintain users&#039; anonymity (or should it?)&lt;br /&gt;
&lt;br /&gt;
= Send ACK to Provider When Notification Received =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Can support messages for which delivery must be assured&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Requires we build an entire messaging system that goes the other way? OR we could just reuse the current framework and have providers subscribe as a client. OR (even better) we could just spec a special notification type that allows the client to confirm the receipt of a notification (i.e. include a URL client can send ACK to).&lt;br /&gt;
&lt;br /&gt;
= Provide Mechanism to Move Client to a Different POST Office =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Allows us to re-balance our servers&lt;br /&gt;
* Gives users the power to move from Mozilla to their own server&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Could have security implications? (if attacker took control of Mozilla&#039;s servers and moved all its users to another notification server, for example)&lt;br /&gt;
&lt;br /&gt;
= Make POST Office in Charge of Generating Subscription Token =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* One less thing clients can screw up (also prevents generation of insecure tokens such as AAAAAAA...A)&lt;br /&gt;
== Cons ==&lt;br /&gt;
* If other users implemented a POST Office, they could assign tokens that are personally identifying (is this really something we need to worry about? Who would even bother doing this?)&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Server&amp;diff=299377</id>
		<title>CloudServices/Notifications/Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Server&amp;diff=299377"/>
		<updated>2011-04-15T00:40:17Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Alert Providers When Subscription Cancelled = */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following page contains a list of open discussion points about the &#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; server.&lt;br /&gt;
&lt;br /&gt;
= Hide Broker Behind HTTP REST API =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Can pool multiple connections into one connection (using multiple channels on that one connection)&lt;br /&gt;
* Simpler for developers to build their own client (just do long-lived HTTP requests)&lt;br /&gt;
* Better security by preventing direct access to broker (if broker has a security hole, we would need to wait for a fix)&lt;br /&gt;
* Allows us to abstract away how messages are routed&lt;br /&gt;
* Allows us to support idea #7 by returning a 302 directing client to the new POST Office&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Extra server overhead&lt;br /&gt;
&lt;br /&gt;
= Enforce Exclusive Queues =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Easy to do with AMQP&lt;br /&gt;
* Extra security: can tell if someone else is &amp;quot;snooping&amp;quot; on your queue and take action (create a new one, forward all messages to new queue, delete old queue)&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Can&#039;t &amp;quot;share&amp;quot; single queue amongst multiple clients (not sure if we even want this -- does it even make sense?)&lt;br /&gt;
&lt;br /&gt;
= Persistent POST Office Connections =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Makes it easier for us to detect a DoS attack? (Apple uses this approach with APNS)&lt;br /&gt;
* Allow web apps to send bulk transfer of notifications (very useful for bulk senders like GMail)&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Makes it more complicated for providers as it requires they have a pool of persistent connections with which to send notifications&lt;br /&gt;
* Adds complexity to POST Office so we can support it?&lt;br /&gt;
&lt;br /&gt;
= Implement TTLs for Queues (and Messages) =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Easy to do with RabbitMQ extensions (see http://www.rabbitmq.com/extensions.html#queue-ttl and http://www.rabbitmq.com/extensions.html#queue-leases)&lt;br /&gt;
* Prevents server from being flooded with old messages that will never be read&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Could this be annoying for users? Probably not so long as we have a long enough TTL and make it clear to users it&#039;s enforced.&lt;br /&gt;
&lt;br /&gt;
= Alert Providers When Subscription Cancelled =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Providers only send notifications to &amp;quot;active&amp;quot; subscriptions (saves resources)&lt;br /&gt;
== Cons ==&lt;br /&gt;
* To return error message from POST Office would be time consuming and would probably make the service incapable of large spikes in traffic (so we shouldn&#039;t do this)&lt;br /&gt;
* To return an error message asynchronously would require providers build a separate service for accepting cancellation messages. Another option is to have clients send a cancellation message, but this really should be done by the Client Agent to maintain users&#039; anonymity (or should it?)&lt;br /&gt;
&lt;br /&gt;
= Send ACK to Provider When Notification Received =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Can support messages for which delivery must be assured&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Requires we build an entire messaging system that goes the other way? OR we could just reuse the current framework and have providers subscribe as a client. OR (even better) we could just spec a special notification type that allows the client to confirm the receipt of a notification (i.e. include a URL client can send ACK to).&lt;br /&gt;
&lt;br /&gt;
= Provide Mechanism to Move Client to a Different POST Office =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Allows us to re-balance our servers&lt;br /&gt;
* Gives users the power to move from Mozilla to their own server&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Could have security implications? (if attacker took control of Mozilla&#039;s servers and moved all its users to another notification server, for example)&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Server&amp;diff=299376</id>
		<title>CloudServices/Notifications/Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Server&amp;diff=299376"/>
		<updated>2011-04-15T00:39:25Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: Created page with &amp;quot;The following page contains a list of open discussion points about the &amp;#039;&amp;#039;&amp;#039;Mozilla Push Notifications&amp;#039;&amp;#039;&amp;#039; server.  = Hide Broker Behind HTTP REST API = == Pros == * Can pool multip...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following page contains a list of open discussion points about the &#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; server.&lt;br /&gt;
&lt;br /&gt;
= Hide Broker Behind HTTP REST API =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Can pool multiple connections into one connection (using multiple channels on that one connection)&lt;br /&gt;
* Simpler for developers to build their own client (just do long-lived HTTP requests)&lt;br /&gt;
* Better security by preventing direct access to broker (if broker has a security hole, we would need to wait for a fix)&lt;br /&gt;
* Allows us to abstract away how messages are routed&lt;br /&gt;
* Allows us to support idea #7 by returning a 302 directing client to the new POST Office&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Extra server overhead&lt;br /&gt;
&lt;br /&gt;
= Enforce Exclusive Queues =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Easy to do with AMQP&lt;br /&gt;
* Extra security: can tell if someone else is &amp;quot;snooping&amp;quot; on your queue and take action (create a new one, forward all messages to new queue, delete old queue)&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Can&#039;t &amp;quot;share&amp;quot; single queue amongst multiple clients (not sure if we even want this -- does it even make sense?)&lt;br /&gt;
&lt;br /&gt;
= Persistent POST Office Connections =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Makes it easier for us to detect a DoS attack? (Apple uses this approach with APNS)&lt;br /&gt;
* Allow web apps to send bulk transfer of notifications (very useful for bulk senders like GMail)&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Makes it more complicated for providers as it requires they have a pool of persistent connections with which to send notifications&lt;br /&gt;
* Adds complexity to POST Office so we can support it?&lt;br /&gt;
&lt;br /&gt;
= Implement TTLs for Queues (and Messages) =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Easy to do with RabbitMQ extensions (see http://www.rabbitmq.com/extensions.html#queue-ttl and http://www.rabbitmq.com/extensions.html#queue-leases)&lt;br /&gt;
* Prevents server from being flooded with old messages that will never be read&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Could this be annoying for users? Probably not so long as we have a long enough TTL and make it clear to users it&#039;s enforced.&lt;br /&gt;
&lt;br /&gt;
= Alert Providers When Subscription Cancelled ==&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Providers only send notifications to &amp;quot;active&amp;quot; subscriptions (saves resources)&lt;br /&gt;
== Cons ==&lt;br /&gt;
* To return error message from POST Office would be time consuming and would probably make the service incapable of large spikes in traffic (so we shouldn&#039;t do this)&lt;br /&gt;
* To return an error message asynchronously would require providers build a separate service for accepting cancellation messages. Another option is to have clients send a cancellation message, but this really should be done by the Client Agent to maintain users&#039; anonymity (or should it?)&lt;br /&gt;
&lt;br /&gt;
= Send ACK to Provider When Notification Received =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Can support messages for which delivery must be assured&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Requires we build an entire messaging system that goes the other way? OR we could just reuse the current framework and have providers subscribe as a client. OR (even better) we could just spec a special notification type that allows the client to confirm the receipt of a notification (i.e. include a URL client can send ACK to).&lt;br /&gt;
&lt;br /&gt;
= Provide Mechanism to Move Client to a Different POST Office =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* Allows us to re-balance our servers&lt;br /&gt;
* Gives users the power to move from Mozilla to their own server&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Could have security implications? (if attacker took control of Mozilla&#039;s servers and moved all its users to another notification server, for example)&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299349</id>
		<title>CloudServices/Notifications/Specification/POSTOffice</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299349"/>
		<updated>2011-04-14T22:26:56Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Message HMAC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The POST Office supports a very simple REST API, allowing web apps to send notifications to a subscription token.&lt;br /&gt;
&lt;br /&gt;
= Sending Notifications =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Web app sends notification to POST Office.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W: POST /1.0/notification HTTP/1.1&lt;br /&gt;
W:&lt;br /&gt;
W: {&lt;br /&gt;
     &amp;quot;body&amp;quot;: &amp;quot;{\&amp;quot;token\&amp;quot;:\&amp;quot;BASE64==\&amp;quot;, ...}&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
P: HTTP/1.1 202 ACCEPTED&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Message Body ==&lt;br /&gt;
The &amp;quot;body&amp;quot; field of the message is a JSON serialization of the message metadata and the encrypted payload. Metadata includes the subscription token, when the message was sent, and when the message expires. The metadata should be thought of as information that aids in routing the message to its intended recipient, as well as providing any other information about the message that may be of use while it is en-route. Any other information should be placed in the encrypted payload to ensure privacy.&lt;br /&gt;
&lt;br /&gt;
A typical message body would look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &lt;br /&gt;
  &amp;quot;token&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Subscription Token&lt;br /&gt;
  &amp;quot;timestamp&amp;quot;: ########, // UTC Timestamp in seconds (OPTIONAL)&lt;br /&gt;
  &amp;quot;ttl&amp;quot;: ######## (in seconds), // Time To Live in seconds (OPTIONAL)&lt;br /&gt;
  &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Encrypted payload&lt;br /&gt;
  &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot; // Initialization vector to use in decrypting ciphertext&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;body&amp;quot; field is a serialized JSON object to emphasize the fact that the value in the associated &amp;quot;HMAC&amp;quot; field signs the entire contents of the &amp;quot;body&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
=== Ciphertext Contents ===&lt;br /&gt;
The &amp;quot;ciphertext&amp;quot; field is a string encrypted with the encryption key using AES-256-CBC and base-64 encoded. The contents of the payload differ based on the type of message, however it is typically a serialized JSON object. For example, the payload of a standard notification will look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;notification&amp;quot;,&lt;br /&gt;
  &amp;quot;title&amp;quot;: &amp;quot;You&#039;ve got mail!&amp;quot;,&lt;br /&gt;
  &amp;quot;body&amp;quot;: &amp;quot;There are current 2 messages in your inbox.&amp;quot;,&lt;br /&gt;
  &amp;quot;url&amp;quot;: &amp;quot;http://mail.google.com&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reason no specific format is required for the payload is that it should be up to clients to decide what kind of formats they wish to support. The higher-level goal is to build a secure &amp;quot;message-routing&amp;quot; solution. A push notification service is simply a special subset of a message routing solution.&lt;br /&gt;
&lt;br /&gt;
== Message HMAC ==&lt;br /&gt;
The &amp;quot;HMAC&amp;quot; field is included to verify that the message has not been tampered with by a third party. It is calculated by signing the contents of the &amp;quot;body&amp;quot; field using the standard [http://en.wikipedia.org/wiki/HMAC HMAC algorithm] with the [http://en.wikipedia.org/wiki/SHA-2#SHA-256_.28a_SHA-2_variant.29_pseudocode SHA-256 hash function].&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299348</id>
		<title>CloudServices/Notifications/Specification/POSTOffice</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299348"/>
		<updated>2011-04-14T22:26:17Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Message Body */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The POST Office supports a very simple REST API, allowing web apps to send notifications to a subscription token.&lt;br /&gt;
&lt;br /&gt;
= Sending Notifications =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Web app sends notification to POST Office.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W: POST /1.0/notification HTTP/1.1&lt;br /&gt;
W:&lt;br /&gt;
W: {&lt;br /&gt;
     &amp;quot;body&amp;quot;: &amp;quot;{\&amp;quot;token\&amp;quot;:\&amp;quot;BASE64==\&amp;quot;, ...}&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
P: HTTP/1.1 202 ACCEPTED&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Message Body ==&lt;br /&gt;
The &amp;quot;body&amp;quot; field of the message is a JSON serialization of the message metadata and the encrypted payload. Metadata includes the subscription token, when the message was sent, and when the message expires. The metadata should be thought of as information that aids in routing the message to its intended recipient, as well as providing any other information about the message that may be of use while it is en-route. Any other information should be placed in the encrypted payload to ensure privacy.&lt;br /&gt;
&lt;br /&gt;
A typical message body would look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &lt;br /&gt;
  &amp;quot;token&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Subscription Token&lt;br /&gt;
  &amp;quot;timestamp&amp;quot;: ########, // UTC Timestamp in seconds (OPTIONAL)&lt;br /&gt;
  &amp;quot;ttl&amp;quot;: ######## (in seconds), // Time To Live in seconds (OPTIONAL)&lt;br /&gt;
  &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Encrypted payload&lt;br /&gt;
  &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot; // Initialization vector to use in decrypting ciphertext&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;body&amp;quot; field is a serialized JSON object to emphasize the fact that the value in the associated &amp;quot;HMAC&amp;quot; field signs the entire contents of the &amp;quot;body&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
=== Ciphertext Contents ===&lt;br /&gt;
The &amp;quot;ciphertext&amp;quot; field is a string encrypted with the encryption key using AES-256-CBC and base-64 encoded. The contents of the payload differ based on the type of message, however it is typically a serialized JSON object. For example, the payload of a standard notification will look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;notification&amp;quot;,&lt;br /&gt;
  &amp;quot;title&amp;quot;: &amp;quot;You&#039;ve got mail!&amp;quot;,&lt;br /&gt;
  &amp;quot;body&amp;quot;: &amp;quot;There are current 2 messages in your inbox.&amp;quot;,&lt;br /&gt;
  &amp;quot;url&amp;quot;: &amp;quot;http://mail.google.com&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reason no specific format is required for the payload is that it should be up to clients to decide what kind of formats they wish to support. The higher-level goal is to build a secure &amp;quot;message-routing&amp;quot; solution. A push notification service is simply a special subset of a message routing solution.&lt;br /&gt;
&lt;br /&gt;
== Message HMAC ==&lt;br /&gt;
The &amp;quot;HMAC&amp;quot; field is included to verify that the message has not been tampered with by a third party. It is calculated by signing the contents of the &amp;quot;body&amp;quot; field using the standard [http://en.wikipedia.org/wiki/HMAC HMAC algorithm] with a [http://en.wikipedia.org/wiki/SHA-2#SHA-256_.28a_SHA-2_variant.29_pseudocode SHA-256 hash function].&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299347</id>
		<title>CloudServices/Notifications/Specification/POSTOffice</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299347"/>
		<updated>2011-04-14T22:25:47Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Ciphertext Contents */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The POST Office supports a very simple REST API, allowing web apps to send notifications to a subscription token.&lt;br /&gt;
&lt;br /&gt;
= Sending Notifications =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Web app sends notification to POST Office.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W: POST /1.0/notification HTTP/1.1&lt;br /&gt;
W:&lt;br /&gt;
W: {&lt;br /&gt;
     &amp;quot;body&amp;quot;: &amp;quot;{\&amp;quot;token\&amp;quot;:\&amp;quot;BASE64==\&amp;quot;, ...}&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
P: HTTP/1.1 202 ACCEPTED&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Message Body ==&lt;br /&gt;
The &amp;quot;body&amp;quot; field of the message is a JSON serialization of the message metadata and the encrypted payload. Metadata includes the subscription token, when the message was sent, and when the message expires. The metadata should be thought of as information that aids in routing the message to its intended recipient, as well as providing any other information about the message that may be of use while it is en-route. Any other information should be placed in the encrypted payload to ensure privacy.&lt;br /&gt;
&lt;br /&gt;
A typical message body would look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &lt;br /&gt;
  &amp;quot;token&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Subscription Token&lt;br /&gt;
  &amp;quot;timestamp&amp;quot;: ########, // UTC Timestamp in seconds (OPTIONAL)&lt;br /&gt;
  &amp;quot;ttl&amp;quot;: ######## (in seconds), // Time To Live in seconds (OPTIONAL)&lt;br /&gt;
  &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Encrypted payload&lt;br /&gt;
  &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Initialization vector to use in decrypting ciphertext&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;body&amp;quot; field is a serialized JSON object to emphasize the fact that the value in the associated &amp;quot;HMAC&amp;quot; field signs the entire contents of the &amp;quot;body&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
=== Ciphertext Contents ===&lt;br /&gt;
The &amp;quot;ciphertext&amp;quot; field is a string encrypted with the encryption key using AES-256-CBC and base-64 encoded. The contents of the payload differ based on the type of message, however it is typically a serialized JSON object. For example, the payload of a standard notification will look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;notification&amp;quot;,&lt;br /&gt;
  &amp;quot;title&amp;quot;: &amp;quot;You&#039;ve got mail!&amp;quot;,&lt;br /&gt;
  &amp;quot;body&amp;quot;: &amp;quot;There are current 2 messages in your inbox.&amp;quot;,&lt;br /&gt;
  &amp;quot;url&amp;quot;: &amp;quot;http://mail.google.com&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reason no specific format is required for the payload is that it should be up to clients to decide what kind of formats they wish to support. The higher-level goal is to build a secure &amp;quot;message-routing&amp;quot; solution. A push notification service is simply a special subset of a message routing solution.&lt;br /&gt;
&lt;br /&gt;
== Message HMAC ==&lt;br /&gt;
The &amp;quot;HMAC&amp;quot; field is included to verify that the message has not been tampered with by a third party. It is calculated by signing the contents of the &amp;quot;body&amp;quot; field using the standard [http://en.wikipedia.org/wiki/HMAC HMAC algorithm] with a [http://en.wikipedia.org/wiki/SHA-2#SHA-256_.28a_SHA-2_variant.29_pseudocode SHA-256 hash function].&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299346</id>
		<title>CloudServices/Notifications/Specification/POSTOffice</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299346"/>
		<updated>2011-04-14T22:25:30Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Ciphertext Contents */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The POST Office supports a very simple REST API, allowing web apps to send notifications to a subscription token.&lt;br /&gt;
&lt;br /&gt;
= Sending Notifications =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Web app sends notification to POST Office.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W: POST /1.0/notification HTTP/1.1&lt;br /&gt;
W:&lt;br /&gt;
W: {&lt;br /&gt;
     &amp;quot;body&amp;quot;: &amp;quot;{\&amp;quot;token\&amp;quot;:\&amp;quot;BASE64==\&amp;quot;, ...}&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
P: HTTP/1.1 202 ACCEPTED&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Message Body ==&lt;br /&gt;
The &amp;quot;body&amp;quot; field of the message is a JSON serialization of the message metadata and the encrypted payload. Metadata includes the subscription token, when the message was sent, and when the message expires. The metadata should be thought of as information that aids in routing the message to its intended recipient, as well as providing any other information about the message that may be of use while it is en-route. Any other information should be placed in the encrypted payload to ensure privacy.&lt;br /&gt;
&lt;br /&gt;
A typical message body would look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &lt;br /&gt;
  &amp;quot;token&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Subscription Token&lt;br /&gt;
  &amp;quot;timestamp&amp;quot;: ########, // UTC Timestamp in seconds (OPTIONAL)&lt;br /&gt;
  &amp;quot;ttl&amp;quot;: ######## (in seconds), // Time To Live in seconds (OPTIONAL)&lt;br /&gt;
  &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Encrypted payload&lt;br /&gt;
  &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Initialization vector to use in decrypting ciphertext&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;body&amp;quot; field is a serialized JSON object to emphasize the fact that the value in the associated &amp;quot;HMAC&amp;quot; field signs the entire contents of the &amp;quot;body&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
=== Ciphertext Contents ===&lt;br /&gt;
The &amp;quot;ciphertext&amp;quot; field is a string encrypted with the encryption key using AES-256-CBC and base-64 encoded. The contents of the payload differ based on the type of message, however it is typically a serialized JSON object. For example, the payload of a standard notification will look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;:&amp;quot;notification&amp;quot;,&lt;br /&gt;
  &amp;quot;title&amp;quot;:&amp;quot;You&#039;ve got mail!&amp;quot;,&lt;br /&gt;
  &amp;quot;body&amp;quot;:&amp;quot;There are current 2 messages in your inbox.&amp;quot;,&lt;br /&gt;
  &amp;quot;url&amp;quot;:&amp;quot;http://mail.google.com&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reason no specific format is required for the payload is that it should be up to clients to decide what kind of formats they wish to support. The higher-level goal is to build a secure &amp;quot;message-routing&amp;quot; solution. A push notification service is simply a special subset of a message routing solution.&lt;br /&gt;
&lt;br /&gt;
== Message HMAC ==&lt;br /&gt;
The &amp;quot;HMAC&amp;quot; field is included to verify that the message has not been tampered with by a third party. It is calculated by signing the contents of the &amp;quot;body&amp;quot; field using the standard [http://en.wikipedia.org/wiki/HMAC HMAC algorithm] with a [http://en.wikipedia.org/wiki/SHA-2#SHA-256_.28a_SHA-2_variant.29_pseudocode SHA-256 hash function].&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299345</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299345"/>
		<updated>2011-04-14T22:22:32Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Terminology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
== Engineers Involved  ==&lt;br /&gt;
&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
* Toby Elliott&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Notification&#039;&#039;&#039;: A message intended to alert its recipient to some event or occurrence.&lt;br /&gt;
* &#039;&#039;&#039;Provider&#039;&#039;&#039;: A notification provider, or &#039;&#039;&#039;web app&#039;&#039;&#039;, is any web service that is capable of sending notifications.&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: End-user; someone who receives notifications.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, third-party developers (a special type of user) who will have to interact with the system. It also outlines the requirements of the system itself.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Add a New Client|Add a New Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Add a New Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client (note: the goal is to have this be virtually identical to Firefox Sync).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option A: Using JPAKE&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option B: Using Credentials and Secret Key&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Providers ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. It maintains the user&#039;s anonymity while still allowing the service to communicate with the user. The process from the web app&#039;s point of view is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a message it wishes to send&lt;br /&gt;
# Web app sends the message to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299344</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299344"/>
		<updated>2011-04-14T22:21:29Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
== Engineers Involved  ==&lt;br /&gt;
&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
* Toby Elliott&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Notification&#039;&#039;&#039;: A message intended to alert its recipient to some event or occurrence.&lt;br /&gt;
* &#039;&#039;&#039;Provider&#039;&#039;&#039;: A notification provider, or &#039;&#039;&#039;web app&#039;&#039;&#039;, is any web service that is capable of sending notifications.&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: End-user; someone who receives notifications.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, third-party developers (a special type of user) who will have to interact with the system. It also outlines the requirements of the system itself.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Add a New Client|Add a New Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Add a New Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client (note: the goal is to have this be virtually identical to Firefox Sync).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option A: Using JPAKE&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option B: Using Credentials and Secret Key&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Providers ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. It maintains the user&#039;s anonymity while still allowing the service to communicate with the user. The process from the web app&#039;s point of view is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a message it wishes to send&lt;br /&gt;
# Web app sends the message to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications&amp;diff=299340</id>
		<title>CloudServices/Notifications</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications&amp;diff=299340"/>
		<updated>2011-04-14T22:16:23Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
You probably want to go read the [[Services/Notifications/Specification|specification]] for more information.&lt;br /&gt;
&lt;br /&gt;
= Project =&lt;br /&gt;
&lt;br /&gt;
== Engineers ==&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
&lt;br /&gt;
== Meetings ==&lt;br /&gt;
* [[Services/Notifications/Meetings|Meeting Notes]]&lt;br /&gt;
&lt;br /&gt;
== Goals ==&lt;br /&gt;
&lt;br /&gt;
* Push notifications from the cloud to the browser and other 3rd party clients (e.g. phones)&lt;br /&gt;
** receive notification of new email, eBay auction ending, new FB message, etc. without the need to have the tab open&lt;br /&gt;
** possibly client-to-client in the future, e.g. open this tab on my mobile phone, pull-sync, etc.&lt;br /&gt;
* Messages are encrypted so that the service provider (Mozilla) does not get to read them (like Sync)&lt;br /&gt;
* People should be able to run their own service (like Sync)&lt;br /&gt;
* Must be super easy for web apps to implement (adoption!)&lt;br /&gt;
&lt;br /&gt;
= Milestones =&lt;br /&gt;
&lt;br /&gt;
== First prototype and research phase (End of Jan 2011) ==&lt;br /&gt;
&lt;br /&gt;
* First prototype&lt;br /&gt;
** Server: simple Python app&lt;br /&gt;
** Client: use HTTP long polling&lt;br /&gt;
** No encryption&lt;br /&gt;
** Server code at [http://hg.mozilla.org/users/sdasilva_mozilla.com/notifs_prototype1 http://hg.mozilla.org/users/sdasilva_mozilla.com/notifs_prototype1]&lt;br /&gt;
** Client code at XXX&lt;br /&gt;
* [[Services/Notifications/Meetings/Research|Research messaging protocols (XMPP and AMQP)]]&lt;br /&gt;
* Decide on protocol + technology&lt;br /&gt;
** protocol: AMQP&lt;br /&gt;
** RabbitMQ broker + REST agents in Python&lt;br /&gt;
&lt;br /&gt;
== Second prototype using AMQP (End of Mar 2011) ==&lt;br /&gt;
&lt;br /&gt;
* Develop [[Services/Notifications/Specification|system specification]]&lt;br /&gt;
** Notifications client API (AMQP + REST)&lt;br /&gt;
** Web app facing REST API&lt;br /&gt;
* Second prototype&lt;br /&gt;
** Client: (partially) implement AMQP client protocol for Firefox&lt;br /&gt;
** Server: Set up RabbitMQ broker, implement client + web app facing agents&lt;br /&gt;
** Assume users have Sync accounts&lt;br /&gt;
** Encryption: TBD&lt;br /&gt;
** Client code at XXX&lt;br /&gt;
** Server code at XXX&lt;br /&gt;
&lt;br /&gt;
== Proof of concept (End of Apr 2011) ==&lt;br /&gt;
&lt;br /&gt;
* Incorporate input from&lt;br /&gt;
** Brian Smith (crypto)&lt;br /&gt;
** UX team&lt;br /&gt;
** Ragavan (PM)&lt;br /&gt;
* Provide experimental Firefox 4 add-on&lt;br /&gt;
* Basis for integration into Firefox&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=299326</id>
		<title>CloudServices/Notifications/Specification/ClientAgent</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=299326"/>
		<updated>2011-04-14T22:10:02Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Broadcast Messages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Client Agent supports an RPC-like API which allows clients to register themselves with the notification service, as well as create and remove subscriptions to web app notifications.&lt;br /&gt;
&lt;br /&gt;
= Scenarios =&lt;br /&gt;
&lt;br /&gt;
== New (Potentially First) Client ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers with Client Agent&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_queue HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client agent generates Client ID (CID), creates User Exchange if necessary, creates and binds Client Queue CID, returns CID to Client.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
S:&lt;br /&gt;
S: {&amp;quot;host&amp;quot;:&amp;quot;amqp.services.mozilla.com&amp;quot;,&lt;br /&gt;
    &amp;quot;port&amp;quot;:5672,&lt;br /&gt;
    &amp;quot;queue_id&amp;quot;: &amp;quot;ASCII (max 255 chars)&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client records CID.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client fetches notifications/subscriptions WBO from Sync, decrypts with sync key. This returns the following (encrypted) JSON:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;T in Base64&amp;quot;: {&lt;br /&gt;
    &amp;quot;app_name&amp;quot;: &amp;quot;GMail&amp;quot;, &lt;br /&gt;
    &amp;quot;app_host&amp;quot;: &amp;quot;mail.google.com&amp;quot;, &lt;br /&gt;
    &amp;quot;app_account&amp;quot;: &amp;quot;sdasilva@gmail.com&amp;quot;,  // Optional&lt;br /&gt;
    &amp;quot;key&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;T2 in Base64&amp;quot;: {...}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== New Subscription ==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client generates symmetric key &#039;&#039;K&#039;&#039; = 256 random bits AES and and token &#039;&#039;T&#039;&#039; = 256 random bits.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers token &#039;&#039;T&#039;&#039; with Client Agent.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C:&lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;BASE64==&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent subscribes User Exchange to token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client uploads new notifications/subscriptions WBO to Sync.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client passes key &#039;&#039;K&#039;&#039;, token &#039;&#039;T&#039;&#039;, and POST Office URL to web app.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Terminate Subscription ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client tells Client Agent to remove subscription with specified token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/remove_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent removes binding &#039;&#039;T&#039;&#039; from User Exchange.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Client-To-All-Clients Broadcast ==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Client broadcasts message to other clients of the authorized user. The format is very similar to that of the POST Office API.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/broadcast HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&lt;br /&gt;
     &amp;quot;body&amp;quot;: &amp;quot;{\&amp;quot;IV\&amp;quot;:\&amp;quot;IV in Base 64\&amp;quot;,...&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Body is a JSON serialization of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &lt;br /&gt;
  &amp;quot;timestamp&amp;quot;: ######## (in seconds UTC), // Optional,&lt;br /&gt;
  &amp;quot;ttl&amp;quot;: ######## (in seconds), // Optional&lt;br /&gt;
  &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
  &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ciphertext is the payload encrypted using AES-256-CBC and base-64 encoded. For an example of what payloads would look like, see [[#Broadcast Messages|Broadcast Messages]]&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client Agent routes the notifications to the appropriate user exchange.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Broadcast Messages Types ===&lt;br /&gt;
&lt;br /&gt;
Each broadcast message is encrypted and contained entirely within the &amp;quot;ciphertext&amp;quot; attribute of the message body. The following is a list of the type of broadcast messages supported by browser clients.&lt;br /&gt;
&lt;br /&gt;
==== Send Tab To Client ====&lt;br /&gt;
Copies a tab from one client and sends it to another client.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;send_tab&amp;quot;,&lt;br /&gt;
  &amp;quot;client_id&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Sync client ID&lt;br /&gt;
  &amp;quot;url&amp;quot;: &amp;quot;...&amp;quot;,&lt;br /&gt;
  // OPTIONAL: Implement either one of the following fields to transfer tab history and form data&lt;br /&gt;
  &amp;quot;moztabinfo&amp;quot;: &amp;quot;{Serialized Tab State}&amp;quot; // Value returned by nsISessionStore.getTabState()&lt;br /&gt;
  &amp;quot;tabinfo&amp;quot;: [{&amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;formdata&amp;quot;:&amp;quot;...&amp;quot;}] // Generic format (STILL NEEDS SPECING)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this message is broadcasted, so the &amp;quot;client_id&amp;quot; field must be compared against the client&#039;s own ID to make sure the message was intended for it.&lt;br /&gt;
&lt;br /&gt;
==== Sync Now ====&lt;br /&gt;
Send a message to clients indicating that important data has been synced, and so all clients should sync ASAP.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;sync_now&amp;quot;,&lt;br /&gt;
  &amp;quot;sender_id&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Sync client ID of client who sent this message&lt;br /&gt;
  &amp;quot;engines&amp;quot;: [&amp;quot;bookmarks&amp;quot;, &amp;quot;tabs&amp;quot;, ...] // Optional list of engines to sync&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=299323</id>
		<title>CloudServices/Notifications/Specification/ClientAgent</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=299323"/>
		<updated>2011-04-14T22:08:45Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Broadcast to Other Clients */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Client Agent supports an RPC-like API which allows clients to register themselves with the notification service, as well as create and remove subscriptions to web app notifications.&lt;br /&gt;
&lt;br /&gt;
= Scenarios =&lt;br /&gt;
&lt;br /&gt;
== New (Potentially First) Client ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers with Client Agent&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_queue HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client agent generates Client ID (CID), creates User Exchange if necessary, creates and binds Client Queue CID, returns CID to Client.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
S:&lt;br /&gt;
S: {&amp;quot;host&amp;quot;:&amp;quot;amqp.services.mozilla.com&amp;quot;,&lt;br /&gt;
    &amp;quot;port&amp;quot;:5672,&lt;br /&gt;
    &amp;quot;queue_id&amp;quot;: &amp;quot;ASCII (max 255 chars)&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client records CID.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client fetches notifications/subscriptions WBO from Sync, decrypts with sync key. This returns the following (encrypted) JSON:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;T in Base64&amp;quot;: {&lt;br /&gt;
    &amp;quot;app_name&amp;quot;: &amp;quot;GMail&amp;quot;, &lt;br /&gt;
    &amp;quot;app_host&amp;quot;: &amp;quot;mail.google.com&amp;quot;, &lt;br /&gt;
    &amp;quot;app_account&amp;quot;: &amp;quot;sdasilva@gmail.com&amp;quot;,  // Optional&lt;br /&gt;
    &amp;quot;key&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;T2 in Base64&amp;quot;: {...}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== New Subscription ==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client generates symmetric key &#039;&#039;K&#039;&#039; = 256 random bits AES and and token &#039;&#039;T&#039;&#039; = 256 random bits.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers token &#039;&#039;T&#039;&#039; with Client Agent.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C:&lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;BASE64==&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent subscribes User Exchange to token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client uploads new notifications/subscriptions WBO to Sync.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client passes key &#039;&#039;K&#039;&#039;, token &#039;&#039;T&#039;&#039;, and POST Office URL to web app.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Terminate Subscription ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client tells Client Agent to remove subscription with specified token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/remove_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent removes binding &#039;&#039;T&#039;&#039; from User Exchange.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Client-To-All-Clients Broadcast ==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Client broadcasts message to other clients of the authorized user. The format is very similar to that of the POST Office API.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/broadcast HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&lt;br /&gt;
     &amp;quot;body&amp;quot;: &amp;quot;{\&amp;quot;IV\&amp;quot;:\&amp;quot;IV in Base 64\&amp;quot;,...&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Body is a JSON serialization of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &lt;br /&gt;
  &amp;quot;timestamp&amp;quot;: ######## (in seconds UTC), // Optional,&lt;br /&gt;
  &amp;quot;ttl&amp;quot;: ######## (in seconds), // Optional&lt;br /&gt;
  &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
  &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ciphertext is the payload encrypted using AES-256-CBC and base-64 encoded. For an example of what payloads would look like, see [[#Broadcast Messages|Broadcast Messages]]&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client Agent routes the notifications to the appropriate user exchange.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Broadcast Messages ===&lt;br /&gt;
&lt;br /&gt;
Each broadcast message is encrypted and contained entirely within the &amp;quot;ciphertext&amp;quot; attribute of the message body. The following is a list of the type of broadcast messages supported by browser clients.&lt;br /&gt;
&lt;br /&gt;
==== Send Tab To Client ====&lt;br /&gt;
Copies a tab from one client and sends it to another client.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;send_tab&amp;quot;,&lt;br /&gt;
  &amp;quot;client_id&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Sync client ID&lt;br /&gt;
  &amp;quot;url&amp;quot;: &amp;quot;...&amp;quot;,&lt;br /&gt;
  // OPTIONAL: Implement either one of the following fields to transfer tab history and form data&lt;br /&gt;
  &amp;quot;moztabinfo&amp;quot;: &amp;quot;{Serialized Tab State}&amp;quot; // Value returned by nsISessionStore.getTabState()&lt;br /&gt;
  &amp;quot;tabinfo&amp;quot;: [{&amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;formdata&amp;quot;:&amp;quot;...&amp;quot;}] // Generic format (STILL NEEDS SPECING)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this message is broadcasted, so the &amp;quot;client_id&amp;quot; field must be compared against the client&#039;s own ID to make sure the message was intended for it.&lt;br /&gt;
&lt;br /&gt;
==== Sync Now ====&lt;br /&gt;
Send a message to clients indicating that important data has been synced, and so all clients should sync ASAP.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;sync_now&amp;quot;,&lt;br /&gt;
  &amp;quot;sender_id&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Sync client ID of client who sent this message&lt;br /&gt;
  &amp;quot;engines&amp;quot;: [&amp;quot;bookmarks&amp;quot;, &amp;quot;tabs&amp;quot;, ...] // Optional list of engines to sync&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=299322</id>
		<title>CloudServices/Notifications/Specification/ClientAgent</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=299322"/>
		<updated>2011-04-14T22:06:16Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Client Agent supports an RPC-like API which allows clients to register themselves with the notification service, as well as create and remove subscriptions to web app notifications.&lt;br /&gt;
&lt;br /&gt;
= Scenarios =&lt;br /&gt;
&lt;br /&gt;
== New (Potentially First) Client ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers with Client Agent&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_queue HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client agent generates Client ID (CID), creates User Exchange if necessary, creates and binds Client Queue CID, returns CID to Client.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
S:&lt;br /&gt;
S: {&amp;quot;host&amp;quot;:&amp;quot;amqp.services.mozilla.com&amp;quot;,&lt;br /&gt;
    &amp;quot;port&amp;quot;:5672,&lt;br /&gt;
    &amp;quot;queue_id&amp;quot;: &amp;quot;ASCII (max 255 chars)&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client records CID.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client fetches notifications/subscriptions WBO from Sync, decrypts with sync key. This returns the following (encrypted) JSON:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;T in Base64&amp;quot;: {&lt;br /&gt;
    &amp;quot;app_name&amp;quot;: &amp;quot;GMail&amp;quot;, &lt;br /&gt;
    &amp;quot;app_host&amp;quot;: &amp;quot;mail.google.com&amp;quot;, &lt;br /&gt;
    &amp;quot;app_account&amp;quot;: &amp;quot;sdasilva@gmail.com&amp;quot;,  // Optional&lt;br /&gt;
    &amp;quot;key&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;T2 in Base64&amp;quot;: {...}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== New Subscription ==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client generates symmetric key &#039;&#039;K&#039;&#039; = 256 random bits AES and and token &#039;&#039;T&#039;&#039; = 256 random bits.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers token &#039;&#039;T&#039;&#039; with Client Agent.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C:&lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;BASE64==&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent subscribes User Exchange to token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client uploads new notifications/subscriptions WBO to Sync.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client passes key &#039;&#039;K&#039;&#039;, token &#039;&#039;T&#039;&#039;, and POST Office URL to web app.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Terminate Subscription ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client tells Client Agent to remove subscription with specified token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/remove_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent removes binding &#039;&#039;T&#039;&#039; from User Exchange.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Broadcast to Other Clients ==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Client broadcasts message to other clients of the authorized user. The format is very similar to that of the POST Office API.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/broadcast HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&lt;br /&gt;
     &amp;quot;body&amp;quot;: &amp;quot;{\&amp;quot;IV\&amp;quot;:\&amp;quot;IV in Base 64\&amp;quot;,...&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Body is a JSON serialization of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &lt;br /&gt;
  &amp;quot;timestamp&amp;quot;: ######## (in seconds UTC), // Optional,&lt;br /&gt;
  &amp;quot;ttl&amp;quot;: ######## (in seconds), // Optional&lt;br /&gt;
  &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
  &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ciphertext is the payload encrypted using AES-256-CBC and base-64 encoded. For an example of what payloads would look like, see [[#Broadcast Messages|Broadcast Messages]]&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client Agent routes the notifications to the appropriate user exchange.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Broadcast Messages ===&lt;br /&gt;
&lt;br /&gt;
Each broadcast message is encrypted and contained entirely within the &amp;quot;ciphertext&amp;quot; attribute of the message body. The following is a list of the type of broadcast messages supported by browser clients.&lt;br /&gt;
&lt;br /&gt;
==== Send Tab To Client ====&lt;br /&gt;
Copies a tab from one client and sends it to another client.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;send_tab&amp;quot;,&lt;br /&gt;
  &amp;quot;client_id&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Sync client ID&lt;br /&gt;
  &amp;quot;url&amp;quot;: &amp;quot;...&amp;quot;,&lt;br /&gt;
  // OPTIONAL: Implement either one of the following fields to transfer tab history and form data&lt;br /&gt;
  &amp;quot;moztabinfo&amp;quot;: &amp;quot;{Serialized Tab State}&amp;quot; // Value returned by nsISessionStore.getTabState()&lt;br /&gt;
  &amp;quot;tabinfo&amp;quot;: [{&amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;formdata&amp;quot;:&amp;quot;...&amp;quot;}] // Generic format (STILL NEEDS SPECING)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this message is broadcasted, so the &amp;quot;client_id&amp;quot; field must be compared against the client&#039;s own ID to make sure the message was intended for it.&lt;br /&gt;
&lt;br /&gt;
==== Sync Now ====&lt;br /&gt;
Send a message to clients indicating that important data has been synced, and so all clients should sync ASAP.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;sync_now&amp;quot;,&lt;br /&gt;
  &amp;quot;sender_id&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Sync client ID of client who sent this message&lt;br /&gt;
  &amp;quot;engines&amp;quot;: [&amp;quot;bookmarks&amp;quot;, &amp;quot;tabs&amp;quot;, ...] // Optional list of engines to sync&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299318</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299318"/>
		<updated>2011-04-14T21:51:03Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Engineers Involved */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
== Engineers Involved  ==&lt;br /&gt;
&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
* Toby Elliott&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Notification&#039;&#039;&#039;: A message intended to alert its recipient to some event or occurrence.&lt;br /&gt;
* &#039;&#039;&#039;Provider&#039;&#039;&#039;: A notification provider, or &#039;&#039;&#039;web app&#039;&#039;&#039;, is any web service that is capable of sending notifications.&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: End-user; someone who receives notifications.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Add a New Client|Add a New Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Add a New Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client (note: the goal is to have this be virtually identical to Firefox Sync).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option A: Using JPAKE&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option B: Using Credentials and Secret Key&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Providers ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. It maintains the user&#039;s anonymity while still allowing the service to communicate with the user. The process from the web app&#039;s point of view is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a message it wishes to send&lt;br /&gt;
# Web app sends the message to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299316</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299316"/>
		<updated>2011-04-14T21:49:46Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Web App Use Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
== Engineers Involved  ==&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Notification&#039;&#039;&#039;: A message intended to alert its recipient to some event or occurrence.&lt;br /&gt;
* &#039;&#039;&#039;Provider&#039;&#039;&#039;: A notification provider, or &#039;&#039;&#039;web app&#039;&#039;&#039;, is any web service that is capable of sending notifications.&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: End-user; someone who receives notifications.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Add a New Client|Add a New Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Add a New Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client (note: the goal is to have this be virtually identical to Firefox Sync).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option A: Using JPAKE&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option B: Using Credentials and Secret Key&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Providers ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. It maintains the user&#039;s anonymity while still allowing the service to communicate with the user. The process from the web app&#039;s point of view is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a message it wishes to send&lt;br /&gt;
# Web app sends the message to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299312</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299312"/>
		<updated>2011-04-14T21:46:54Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Subscribe to Notifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
== Engineers Involved  ==&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Notification&#039;&#039;&#039;: A message intended to alert its recipient to some event or occurrence.&lt;br /&gt;
* &#039;&#039;&#039;Provider&#039;&#039;&#039;: A notification provider, or &#039;&#039;&#039;web app&#039;&#039;&#039;, is any web service that is capable of sending notifications.&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: End-user; someone who receives notifications.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Add a New Client|Add a New Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Add a New Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client (note: the goal is to have this be virtually identical to Firefox Sync).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option A: Using JPAKE&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option B: Using Credentials and Secret Key&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299311</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299311"/>
		<updated>2011-04-14T21:46:20Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Register with Notifications Service */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
== Engineers Involved  ==&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Notification&#039;&#039;&#039;: A message intended to alert its recipient to some event or occurrence.&lt;br /&gt;
* &#039;&#039;&#039;Provider&#039;&#039;&#039;: A notification provider, or &#039;&#039;&#039;web app&#039;&#039;&#039;, is any web service that is capable of sending notifications.&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: End-user; someone who receives notifications.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Add a New Client|Add a New Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button (ideally) or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Add a New Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client (note: the goal is to have this be virtually identical to Firefox Sync).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option A: Using JPAKE&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option B: Using Credentials and Secret Key&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299310</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299310"/>
		<updated>2011-04-14T21:45:39Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Set Up an Additional Client */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
== Engineers Involved  ==&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Notification&#039;&#039;&#039;: A message intended to alert its recipient to some event or occurrence.&lt;br /&gt;
* &#039;&#039;&#039;Provider&#039;&#039;&#039;: A notification provider, or &#039;&#039;&#039;web app&#039;&#039;&#039;, is any web service that is capable of sending notifications.&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: End-user; someone who receives notifications.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Set Up an Additional Client|Set Up an Additional Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button (ideally) or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Add a New Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client (note: the goal is to have this be virtually identical to Firefox Sync).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option A: Using JPAKE&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option B: Using Credentials and Secret Key&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299309</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299309"/>
		<updated>2011-04-14T21:45:11Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* User Use Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
== Engineers Involved  ==&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Notification&#039;&#039;&#039;: A message intended to alert its recipient to some event or occurrence.&lt;br /&gt;
* &#039;&#039;&#039;Provider&#039;&#039;&#039;: A notification provider, or &#039;&#039;&#039;web app&#039;&#039;&#039;, is any web service that is capable of sending notifications.&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: End-user; someone who receives notifications.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Set Up an Additional Client|Set Up an Additional Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button (ideally) or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Set Up an Additional Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client (note: the goal is to have this be virtually identical to Firefox Sync).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option A: Using JPAKE&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option B: Using Credentials and Secret Key&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299307</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299307"/>
		<updated>2011-04-14T21:43:59Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Terminology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
== Engineers Involved  ==&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Notification&#039;&#039;&#039;: A message intended to alert its recipient to some event or occurrence.&lt;br /&gt;
* &#039;&#039;&#039;Provider&#039;&#039;&#039;: A notification provider, or &#039;&#039;&#039;web app&#039;&#039;&#039;, is any web service that is capable of sending notifications.&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: End-user; someone who receives notifications.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== User Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Set Up an Additional Client|Set Up an Additional Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button (ideally) or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Set Up an Additional Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client (note: the goal is to have this be virtually identical to Firefox Sync).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option A: Using JPAKE&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option B: Using Credentials and Secret Key&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299306</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299306"/>
		<updated>2011-04-14T21:41:07Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
== Engineers Involved  ==&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provider&#039;&#039;&#039;: A notification provider, or &#039;&#039;&#039;web app&#039;&#039;&#039;, is any web service that is capable of sending notifications.&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: End-user; someone who receives notifications.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== User Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Set Up an Additional Client|Set Up an Additional Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button (ideally) or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Set Up an Additional Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client (note: the goal is to have this be virtually identical to Firefox Sync).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option A: Using JPAKE&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option B: Using Credentials and Secret Key&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299305</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299305"/>
		<updated>2011-04-14T21:38:55Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Engineers Involved */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== User Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Set Up an Additional Client|Set Up an Additional Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button (ideally) or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Set Up an Additional Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client (note: the goal is to have this be virtually identical to Firefox Sync).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option A: Using JPAKE&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option B: Using Credentials and Secret Key&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299301</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299301"/>
		<updated>2011-04-14T21:37:31Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Set Up an Additional Client */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
= Engineers Involved  =&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== User Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Set Up an Additional Client|Set Up an Additional Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button (ideally) or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Set Up an Additional Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client (note: the goal is to have this be virtually identical to Firefox Sync).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option A: Using JPAKE&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Option B: Using Credentials and Secret Key&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299300</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299300"/>
		<updated>2011-04-14T21:30:26Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Client ToDo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
= Engineers Involved  =&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== User Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Set Up an Additional Client|Set Up an Additional Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button (ideally) or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Set Up an Additional Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client.&lt;br /&gt;
&lt;br /&gt;
==== Option A: Using JPAKE ====&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
 &lt;br /&gt;
==== Option B: Using Credentials and Secret Key ====&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299298</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299298"/>
		<updated>2011-04-14T21:26:29Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Developer Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
= Engineers Involved  =&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== User Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Set Up an Additional Client|Set Up an Additional Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button (ideally) or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Set Up an Additional Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client.&lt;br /&gt;
&lt;br /&gt;
==== Option A: Using JPAKE ====&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
 &lt;br /&gt;
==== Option B: Using Credentials and Secret Key ====&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* When adding a new subscription, the pref window should update if open&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299297</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299297"/>
		<updated>2011-04-14T21:25:28Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* User Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
= Engineers Involved  =&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be easily readable by unauthorized persons (e.g. anyone besides the sender and the recipient). By &amp;quot;easily&amp;quot; we mean it should not be trivial to decrypt a message, but take a long enough time and resources so that such effort is not viable.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Simple Client Implementation&#039;&#039;&#039;: Third-party developers &#039;&#039;SHOULD&#039;&#039; be able to implement a notification client with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== User Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Set Up an Additional Client|Set Up an Additional Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button (ideally) or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Set Up an Additional Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client.&lt;br /&gt;
&lt;br /&gt;
==== Option A: Using JPAKE ====&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
 &lt;br /&gt;
==== Option B: Using Credentials and Secret Key ====&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* When adding a new subscription, the pref window should update if open&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299296</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299296"/>
		<updated>2011-04-14T21:23:09Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* User Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
= Engineers Involved  =&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications &#039;&#039;MUST NOT&#039;&#039; be readable by unauthorized persons (e.g. anyone besides the sender and the recipient).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Simple Client Implementation&#039;&#039;&#039;: Third-party developers &#039;&#039;SHOULD&#039;&#039; be able to implement a notification client with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== User Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Set Up an Additional Client|Set Up an Additional Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button (ideally) or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Set Up an Additional Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client.&lt;br /&gt;
&lt;br /&gt;
==== Option A: Using JPAKE ====&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
 &lt;br /&gt;
==== Option B: Using Credentials and Secret Key ====&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* When adding a new subscription, the pref window should update if open&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299295</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299295"/>
		<updated>2011-04-14T21:22:37Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* User Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
= Engineers Involved  =&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Security&#039;&#039;&#039;: From the point a message leaves the sender until it arrives at its intended recipient, all communications should not be readable by unauthorized persons (e.g. anyone besides the sender and the recipient).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between the web app and server is concerned; if the user is logged in to GMail and signs up for notifications, then obviously Google can associate the resulting subscription with the user who created it).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portability&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol.&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Simple Client Implementation&#039;&#039;&#039;: Third-party developers &#039;&#039;SHOULD&#039;&#039; be able to implement a notification client with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== User Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Set Up an Additional Client|Set Up an Additional Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button (ideally) or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Set Up an Additional Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client.&lt;br /&gt;
&lt;br /&gt;
==== Option A: Using JPAKE ====&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
 &lt;br /&gt;
==== Option B: Using Credentials and Secret Key ====&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* When adding a new subscription, the pref window should update if open&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299293</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=299293"/>
		<updated>2011-04-14T21:17:47Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mozilla Push Notifications&#039;&#039;&#039; is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
= Engineers Involved  =&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between web app and server is concerned; if the user is logged in to GMail and GMail requests to send notifications, then obviously Google knows who it is making the request to)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portable&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Simple Client Implementation&#039;&#039;&#039;: Third-party developers &#039;&#039;SHOULD&#039;&#039; be able to implement a notification client with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== User Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Set Up an Additional Client|Set Up an Additional Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button (ideally) or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Set Up an Additional Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client.&lt;br /&gt;
&lt;br /&gt;
==== Option A: Using JPAKE ====&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
 &lt;br /&gt;
==== Option B: Using Credentials and Secret Key ====&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* When adding a new subscription, the pref window should update if open&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299292</id>
		<title>CloudServices/Notifications/Specification/POSTOffice</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299292"/>
		<updated>2011-04-14T21:15:54Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The POST Office supports a very simple REST API, allowing web apps to send notifications to a subscription token.&lt;br /&gt;
&lt;br /&gt;
= Sending Notifications =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Web app sends notification to POST Office.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W: POST /1.0/notification HTTP/1.1&lt;br /&gt;
W:&lt;br /&gt;
W: {&lt;br /&gt;
     &amp;quot;body&amp;quot;: &amp;quot;{\&amp;quot;token\&amp;quot;:\&amp;quot;BASE64==\&amp;quot;, ...}&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
P: HTTP/1.1 202 ACCEPTED&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Message Body ==&lt;br /&gt;
The &amp;quot;body&amp;quot; field of the message is a JSON serialization of the message metadata and the encrypted payload. Metadata includes the subscription token, when the message was sent, and when the message expires. The metadata should be thought of as information that aids in routing the message to its intended recipient, as well as providing any other information about the message that may be of use while it is en-route. Any other information should be placed in the encrypted payload to ensure privacy.&lt;br /&gt;
&lt;br /&gt;
A typical message body would look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &lt;br /&gt;
  &amp;quot;token&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Subscription Token&lt;br /&gt;
  &amp;quot;timestamp&amp;quot;: ########, // UTC Timestamp in seconds (OPTIONAL)&lt;br /&gt;
  &amp;quot;ttl&amp;quot;: ######## (in seconds), // Time To Live in seconds (OPTIONAL)&lt;br /&gt;
  &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Encrypted payload&lt;br /&gt;
  &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Initialization vector to use in decrypting ciphertext&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;body&amp;quot; field is a serialized JSON object to emphasize the fact that the value in the associated &amp;quot;HMAC&amp;quot; field signs the entire contents of the &amp;quot;body&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
=== Ciphertext Contents ===&lt;br /&gt;
The &amp;quot;ciphertext&amp;quot; field is a string encrypted with the encryption key using AES-256-CBC and base-64 encoded. The contents of the payload differ based on the type of message, however it is typically a serialized JSON object. For example, the payload of a standard notification will look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;:&amp;quot;notification&amp;quot;,&lt;br /&gt;
  &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
  &amp;quot;body&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
  &amp;quot;url&amp;quot;:&amp;quot;http://foobar.com&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reason no specific format is required for the payload is that it should be up to clients to decide what kind of formats they wish to support. The higher-level goal is to build a secure &amp;quot;message-routing&amp;quot; solution. A push notification service is simply a special subset of a message routing solution.&lt;br /&gt;
&lt;br /&gt;
== Message HMAC ==&lt;br /&gt;
The &amp;quot;HMAC&amp;quot; field is included to verify that the message has not been tampered with by a third party. It is calculated by signing the contents of the &amp;quot;body&amp;quot; field using the standard [http://en.wikipedia.org/wiki/HMAC HMAC algorithm] with a [http://en.wikipedia.org/wiki/SHA-2#SHA-256_.28a_SHA-2_variant.29_pseudocode SHA-256 hash function].&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299286</id>
		<title>CloudServices/Notifications/Specification/POSTOffice</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299286"/>
		<updated>2011-04-14T21:08:26Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Web App Sends Notification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The POST Office supports a very simple REST API, allowing web apps to send notifications to a subscription token.&lt;br /&gt;
&lt;br /&gt;
= Sending Notifications =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Web app sends notification to POST Office.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W: POST /1.0/notification HTTP/1.1&lt;br /&gt;
W:&lt;br /&gt;
W: {&lt;br /&gt;
     &amp;quot;body&amp;quot;: &amp;quot;{\&amp;quot;token\&amp;quot;:\&amp;quot;BASE64==\&amp;quot;, ...}&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
P: HTTP/1.1 202 ACCEPTED&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Message Body ==&lt;br /&gt;
The &amp;quot;body&amp;quot; field of the message is a JSON serialization of the message metadata and the encrypted payload. Metadata includes the subscription token, when the message was sent, and when the message expires. The metadata should be thought of as information that aids in routing the message to its intended recipient, as well as providing any other information about the message that may be of use while it is en-route. Any other information should be placed in the encrypted payload to ensure privacy.&lt;br /&gt;
&lt;br /&gt;
A typical message body would look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &lt;br /&gt;
  &amp;quot;token&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Subscription Token&lt;br /&gt;
  &amp;quot;timestamp&amp;quot;: ########, // UTC Timestamp in seconds (OPTIONAL)&lt;br /&gt;
  &amp;quot;ttl&amp;quot;: ######## (in seconds), // Time To Live in seconds (OPTIONAL)&lt;br /&gt;
  &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Encrypted payload&lt;br /&gt;
  &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Initialization vector to use in decrypting ciphertext&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ciphertext Contents ===&lt;br /&gt;
The &amp;quot;ciphertext&amp;quot; field is a string encrypted with the encryption key using AES-256-CBC and base-64 encoded. The contents of the payload differ based on the type of message, however it is typically a serialized JSON object. For example, the payload of a standard notification will look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;:&amp;quot;notification&amp;quot;,&lt;br /&gt;
  &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
  &amp;quot;body&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
  &amp;quot;url&amp;quot;:&amp;quot;http://foobar.com&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reason no specific format is required for the payload is that it should be up to clients to decide what kind of formats they wish to support. The higher-level goal is to build a secure &amp;quot;message-routing&amp;quot; solution. A push notification service is simply a special subset of a message routing solution.&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299274</id>
		<title>CloudServices/Notifications/Specification/POSTOffice</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299274"/>
		<updated>2011-04-14T20:49:32Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The POST Office supports a very simple REST API, allowing web apps to send notifications to a subscription token.&lt;br /&gt;
&lt;br /&gt;
= Web App Sends Notification =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Web app sends notification to POST Office.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W: POST /1.0/notification HTTP/1.1&lt;br /&gt;
W:&lt;br /&gt;
W: {&lt;br /&gt;
     &amp;quot;body&amp;quot;:&amp;quot;{\&amp;quot;token\&amp;quot;:\&amp;quot;T in Base 64\&amp;quot;,...&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;:&amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
P: HTTP/1.1 202 ACCEPTED&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Body is a JSON serialization of&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &lt;br /&gt;
  &amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;,&lt;br /&gt;
  &amp;quot;timestamp&amp;quot;: ######## (in seconds UTC), // Optional,&lt;br /&gt;
  &amp;quot;ttl&amp;quot;: ######## (in seconds), // Optional&lt;br /&gt;
  &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
  &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ciphertext is a JSON serialization encrypted with the encryption key using AES-256-CBC and base-64 encoded. The contents of the payload differ based on the type of message. For example, the payload of a standard notification will look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;:&amp;quot;notification&amp;quot;,&lt;br /&gt;
  &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
  &amp;quot;body&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
  &amp;quot;url&amp;quot;:&amp;quot;http://foobar.com&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299273</id>
		<title>CloudServices/Notifications/Specification/POSTOffice</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299273"/>
		<updated>2011-04-14T20:49:13Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The POST Office supports a very simple REST API allowing web apps to send notifications to a subscription token.&lt;br /&gt;
&lt;br /&gt;
= Web App Sends Notification =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Web app sends notification to POST Office.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W: POST /1.0/notification HTTP/1.1&lt;br /&gt;
W:&lt;br /&gt;
W: {&lt;br /&gt;
     &amp;quot;body&amp;quot;:&amp;quot;{\&amp;quot;token\&amp;quot;:\&amp;quot;T in Base 64\&amp;quot;,...&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;:&amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
P: HTTP/1.1 202 ACCEPTED&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Body is a JSON serialization of&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &lt;br /&gt;
  &amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;,&lt;br /&gt;
  &amp;quot;timestamp&amp;quot;: ######## (in seconds UTC), // Optional,&lt;br /&gt;
  &amp;quot;ttl&amp;quot;: ######## (in seconds), // Optional&lt;br /&gt;
  &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
  &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ciphertext is a JSON serialization encrypted with the encryption key using AES-256-CBC and base-64 encoded. The contents of the payload differ based on the type of message. For example, the payload of a standard notification will look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;:&amp;quot;notification&amp;quot;,&lt;br /&gt;
  &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
  &amp;quot;body&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
  &amp;quot;url&amp;quot;:&amp;quot;http://foobar.com&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299271</id>
		<title>CloudServices/Notifications/Specification/POSTOffice</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299271"/>
		<updated>2011-04-14T20:46:28Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Web App Sends Notification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The POST Office supports a very simple REST API allowing web apps to send notifications will relatively little effort. It forwards the notifications to the Message Broker on behalf of the web apps.&lt;br /&gt;
&lt;br /&gt;
= Web App Sends Notification =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Web app sends notification to POST Office.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W: POST /1.0/notification HTTP/1.1&lt;br /&gt;
W:&lt;br /&gt;
W: {&lt;br /&gt;
     &amp;quot;body&amp;quot;:&amp;quot;{\&amp;quot;token\&amp;quot;:\&amp;quot;T in Base 64\&amp;quot;,...&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;:&amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
P: HTTP/1.1 202 ACCEPTED&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Body is a JSON serialization of&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &lt;br /&gt;
  &amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;,&lt;br /&gt;
  &amp;quot;timestamp&amp;quot;: ######## (in seconds UTC), // Optional,&lt;br /&gt;
  &amp;quot;ttl&amp;quot;: ######## (in seconds), // Optional&lt;br /&gt;
  &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
  &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ciphertext is a JSON serialization encrypted with the encryption key using AES-256-CBC and base-64 encoded. The contents of the payload differ based on the type of message. For example, the payload of a standard notification will look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;:&amp;quot;notification&amp;quot;,&lt;br /&gt;
  &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
  &amp;quot;body&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
  &amp;quot;url&amp;quot;:&amp;quot;http://foobar.com&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299270</id>
		<title>CloudServices/Notifications/Specification/POSTOffice</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/POSTOffice&amp;diff=299270"/>
		<updated>2011-04-14T20:45:12Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Web App Sends Notification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The POST Office supports a very simple REST API allowing web apps to send notifications will relatively little effort. It forwards the notifications to the Message Broker on behalf of the web apps.&lt;br /&gt;
&lt;br /&gt;
= Web App Sends Notification =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Web app sends notification to POST Office.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
W: POST /1.0/notification HTTP/1.1&lt;br /&gt;
W:&lt;br /&gt;
W: {&lt;br /&gt;
  &amp;quot;body&amp;quot;:&amp;quot;{\&amp;quot;token\&amp;quot;:\&amp;quot;T in Base 64\&amp;quot;,...&amp;quot;,&lt;br /&gt;
  &amp;quot;HMAC&amp;quot;:&amp;quot;BASE64==&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
P: HTTP/1.1 202 ACCEPTED&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Body is a JSON serialization of&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 { &lt;br /&gt;
     &amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;,&lt;br /&gt;
     &amp;quot;timestamp&amp;quot;: ######## (in seconds UTC), // Optional,&lt;br /&gt;
     &amp;quot;ttl&amp;quot;: ######## (in seconds), // Optional&lt;br /&gt;
     &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
     &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ciphertext is a JSON serialization encrypted with the encryption key using AES-256-CBC and base-64 encoded. The contents of the payload differ based on the type of message. For example, the payload of a standard notification will look like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;type&amp;quot;:&amp;quot;notification&amp;quot;,&lt;br /&gt;
  &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
  &amp;quot;body&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
  &amp;quot;url&amp;quot;:&amp;quot;http://foobar.com&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=297907</id>
		<title>CloudServices/Notifications/Specification</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification&amp;diff=297907"/>
		<updated>2011-04-12T22:12:27Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Client ToDo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
Push Notifications is a project that aims to create a system that allows for notifications from clients (such as web applications or services) to be sent directly to the browsers of its users. A typical example where such a system could be useful is the eBay auctioning system. If a user makes a bid on an item, it would be convenient if that user could leave eBay and start browsing another web site, but still receive notifications if another user bids on that item, allowing them to act on the bid.&lt;br /&gt;
&lt;br /&gt;
= Engineers Involved  =&lt;br /&gt;
&lt;br /&gt;
* Philipp von Weitershausen&lt;br /&gt;
* Toby Elliot&lt;br /&gt;
* Alex Amariutei&lt;br /&gt;
* Shane da Silva&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
The following section outlines the requirements of the service with respect to the user, the system itself, as well as the third-party developers (a special type of user) who will have to interact with the system.&lt;br /&gt;
&lt;br /&gt;
== User Requirements  ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Transparency&#039;&#039;&#039;: Process &#039;&#039;MUST&#039;&#039; be transparent to user. For example, other than clicking &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot; to a dialog of the web app requesting to send notifications, the user should not be aware of the underlying mechanics of the process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Anonymity&#039;&#039;&#039;: Web apps &#039;&#039;MUST&#039;&#039; not know anything about user (insofar as the communication between web app and server is concerned; if the user is logged in to GMail and GMail requests to send notifications, then obviously Google knows who it is making the request to)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Portable&#039;&#039;&#039;: Service &#039;&#039;MUST&#039;&#039; work with any device that supports the protocol&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Developer Requirements ==&lt;br /&gt;
&lt;br /&gt;
Often overlooked, the following requirements should be kept in mind so that third-party developers can easily incorporate the service into their applications. The goal is to make adoption incredibly easy, resulting in more people adopting it and in the end making the service more worthwhile for users who use it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy Adoption&#039;&#039;&#039;: Web apps and custom clients &#039;&#039;SHOULD&#039;&#039; be able to add notification support to their applications with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Simple Client Implementation&#039;&#039;&#039;: Third-party developers &#039;&#039;SHOULD&#039;&#039; be able to implement a notification client with relatively little effort.&lt;br /&gt;
&lt;br /&gt;
= Use Cases =&lt;br /&gt;
&lt;br /&gt;
This section outlines the use cases of the service from both the user&#039;s and web app&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
== User Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Register with Notifications Service ===&lt;br /&gt;
&lt;br /&gt;
In order to make use of the service, the user must enable notifications on their client (e.g. browser). From the UI side of things, this will probably involve a simple check box. Once the user has &amp;quot;opted in&amp;quot; to using notifications, the following process takes place:&lt;br /&gt;
&lt;br /&gt;
# User selects which notifications server they want to use (most will simply use the Mozilla Notifications server, but users can roll their own if they wish).&lt;br /&gt;
# Client asks user for account credentials, or points user to a link to create an account.&lt;br /&gt;
# User enters their account credentials (or simply uses their Sync account)&lt;br /&gt;
# Client remembers credentials for later use&lt;br /&gt;
&lt;br /&gt;
If the user has already registered with the notification service, then they can add an additional client to receive notifications. See the list of related use cases below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Set Up an Additional Client|Set Up an Additional Client]]&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to Notifications ===&lt;br /&gt;
&lt;br /&gt;
Once set up the user will the be able to subscribe to web sites which they wish to receive push notification from. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User clicks a button (ideally) or otherwise interacts with a web page such that the page requests to send notifications.&lt;br /&gt;
# Client displays a confirmation box asking user if they wish to receive notifications from the web page in question.&lt;br /&gt;
# Upon confirmation, a new subscription is created and can be viewed in the client&#039;s list of subscriptions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Cancel a Subscription|Cancel a Subscription]]&lt;br /&gt;
&lt;br /&gt;
=== Cancel a Subscription ===&lt;br /&gt;
&lt;br /&gt;
If down the road the user feels that the subscription is not useful or is otherwise unwanted, they can cancel the subscription so that they no longer receive notifications. The process is as follows:&lt;br /&gt;
&lt;br /&gt;
# User navigates to the list of subscriptions on their client.&lt;br /&gt;
# User selects the subscription(s) they wish to cancel and click a &amp;quot;Unsubscribe&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Subscribe to Notifications|Subscribe to Notifications]]&lt;br /&gt;
&lt;br /&gt;
=== Set Up an Additional Client ===&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of the service is it allows users to receive notifications on multiple clients, be it their browser, mobile phone, etc. Thus setting up another client to receive notifications is likely to be a common operation. The following are two possible methods the user can use to set up an additional client.&lt;br /&gt;
&lt;br /&gt;
==== Option A: Using JPAKE ====&lt;br /&gt;
&lt;br /&gt;
JPAKE is a mechanism for securely exchanging keys between two clients. This is the same process that is used by the Sync service when adding a new device.&lt;br /&gt;
 &lt;br /&gt;
==== Option B: Using Credentials and Secret Key ====&lt;br /&gt;
&lt;br /&gt;
If the user does not have a client that is already connected, they will have to have their credentials ready along with their secret key (which is used to decrypt the messages sent to them). Provided they have this information, the following process could also be used to connect a new client:&lt;br /&gt;
&lt;br /&gt;
# User indicates they have already registered and wish to add an additional client manually.&lt;br /&gt;
# User enters credentials along with their secret key.&lt;br /&gt;
# Client registers itself with the notification server.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Related Use Cases&#039;&#039;&#039;: [[#Register with Notifications Service|Register with Notifications Service]]&lt;br /&gt;
&lt;br /&gt;
== Web App Use Cases ==&lt;br /&gt;
&lt;br /&gt;
=== Send a Notification ===&lt;br /&gt;
&lt;br /&gt;
The web app is able to send a message (i.e. the notification) to a specific user using a &#039;&#039;&#039;routing key&#039;&#039;&#039; that was given to it by the user&#039;s client. The routing key can be thought of as an address that specifies the destination &amp;quot;mailbox&amp;quot; of the message. The process from the point of view of the web app is as follows:&lt;br /&gt;
&lt;br /&gt;
# Web app creates a JSON string encompassing the notification it wishes to send (as well as which user to send it to)&lt;br /&gt;
# Web app sends the JSON string to the notification server.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
== Terminology  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelCommLines.png|thumb|250px|High-level overview of the lines of communication between the entities in the system.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:PN-HighLevelNotifFlow.png|thumb|250px|Overview of how notifications travel from web apps to clients.]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039;: Individual who receives notifications.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client&#039;&#039;&#039;: One of possibly many devices a user wishes to receive notifications on, e.g. a browser, mobile phone, feather duster, etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Web App&#039;&#039;&#039;: Third-party web application that actually produces the notifications. The user subscribes to notifications from this app via a web page.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Message Broker&#039;&#039;&#039;: Facilitates the transportation of messages. See [http://www.rabbitmq.com RabbitMQ] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;POST Office&#039;&#039;&#039;: Responsible for forwarding all notifications sent by web apps to the Message Broker.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Agent&#039;&#039;&#039;: Handles the creation of exchanges and queues within the Message Broker on behalf of clients. The Client uses the Client Agent as a means to register itself and create and remove subscriptions.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subscription&#039;&#039;&#039;: Represents the relationship between a web app and a user who wishes to receive notifications from said web app. A subscription consists of the &amp;quot;link&amp;quot; that allows the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Routing Key/Token&#039;&#039;&#039;: A unique identifier generated by the Agent when a user subscribes to notifications from a web app. The routing key is used as a &amp;quot;mailbox address&amp;quot; by the web app to send notifications to the user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;User Exchange&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular user are sent.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Client Queue&#039;&#039;&#039;: Entity within the message broker where all messages destined for a particular client of a user are sent (one queue per client).&lt;br /&gt;
&lt;br /&gt;
== APIs ==&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/POSTOffice | POST Office API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/ClientAgent | Client Agent API]]&lt;br /&gt;
&lt;br /&gt;
* [[Services/Notifications/Specification/BrowserJS | Browser JavaScript API]]&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
===DOS Defense===&lt;br /&gt;
* Least Recently Used (LRU) queue approach for monitoring IP addresses issuing frequent requests&lt;br /&gt;
** Configurable threshold for adding IP address to Blacklist/Penalty Box&lt;br /&gt;
** Configurable time-out for IP addresses added to Blacklist/Penalty Box&lt;br /&gt;
* A single shared blacklist will exist within memcache&lt;br /&gt;
* LRU queues will be unique to each server and will penalize an IP to the shared blacklist on memcache&lt;br /&gt;
* All thresholds will be controlled via the configuration page&lt;br /&gt;
&lt;br /&gt;
===Logging Points===&lt;br /&gt;
&lt;br /&gt;
* What are we going to log server-side?&lt;br /&gt;
&lt;br /&gt;
=== Administration Features===&lt;br /&gt;
&lt;br /&gt;
* What features will we provide for administrators of the server?&lt;br /&gt;
&lt;br /&gt;
== Meeting Notes ==&lt;br /&gt;
&lt;br /&gt;
* General notes from meetings over the course of development&lt;br /&gt;
&lt;br /&gt;
== Client ToDo ==&lt;br /&gt;
&lt;br /&gt;
* When adding a new subscription, the pref window should update if open&lt;br /&gt;
* Code clean up&lt;br /&gt;
* Resolve issue where messages larger than 8000 bytes are not transmitted (FOCUS)&lt;br /&gt;
* Android&lt;br /&gt;
** Send to tab (hook up UI)&lt;br /&gt;
** Hide previous notifications button when notifications disabled&lt;br /&gt;
* Cleanup on disable notifications&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=296915</id>
		<title>CloudServices/Notifications/Specification/ClientAgent</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=296915"/>
		<updated>2011-04-08T22:24:47Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Sync Now */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Client Agent supports an RPC-like API which allows clients to register themselves with the notification service, as well as create and remove subscriptions to web app notifications.&lt;br /&gt;
&lt;br /&gt;
= Scenario 1: New (Potentially First) Client =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers with Client Agent&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_queue HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client agent generates Client ID (CID), creates User Exchange if necessary, creates and binds Client Queue CID, returns CID to Client.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
S:&lt;br /&gt;
S: {&amp;quot;host&amp;quot;:&amp;quot;amqp.services.mozilla.com&amp;quot;,&lt;br /&gt;
    &amp;quot;port&amp;quot;:5672,&lt;br /&gt;
    &amp;quot;queue_id&amp;quot;: &amp;quot;ASCII (max 255 chars)&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client records CID.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client fetches notifications/subscriptions WBO from Sync, decrypts with sync key. This returns the following (encrypted) JSON:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;T in Base64&amp;quot;: {&lt;br /&gt;
    &amp;quot;app_name&amp;quot;: &amp;quot;GMail&amp;quot;, &lt;br /&gt;
    &amp;quot;app_host&amp;quot;: &amp;quot;mail.google.com&amp;quot;, &lt;br /&gt;
    &amp;quot;app_account&amp;quot;: &amp;quot;sdasilva@gmail.com&amp;quot;,  // Optional&lt;br /&gt;
    &amp;quot;key&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;T2 in Base64&amp;quot;: {...}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 2: New Subscription =&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client generates symmetric key &#039;&#039;K&#039;&#039; = 256 random bits AES and and token &#039;&#039;T&#039;&#039; = 256 random bits.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers token &#039;&#039;T&#039;&#039; with Client Agent.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C:&lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent subscribes User Exchange to token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client uploads new notifications/subscriptions WBO to Sync (see Scenario 1, Step 4).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client passes key &#039;&#039;K&#039;&#039;, token &#039;&#039;T&#039;&#039;, and POST Office URL to web app (see Scenario Alpha).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 3: Terminate Subscription =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client tells Client Agent to remove subscription with specified token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/remove_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent removes binding &#039;&#039;T&#039;&#039; from User Exchange.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 4: Broadcast to Other Clients =&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Client broadcasts message to other clients of the authorized user. The format is very similar to that of the POST Office API.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/broadcast HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&lt;br /&gt;
     &amp;quot;body&amp;quot;:&amp;quot;{\&amp;quot;IV\&amp;quot;:\&amp;quot;IV in Base 64\&amp;quot;,...&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;:&amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Body is a JSON serialization of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 { &lt;br /&gt;
     &amp;quot;timestamp&amp;quot;: ######## (in seconds UTC), // Optional,&lt;br /&gt;
     &amp;quot;ttl&amp;quot;: ######## (in seconds), // Optional&lt;br /&gt;
     &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
     &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ciphertext is the payload encrypted with the client key using AES-256-CBC and base64 encoded. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;type&amp;quot;:&amp;quot;send_tab&amp;quot;,&lt;br /&gt;
 &amp;quot;client_id&amp;quot;:&amp;quot;base64url==&amp;quot;, // Sync client ID&lt;br /&gt;
 &amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
// implement either one of the following fields to transfer tab history and form data&lt;br /&gt;
 &amp;quot;moztabinfo&amp;quot;:{serialized tab info}                           // optional&lt;br /&gt;
 &amp;quot;tabinfo&amp;quot;:[{&amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;formdata&amp;quot;:&amp;quot;...&amp;quot;}]   // optional&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client Agent routes the notifications to the appropriate user exchange.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Broadcast Messages ==&lt;br /&gt;
&lt;br /&gt;
Each broadcast message is encrypted and contained entirely within the ciphertext attribute of the message body. The following is a list of the type of broadcast messages supported by clients.&lt;br /&gt;
&lt;br /&gt;
=== Send Tab To Client ===&lt;br /&gt;
Copies a tab from one client and sends it to another client.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;type&amp;quot;: &amp;quot;send_tab&amp;quot;,&lt;br /&gt;
 &amp;quot;client_id&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Sync client ID&lt;br /&gt;
 &amp;quot;url&amp;quot;: &amp;quot;...&amp;quot;,&lt;br /&gt;
// implement either one of the following fields to transfer tab history and form data&lt;br /&gt;
 &amp;quot;moztabinfo&amp;quot;: {serialized tab info}                           // optional&lt;br /&gt;
 &amp;quot;tabinfo&amp;quot;: [{&amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;formdata&amp;quot;:&amp;quot;...&amp;quot;}]   // optional (still needs specing)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sync Now ===&lt;br /&gt;
Send a message to clients indicating that important data has been synced, and so all clients should sync ASAP.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;type&amp;quot;: &amp;quot;sync_now&amp;quot;,&lt;br /&gt;
 &amp;quot;sender_id&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Sync client ID of client who sent this message&lt;br /&gt;
 &amp;quot;engines&amp;quot;: [&amp;quot;bookmarks&amp;quot;, &amp;quot;tabs&amp;quot;,...] // Optional list of engines to sync&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=296906</id>
		<title>CloudServices/Notifications/Specification/ClientAgent</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=296906"/>
		<updated>2011-04-08T22:10:18Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Sync Now */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Client Agent supports an RPC-like API which allows clients to register themselves with the notification service, as well as create and remove subscriptions to web app notifications.&lt;br /&gt;
&lt;br /&gt;
= Scenario 1: New (Potentially First) Client =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers with Client Agent&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_queue HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client agent generates Client ID (CID), creates User Exchange if necessary, creates and binds Client Queue CID, returns CID to Client.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
S:&lt;br /&gt;
S: {&amp;quot;host&amp;quot;:&amp;quot;amqp.services.mozilla.com&amp;quot;,&lt;br /&gt;
    &amp;quot;port&amp;quot;:5672,&lt;br /&gt;
    &amp;quot;queue_id&amp;quot;: &amp;quot;ASCII (max 255 chars)&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client records CID.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client fetches notifications/subscriptions WBO from Sync, decrypts with sync key. This returns the following (encrypted) JSON:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;T in Base64&amp;quot;: {&lt;br /&gt;
    &amp;quot;app_name&amp;quot;: &amp;quot;GMail&amp;quot;, &lt;br /&gt;
    &amp;quot;app_host&amp;quot;: &amp;quot;mail.google.com&amp;quot;, &lt;br /&gt;
    &amp;quot;app_account&amp;quot;: &amp;quot;sdasilva@gmail.com&amp;quot;,  // Optional&lt;br /&gt;
    &amp;quot;key&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;T2 in Base64&amp;quot;: {...}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 2: New Subscription =&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client generates symmetric key &#039;&#039;K&#039;&#039; = 256 random bits AES and and token &#039;&#039;T&#039;&#039; = 256 random bits.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers token &#039;&#039;T&#039;&#039; with Client Agent.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C:&lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent subscribes User Exchange to token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client uploads new notifications/subscriptions WBO to Sync (see Scenario 1, Step 4).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client passes key &#039;&#039;K&#039;&#039;, token &#039;&#039;T&#039;&#039;, and POST Office URL to web app (see Scenario Alpha).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 3: Terminate Subscription =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client tells Client Agent to remove subscription with specified token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/remove_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent removes binding &#039;&#039;T&#039;&#039; from User Exchange.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 4: Broadcast to Other Clients =&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Client broadcasts message to other clients of the authorized user. The format is very similar to that of the POST Office API.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/broadcast HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&lt;br /&gt;
     &amp;quot;body&amp;quot;:&amp;quot;{\&amp;quot;IV\&amp;quot;:\&amp;quot;IV in Base 64\&amp;quot;,...&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;:&amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Body is a JSON serialization of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 { &lt;br /&gt;
     &amp;quot;timestamp&amp;quot;: ######## (in seconds UTC), // Optional,&lt;br /&gt;
     &amp;quot;ttl&amp;quot;: ######## (in seconds), // Optional&lt;br /&gt;
     &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
     &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ciphertext is the payload encrypted with the client key using AES-256-CBC and base64 encoded. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;type&amp;quot;:&amp;quot;send_tab&amp;quot;,&lt;br /&gt;
 &amp;quot;client_id&amp;quot;:&amp;quot;base64url==&amp;quot;, // Sync client ID&lt;br /&gt;
 &amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
// implement either one of the following fields to transfer tab history and form data&lt;br /&gt;
 &amp;quot;moztabinfo&amp;quot;:{serialized tab info}                           // optional&lt;br /&gt;
 &amp;quot;tabinfo&amp;quot;:[{&amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;formdata&amp;quot;:&amp;quot;...&amp;quot;}]   // optional&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client Agent routes the notifications to the appropriate user exchange.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Broadcast Messages ==&lt;br /&gt;
&lt;br /&gt;
Each broadcast message is encrypted and contained entirely within the ciphertext attribute of the message body. The following is a list of the type of broadcast messages supported by clients.&lt;br /&gt;
&lt;br /&gt;
=== Send Tab To Client ===&lt;br /&gt;
Copies a tab from one client and sends it to another client.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;type&amp;quot;: &amp;quot;send_tab&amp;quot;,&lt;br /&gt;
 &amp;quot;client_id&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Sync client ID&lt;br /&gt;
 &amp;quot;url&amp;quot;: &amp;quot;...&amp;quot;,&lt;br /&gt;
// implement either one of the following fields to transfer tab history and form data&lt;br /&gt;
 &amp;quot;moztabinfo&amp;quot;: {serialized tab info}                           // optional&lt;br /&gt;
 &amp;quot;tabinfo&amp;quot;: [{&amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;formdata&amp;quot;:&amp;quot;...&amp;quot;}]   // optional (still needs specing)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sync Now ===&lt;br /&gt;
Send a message to clients indicating that important data has been synced, and so all clients should sync ASAP.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;type&amp;quot;: &amp;quot;sync_now&amp;quot;,&lt;br /&gt;
 &amp;quot;sender_id&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Sync client ID of client who sent this message&lt;br /&gt;
 &amp;quot;engines&amp;quot;: [&amp;quot;Clients&amp;quot;, &amp;quot;Bookmarks&amp;quot;, ...] // Optional list of engines to sync&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=296903</id>
		<title>CloudServices/Notifications/Specification/ClientAgent</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=296903"/>
		<updated>2011-04-08T22:01:00Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Scenario 4: Broadcast to Other Clients */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Client Agent supports an RPC-like API which allows clients to register themselves with the notification service, as well as create and remove subscriptions to web app notifications.&lt;br /&gt;
&lt;br /&gt;
= Scenario 1: New (Potentially First) Client =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers with Client Agent&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_queue HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client agent generates Client ID (CID), creates User Exchange if necessary, creates and binds Client Queue CID, returns CID to Client.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
S:&lt;br /&gt;
S: {&amp;quot;host&amp;quot;:&amp;quot;amqp.services.mozilla.com&amp;quot;,&lt;br /&gt;
    &amp;quot;port&amp;quot;:5672,&lt;br /&gt;
    &amp;quot;queue_id&amp;quot;: &amp;quot;ASCII (max 255 chars)&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client records CID.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client fetches notifications/subscriptions WBO from Sync, decrypts with sync key. This returns the following (encrypted) JSON:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;T in Base64&amp;quot;: {&lt;br /&gt;
    &amp;quot;app_name&amp;quot;: &amp;quot;GMail&amp;quot;, &lt;br /&gt;
    &amp;quot;app_host&amp;quot;: &amp;quot;mail.google.com&amp;quot;, &lt;br /&gt;
    &amp;quot;app_account&amp;quot;: &amp;quot;sdasilva@gmail.com&amp;quot;,  // Optional&lt;br /&gt;
    &amp;quot;key&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;T2 in Base64&amp;quot;: {...}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 2: New Subscription =&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client generates symmetric key &#039;&#039;K&#039;&#039; = 256 random bits AES and and token &#039;&#039;T&#039;&#039; = 256 random bits.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers token &#039;&#039;T&#039;&#039; with Client Agent.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C:&lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent subscribes User Exchange to token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client uploads new notifications/subscriptions WBO to Sync (see Scenario 1, Step 4).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client passes key &#039;&#039;K&#039;&#039;, token &#039;&#039;T&#039;&#039;, and POST Office URL to web app (see Scenario Alpha).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 3: Terminate Subscription =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client tells Client Agent to remove subscription with specified token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/remove_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent removes binding &#039;&#039;T&#039;&#039; from User Exchange.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 4: Broadcast to Other Clients =&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Client broadcasts message to other clients of the authorized user. The format is very similar to that of the POST Office API.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/broadcast HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&lt;br /&gt;
     &amp;quot;body&amp;quot;:&amp;quot;{\&amp;quot;IV\&amp;quot;:\&amp;quot;IV in Base 64\&amp;quot;,...&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;:&amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Body is a JSON serialization of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 { &lt;br /&gt;
     &amp;quot;timestamp&amp;quot;: ######## (in seconds UTC), // Optional,&lt;br /&gt;
     &amp;quot;ttl&amp;quot;: ######## (in seconds), // Optional&lt;br /&gt;
     &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
     &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ciphertext is the payload encrypted with the client key using AES-256-CBC and base64 encoded. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;type&amp;quot;:&amp;quot;send_tab&amp;quot;,&lt;br /&gt;
 &amp;quot;client_id&amp;quot;:&amp;quot;base64url==&amp;quot;, // Sync client ID&lt;br /&gt;
 &amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
// implement either one of the following fields to transfer tab history and form data&lt;br /&gt;
 &amp;quot;moztabinfo&amp;quot;:{serialized tab info}                           // optional&lt;br /&gt;
 &amp;quot;tabinfo&amp;quot;:[{&amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;formdata&amp;quot;:&amp;quot;...&amp;quot;}]   // optional&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client Agent routes the notifications to the appropriate user exchange.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Broadcast Messages ==&lt;br /&gt;
&lt;br /&gt;
Each broadcast message is encrypted and contained entirely within the ciphertext attribute of the message body. The following is a list of the type of broadcast messages supported by clients.&lt;br /&gt;
&lt;br /&gt;
=== Send Tab To Client ===&lt;br /&gt;
Copies a tab from one client and sends it to another client.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;type&amp;quot;: &amp;quot;send_tab&amp;quot;,&lt;br /&gt;
 &amp;quot;client_id&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Sync client ID&lt;br /&gt;
 &amp;quot;url&amp;quot;: &amp;quot;...&amp;quot;,&lt;br /&gt;
// implement either one of the following fields to transfer tab history and form data&lt;br /&gt;
 &amp;quot;moztabinfo&amp;quot;: {serialized tab info}                           // optional&lt;br /&gt;
 &amp;quot;tabinfo&amp;quot;: [{&amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;formdata&amp;quot;:&amp;quot;...&amp;quot;}]   // optional (still needs specing)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sync Now ===&lt;br /&gt;
Send a message to clients indicating that important data has been synced, and so all clients should sync ASAP.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;type&amp;quot;: &amp;quot;sync_now&amp;quot;,&lt;br /&gt;
 &amp;quot;sender_id&amp;quot;: &amp;quot;BASE64==&amp;quot;, // Sync client ID of sender&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=295570</id>
		<title>CloudServices/Notifications/Specification/ClientAgent</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=295570"/>
		<updated>2011-03-31T17:14:29Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Scenario 4: Broadcast to Other Clients */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Client Agent supports an RPC-like API which allows clients to register themselves with the notification service, as well as create and remove subscriptions to web app notifications.&lt;br /&gt;
&lt;br /&gt;
= Scenario 1: New (Potentially First) Client =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers with Client Agent&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_queue HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client agent generates Client ID (CID), creates User Exchange if necessary, creates and binds Client Queue CID, returns CID to Client.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
S:&lt;br /&gt;
S: {&amp;quot;host&amp;quot;:&amp;quot;amqp.services.mozilla.com&amp;quot;,&lt;br /&gt;
    &amp;quot;port&amp;quot;:5672,&lt;br /&gt;
    &amp;quot;queue_id&amp;quot;: &amp;quot;ASCII (max 255 chars)&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client records CID.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client fetches notifications/subscriptions WBO from Sync, decrypts with sync key. This returns the following (encrypted) JSON:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;T in Base64&amp;quot;: {&lt;br /&gt;
    &amp;quot;app_name&amp;quot;: &amp;quot;GMail&amp;quot;, &lt;br /&gt;
    &amp;quot;app_host&amp;quot;: &amp;quot;mail.google.com&amp;quot;, &lt;br /&gt;
    &amp;quot;app_account&amp;quot;: &amp;quot;sdasilva@gmail.com&amp;quot;,  // Optional&lt;br /&gt;
    &amp;quot;key&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;T2 in Base64&amp;quot;: {...}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 2: New Subscription =&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client generates symmetric key &#039;&#039;K&#039;&#039; = 256 random bits AES and and token &#039;&#039;T&#039;&#039; = 256 random bits.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers token &#039;&#039;T&#039;&#039; with Client Agent.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C:&lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent subscribes User Exchange to token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client uploads new notifications/subscriptions WBO to Sync (see Scenario 1, Step 4).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client passes key &#039;&#039;K&#039;&#039;, token &#039;&#039;T&#039;&#039;, and POST Office URL to web app (see Scenario Alpha).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 3: Terminate Subscription =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client tells Client Agent to remove subscription with specified token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/remove_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent removes binding &#039;&#039;T&#039;&#039; from User Exchange.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 4: Broadcast to Other Clients =&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Client broadcasts message to other clients of the authorized user. The format is very similar to that of the POST Office API.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/broadcast HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&lt;br /&gt;
     &amp;quot;body&amp;quot;:&amp;quot;{\&amp;quot;IV\&amp;quot;:\&amp;quot;IV in Base 64\&amp;quot;,...&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;:&amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Body is a JSON serialization of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 { &lt;br /&gt;
     &amp;quot;timestamp&amp;quot;: ######## (in seconds UTC), // Optional,&lt;br /&gt;
     &amp;quot;ttl&amp;quot;: ######## (in seconds), // Optional&lt;br /&gt;
     &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
     &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ciphertext is the payload encrypted with the client key using AES-256-CBC and base64 encoded. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;type&amp;quot;:&amp;quot;send_tab&amp;quot;,&lt;br /&gt;
 &amp;quot;client_id&amp;quot;:&amp;quot;base64url==&amp;quot;, // Sync client ID&lt;br /&gt;
 &amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
// implement either one of the following fields to transfer tab history and form data&lt;br /&gt;
 &amp;quot;moztabinfo&amp;quot;:{serialized tab info}                           // optional&lt;br /&gt;
 &amp;quot;tabinfo&amp;quot;:[{&amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;formdata&amp;quot;:&amp;quot;...&amp;quot;}]   // optional&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client Agent routes the notifications to the appropriate user exchange.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=295569</id>
		<title>CloudServices/Notifications/Specification/ClientAgent</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=295569"/>
		<updated>2011-03-31T17:13:52Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Scenario 4: Broadcast to Other Clients */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Client Agent supports an RPC-like API which allows clients to register themselves with the notification service, as well as create and remove subscriptions to web app notifications.&lt;br /&gt;
&lt;br /&gt;
= Scenario 1: New (Potentially First) Client =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers with Client Agent&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_queue HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client agent generates Client ID (CID), creates User Exchange if necessary, creates and binds Client Queue CID, returns CID to Client.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
S:&lt;br /&gt;
S: {&amp;quot;host&amp;quot;:&amp;quot;amqp.services.mozilla.com&amp;quot;,&lt;br /&gt;
    &amp;quot;port&amp;quot;:5672,&lt;br /&gt;
    &amp;quot;queue_id&amp;quot;: &amp;quot;ASCII (max 255 chars)&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client records CID.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client fetches notifications/subscriptions WBO from Sync, decrypts with sync key. This returns the following (encrypted) JSON:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;T in Base64&amp;quot;: {&lt;br /&gt;
    &amp;quot;app_name&amp;quot;: &amp;quot;GMail&amp;quot;, &lt;br /&gt;
    &amp;quot;app_host&amp;quot;: &amp;quot;mail.google.com&amp;quot;, &lt;br /&gt;
    &amp;quot;app_account&amp;quot;: &amp;quot;sdasilva@gmail.com&amp;quot;,  // Optional&lt;br /&gt;
    &amp;quot;key&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;T2 in Base64&amp;quot;: {...}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 2: New Subscription =&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client generates symmetric key &#039;&#039;K&#039;&#039; = 256 random bits AES and and token &#039;&#039;T&#039;&#039; = 256 random bits.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers token &#039;&#039;T&#039;&#039; with Client Agent.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C:&lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent subscribes User Exchange to token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client uploads new notifications/subscriptions WBO to Sync (see Scenario 1, Step 4).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client passes key &#039;&#039;K&#039;&#039;, token &#039;&#039;T&#039;&#039;, and POST Office URL to web app (see Scenario Alpha).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 3: Terminate Subscription =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client tells Client Agent to remove subscription with specified token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/remove_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent removes binding &#039;&#039;T&#039;&#039; from User Exchange.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 4: Broadcast to Other Clients =&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Client broadcasts message to other clients. The format is very similar to that of the POST Office API.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/broadcast HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&lt;br /&gt;
     &amp;quot;body&amp;quot;:&amp;quot;{\&amp;quot;IV\&amp;quot;:\&amp;quot;IV in Base 64\&amp;quot;,...&amp;quot;,&lt;br /&gt;
     &amp;quot;HMAC&amp;quot;:&amp;quot;BASE64==&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Body is a JSON serialization of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 { &lt;br /&gt;
     &amp;quot;timestamp&amp;quot;: ######## (in seconds UTC), // Optional,&lt;br /&gt;
     &amp;quot;ttl&amp;quot;: ######## (in seconds), // Optional&lt;br /&gt;
     &amp;quot;ciphertext&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
     &amp;quot;IV&amp;quot;: &amp;quot;BASE64==&amp;quot;,&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ciphertext is the payload encrypted with the client key using AES-256-CBC and base64 encoded. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;type&amp;quot;:&amp;quot;send_tab&amp;quot;,&lt;br /&gt;
 &amp;quot;client_id&amp;quot;:&amp;quot;base64url==&amp;quot;, // Sync client ID&lt;br /&gt;
 &amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;,&lt;br /&gt;
// implement either one of the following fields to transfer tab history and form data&lt;br /&gt;
 &amp;quot;moztabinfo&amp;quot;:{serialized tab info}                           // optional&lt;br /&gt;
 &amp;quot;tabinfo&amp;quot;:[{&amp;quot;url&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;title&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;formdata&amp;quot;:&amp;quot;...&amp;quot;}]   // optional&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client Agent routes the notifications to the appropriate user exchange.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-03-29&amp;diff=294608</id>
		<title>CloudServices/Meetings/2011-03-29</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-03-29&amp;diff=294608"/>
		<updated>2011-03-29T16:15:10Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Notifications (Shane/Alex) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MeetingInfo&lt;br /&gt;
|dayOfWeek=Tuesday&lt;br /&gt;
|est=12:15 PM&lt;br /&gt;
|pst=9:15 AM&lt;br /&gt;
|utc=5:15 PM&lt;br /&gt;
|room=Mozilla HQ, Warp Core&lt;br /&gt;
|confId=8616&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Technical  =&lt;br /&gt;
&lt;br /&gt;
== Ops  ==&lt;br /&gt;
...is awesome.&lt;br /&gt;
&lt;br /&gt;
== Engineering ==&lt;br /&gt;
&lt;br /&gt;
=== Python Sync Server (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
Coordination:&lt;br /&gt;
* waiting for proper bench environment from ops&lt;br /&gt;
&lt;br /&gt;
=== Python Reg Server (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
Coordination:&lt;br /&gt;
* waiting for ops plans on pushing to prod (after storage server I guess)&lt;br /&gt;
&lt;br /&gt;
=== PHP Sync Server (Toby) ===&lt;br /&gt;
&lt;br /&gt;
=== Identity Server (JR/rnewman) ===&lt;br /&gt;
Done:&lt;br /&gt;
&lt;br /&gt;
* unpack/setup&lt;br /&gt;
* tried to fix login test (can&#039;t figure out how to remove beaker session cookie)&lt;br /&gt;
* rebuild of web4 (and assoc. make file)&lt;br /&gt;
* Styling of login, authorize pages.&lt;br /&gt;
* update deployment Makefile (accidentally broke dev deployment)&lt;br /&gt;
* initial flake8 fixes to code&lt;br /&gt;
* prelim. security review for ID server&lt;br /&gt;
* resolve bug with IAR returns&lt;br /&gt;
* finished rough version of the user info page (allow user control of cookies, etc.)&lt;br /&gt;
&lt;br /&gt;
Next:&lt;br /&gt;
&lt;br /&gt;
* figure out beaker session issue (remove login cookie)&lt;br /&gt;
* code review of ID server (yes, I&#039;m behind on this.)&lt;br /&gt;
&lt;br /&gt;
Coordination:&lt;br /&gt;
&lt;br /&gt;
* work with apps team to make sure they can understand/use current code.&lt;br /&gt;
* work with thunder to ensure that demo script works as intended/planned.&lt;br /&gt;
&lt;br /&gt;
=== F1 (Share) (Philipp/Tarek) ===&lt;br /&gt;
&lt;br /&gt;
* client-side&lt;br /&gt;
** Released 0.8.2 add-on&lt;br /&gt;
*** restartless&lt;br /&gt;
*** moved button from toolbar to location bar&lt;br /&gt;
** Integrated into Firefox&lt;br /&gt;
*** m-c project branch: https://hg.mozilla.org/users/pweitershausen_mozilla.com/fx-share/&lt;br /&gt;
** Next&lt;br /&gt;
*** split web bits off into https://github.com/mozilla/client-share-web&lt;br /&gt;
*** implement new APIs&lt;br /&gt;
*** write tests&lt;br /&gt;
*** waiting on UX for final UI&lt;br /&gt;
** WE HAVE TWO WEEKS TO LAND&lt;br /&gt;
* server-side&lt;br /&gt;
** done&lt;br /&gt;
*** split the oauth lib as a standalone pylons-free lib&lt;br /&gt;
*** code is now tested (63%),&lt;br /&gt;
*** started the services status DB &lt;br /&gt;
** next&lt;br /&gt;
*** more tests&lt;br /&gt;
*** remove pylons in the web app&lt;br /&gt;
*** work in pylibmc&lt;br /&gt;
&lt;br /&gt;
=== Firefox Home (Stefan) ===&lt;br /&gt;
&lt;br /&gt;
=== Sync Client (rnewman) ===&lt;br /&gt;
&lt;br /&gt;
=== Notifications (Shane/Alex) ===&lt;br /&gt;
* Ready for presentation/demo today @ 3PM&lt;br /&gt;
* Will incorporate feedback from presentation in future iterations&lt;br /&gt;
* Meeting with Toby/Philipp sometime after demo to discuss future steps&lt;br /&gt;
&lt;br /&gt;
= QA =&lt;br /&gt;
&lt;br /&gt;
= Metrics  =&lt;br /&gt;
&lt;br /&gt;
= Product =&lt;br /&gt;
&lt;br /&gt;
= Security =&lt;br /&gt;
&lt;br /&gt;
= Marketing  =&lt;br /&gt;
&lt;br /&gt;
= Roundtable  =&lt;br /&gt;
&lt;br /&gt;
== Notes and actions ==&lt;br /&gt;
&lt;br /&gt;
== Follow ups from last week ==&lt;br /&gt;
&lt;br /&gt;
=== Other issues ===&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-03-15&amp;diff=291081</id>
		<title>CloudServices/Meetings/2011-03-15</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-03-15&amp;diff=291081"/>
		<updated>2011-03-15T16:18:44Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Notifications (Shane/Alex) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MeetingInfo&lt;br /&gt;
|dayOfWeek=Tuesday&lt;br /&gt;
|est=12:15 PM&lt;br /&gt;
|pst=9:15 AM&lt;br /&gt;
|utc=5:15 PM&lt;br /&gt;
|room=Mozilla HQ, Warp Core&lt;br /&gt;
|confId=8616&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Technical  =&lt;br /&gt;
&lt;br /&gt;
== Ops  ==&lt;br /&gt;
* SCL status&lt;br /&gt;
** Py out, PHP in&lt;br /&gt;
** DB deadlock preventer&lt;br /&gt;
** Capacity status&lt;br /&gt;
*** We can spool up enough machines to *at least* handle all of what&#039;s in PHX now.&lt;br /&gt;
*** 72 DBs total, 5 live right now.&lt;br /&gt;
*** Still capacity testing (next to prod)&lt;br /&gt;
* Reminder -- Ops is in &amp;quot;lock down&amp;quot; until at least 24 Mar 2011&lt;br /&gt;
&lt;br /&gt;
== Engineering ==&lt;br /&gt;
&lt;br /&gt;
=== Python Sync Server (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
=== Python Reg Server (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
=== PHP Sync Server (Toby) ===&lt;br /&gt;
&lt;br /&gt;
* Reverting to PHP in SCL for FF4 launch&lt;br /&gt;
* Working on infra scripts that were abandoned due to Python changeover&lt;br /&gt;
* Indexes in production do not match the ones in stage or documented in code. This includes PHX (SCL ones were way off)&lt;br /&gt;
** Unclear if this is a problem - is cheaper write load offsetting lack of a range index?&lt;br /&gt;
&lt;br /&gt;
=== Identity Server (JR/rnewman) ===&lt;br /&gt;
Done:&lt;br /&gt;
* added new functions for latest rev of spec&lt;br /&gt;
* added new test cases&lt;br /&gt;
* Worked on milestones for latest rev https://wiki.mozilla.org/MozillaID#Releases.2FRoadmap with etherpad at http://etherpad.mozilla.com:9000/Y6PJYj9Oa8&lt;br /&gt;
* Worked with rnewman to get FE Library running.&lt;br /&gt;
* Talked with petef re: ops (provided initial schema for data storage considerations)&lt;br /&gt;
* put together draft timeline for M1 &amp;amp; M2&lt;br /&gt;
&lt;br /&gt;
Next:&lt;br /&gt;
* Continue work on M1 tasks.&lt;br /&gt;
* Continue work with rnewman re: JS Lib interface.&lt;br /&gt;
* move everybody else&#039;s crap to the new digs?&lt;br /&gt;
&lt;br /&gt;
=== Firefox Home (Stefan) ===&lt;br /&gt;
&lt;br /&gt;
=== Sync Client (Philipp ===&lt;br /&gt;
&lt;br /&gt;
=== Notifications (Shane/Alex) ===&lt;br /&gt;
* End-to-end crypto fully functional&lt;br /&gt;
* Working on harnessing test framework for client-side code&lt;br /&gt;
* Waiting on ops to set up a VM to use as a demo server&lt;br /&gt;
* Building demo web apps to run on VM once set up&lt;br /&gt;
&lt;br /&gt;
= QA =&lt;br /&gt;
* Working on a Sync testing helpful tips video for QMO.&lt;br /&gt;
* Let us know if you need testing for anything in particular this week.&lt;br /&gt;
&lt;br /&gt;
= Metrics  =&lt;br /&gt;
&lt;br /&gt;
= Product =&lt;br /&gt;
&lt;br /&gt;
= Security =&lt;br /&gt;
&lt;br /&gt;
= Marketing  =&lt;br /&gt;
&lt;br /&gt;
* Desktop video for launch: https://videos.mozilla.org/manage/marketing/foxy3300.mp4&lt;br /&gt;
* Setup video being updated&lt;br /&gt;
* Launch blog post: http://etherpad.mozilla.com:9000/sync-launch-post&lt;br /&gt;
&lt;br /&gt;
= Roundtable  =&lt;br /&gt;
&lt;br /&gt;
== Notes and actions ==&lt;br /&gt;
&lt;br /&gt;
== Follow ups from last week ==&lt;br /&gt;
&lt;br /&gt;
* By next meeting we should have a project plan for Identity ready for review.&lt;br /&gt;
* Fennec Perf - we have done everything we can from Sync&#039;s end. Other fixes will need changes to APIs Sync uses (like Password Manager, Places etc).&lt;br /&gt;
** MConnor to follow up with Stuart to ensure we&#039;re all on the same page.&lt;br /&gt;
* &amp;lt;strike&amp;gt;1.7 add-on QA sign off targeting tomorrow (assuming no major issues).&amp;lt;/strike&amp;gt; Tested and Shipped&lt;br /&gt;
* &amp;lt;strike&amp;gt;Jeff and Tony to figure out sign off process.&amp;lt;/strike&amp;gt; Worked it out with team, more notification upfront&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Fx 4 client ===&lt;br /&gt;
=== Fx 4 server ===&lt;br /&gt;
&lt;br /&gt;
=== Other issues ===&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=290228</id>
		<title>CloudServices/Notifications/Specification/ClientAgent</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Notifications/Specification/ClientAgent&amp;diff=290228"/>
		<updated>2011-03-10T01:06:26Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Scenario 1: New (Potentially First) Client */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Client Agent supports an RPC-like API which allows clients to register themselves with the notification service, as well as create and remove subscriptions to web app notifications.&lt;br /&gt;
&lt;br /&gt;
= Scenario 1: New (Potentially First) Client =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers with Client Agent&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_queue HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client agent generates Client ID (CID), creates User Exchange if necessary, creates and binds Client Queue CID, returns CID to Client.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
S:&lt;br /&gt;
S: {&amp;quot;host&amp;quot;:&amp;quot;amqp.services.mozilla.com&amp;quot;,&lt;br /&gt;
    &amp;quot;port&amp;quot;:5672,&lt;br /&gt;
    &amp;quot;queue_id&amp;quot;: &amp;quot;ASCII (max 255 chars)&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client records CID.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client fetches notifications/subscriptions WBO from Sync, decrypts with sync key. This returns the following (encrypted) JSON:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;T in Base64&amp;quot;: {&lt;br /&gt;
    &amp;quot;app_name&amp;quot;: &amp;quot;GMail&amp;quot;, &lt;br /&gt;
    &amp;quot;app_host&amp;quot;: &amp;quot;mail.google.com&amp;quot;, &lt;br /&gt;
    &amp;quot;app_account&amp;quot;: &amp;quot;sdasilva@gmail.com&amp;quot;,  // Optional&lt;br /&gt;
    &amp;quot;key&amp;quot;: &amp;quot;BASE64==&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;T2 in Base64&amp;quot;: {...}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 2: New Subscription =&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client generates symmetric key &#039;&#039;K&#039;&#039; = 256 random bits AES and and token &#039;&#039;T&#039;&#039; = 256 random bits.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client registers token &#039;&#039;T&#039;&#039; with Client Agent.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/new_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C:&lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent subscribes User Exchange to token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client uploads new notifications/subscriptions WBO to Sync (see Scenario 1, Step 4).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Client passes key &#039;&#039;K&#039;&#039;, token &#039;&#039;T&#039;&#039;, and POST Office URL to web app (see Scenario Alpha).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scenario 3: Terminate Subscription =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client tells Client Agent to remove subscription with specified token &#039;&#039;T&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C: POST /1.0/remove_subscription HTTP/1.1&lt;br /&gt;
C: Authorization: Basic BASE64==&lt;br /&gt;
C: &lt;br /&gt;
C: {&amp;quot;token&amp;quot;: &amp;quot;T in Base 64&amp;quot;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Client Agent removes binding &#039;&#039;T&#039;&#039; from User Exchange.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S: HTTP/1.1 200 OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-03-08&amp;diff=289599</id>
		<title>CloudServices/Meetings/2011-03-08</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-03-08&amp;diff=289599"/>
		<updated>2011-03-08T17:29:37Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Notifications (Shane/Alex) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MeetingInfo&lt;br /&gt;
|dayOfWeek=Tuesday&lt;br /&gt;
|est=12:15 PM&lt;br /&gt;
|pst=9:15 AM&lt;br /&gt;
|utc=5:15 PM&lt;br /&gt;
|room=Mozilla HQ, Warp Core&lt;br /&gt;
|confId=8616&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Technical  =&lt;br /&gt;
&lt;br /&gt;
== Ops  ==&lt;br /&gt;
&lt;br /&gt;
=== SCL2 work ===&lt;br /&gt;
&lt;br /&gt;
=== Upcoming production work ===&lt;br /&gt;
&lt;br /&gt;
== Engineering ==&lt;br /&gt;
&lt;br /&gt;
=== Account Management Portal (Toby) ===&lt;br /&gt;
Done. Live. Woot!&lt;br /&gt;
&lt;br /&gt;
=== Next-gen Reg/Sync Server (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
=== PAKE server (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
=== Identity Server (JR) ===&lt;br /&gt;
Done:&lt;br /&gt;
* Handed over spec to Thunder for refinements and additions. (Published publicly&lt;br /&gt;
* coded mongo db interfaces, &amp;amp; test cases. Built prelim. server API (continuing test cases)&lt;br /&gt;
* Various ID discussions with rnewman &amp;amp; thunder&lt;br /&gt;
&lt;br /&gt;
Next:&lt;br /&gt;
* finish test cases&lt;br /&gt;
* talk with petef re: opt. db server deployment&lt;br /&gt;
* add latest spec deltas&lt;br /&gt;
&lt;br /&gt;
=== Firefox Home 2.0 ===&lt;br /&gt;
&lt;br /&gt;
First rough demo on http://fxho.me .. contains both live sync data and fake data.&lt;br /&gt;
&lt;br /&gt;
Later today first meeting to figure out a more concrete plan for version 1.0.&lt;br /&gt;
&lt;br /&gt;
=== Fennec performance issues (philipp) ===&lt;br /&gt;
&lt;br /&gt;
* Killed most history events &amp;gt;150ms&lt;br /&gt;
* Broke up long blocking password and form events into smaller chunks. They&#039;re now bound by the synchronous I/O which is in the 500-2000ms range.&lt;br /&gt;
* Pretty much any improvement at this point requires platform API support, e.g.:&lt;br /&gt;
** async bulk APIs for forms, passwords, bookmarks&lt;br /&gt;
** improved API for history (less callbacks, accept strings instead of nsIURI, etc.)&lt;br /&gt;
** tailoured crypto API to encrypt and sign records&lt;br /&gt;
&lt;br /&gt;
=== Fx4 Sync Blockers (philipp/rnewman) ===&lt;br /&gt;
&lt;br /&gt;
* Our last Fennec blockers landed on m-c last night.&lt;br /&gt;
* fx-sync is on its way to retirement, for add-on bugfixes only. Long live services-central!&lt;br /&gt;
&lt;br /&gt;
=== Notifications (Shane/Alex) ===&lt;br /&gt;
* Full-circle workflow is now fully functional&lt;br /&gt;
* Sync key exchange on multiple clients&lt;br /&gt;
* Currently wrapping up encryption and HMAC support&lt;br /&gt;
&lt;br /&gt;
= QA =&lt;br /&gt;
* Testing 1.7; extension and interaction with Fx4&lt;br /&gt;
&lt;br /&gt;
= Metrics  =&lt;br /&gt;
&lt;br /&gt;
= Product =&lt;br /&gt;
&lt;br /&gt;
* Planning currently underway for Fx 5 and beyond within Product team. See #services for link. &lt;br /&gt;
* Expect conversations around this in the upcoming days to jump start projects.&lt;br /&gt;
&lt;br /&gt;
= Security =&lt;br /&gt;
&lt;br /&gt;
= Marketing  =&lt;br /&gt;
&lt;br /&gt;
= Roundtable  =&lt;br /&gt;
&lt;br /&gt;
== Notes and actions ==&lt;br /&gt;
&lt;br /&gt;
* SCL2 roll out went well. We have a few thousand users now.&lt;br /&gt;
* Account portal is up and live.&lt;br /&gt;
* PHX firewall issue is being monitored, not expected to have major impact on Sync users.&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
== Follow ups from last week ==&lt;br /&gt;
&lt;br /&gt;
* SCL2 should be ready to take on live users this week (target: Wed)&lt;br /&gt;
* Load tests are being run right now. Target for initial sync is 100K/hour.&lt;br /&gt;
* Account Portal is going to be launched in production today and be user facing either Wed/Thurs.&lt;br /&gt;
* Tomorrow&#039;s nightly is a good target for all the perf fixes to be tested by a wider audience.&lt;br /&gt;
* March 15 is the target readiness date.&lt;br /&gt;
* General consensus around the room that everyone is good and confident with that date.&lt;br /&gt;
* An add-on update will be required to be completed by 3/15 as well to bring add-on users up to the latest sync changes and also auto disable itself on Fx 4.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Fx 4 client ===&lt;br /&gt;
=== Fx 4 server ===&lt;br /&gt;
&lt;br /&gt;
=== Other issues ===&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-03-08&amp;diff=289596</id>
		<title>CloudServices/Meetings/2011-03-08</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=CloudServices/Meetings/2011-03-08&amp;diff=289596"/>
		<updated>2011-03-08T17:27:22Z</updated>

		<summary type="html">&lt;p&gt;Sdasilva: /* Notifications (Shane/Alex) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MeetingInfo&lt;br /&gt;
|dayOfWeek=Tuesday&lt;br /&gt;
|est=12:15 PM&lt;br /&gt;
|pst=9:15 AM&lt;br /&gt;
|utc=5:15 PM&lt;br /&gt;
|room=Mozilla HQ, Warp Core&lt;br /&gt;
|confId=8616&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Technical  =&lt;br /&gt;
&lt;br /&gt;
== Ops  ==&lt;br /&gt;
&lt;br /&gt;
=== SCL2 work ===&lt;br /&gt;
&lt;br /&gt;
=== Upcoming production work ===&lt;br /&gt;
&lt;br /&gt;
== Engineering ==&lt;br /&gt;
&lt;br /&gt;
=== Account Management Portal (Toby) ===&lt;br /&gt;
Done. Live. Woot!&lt;br /&gt;
&lt;br /&gt;
=== Next-gen Reg/Sync Server (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
=== PAKE server (Tarek) ===&lt;br /&gt;
&lt;br /&gt;
=== Identity Server (JR) ===&lt;br /&gt;
Done:&lt;br /&gt;
* Handed over spec to Thunder for refinements and additions. (Published publicly&lt;br /&gt;
* coded mongo db interfaces, &amp;amp; test cases. Built prelim. server API (continuing test cases)&lt;br /&gt;
* Various ID discussions with rnewman &amp;amp; thunder&lt;br /&gt;
&lt;br /&gt;
Next:&lt;br /&gt;
* finish test cases&lt;br /&gt;
* talk with petef re: opt. db server deployment&lt;br /&gt;
* add latest spec deltas&lt;br /&gt;
&lt;br /&gt;
=== Firefox Home 2.0 ===&lt;br /&gt;
&lt;br /&gt;
First rough demo on http://fxho.me .. contains both live sync data and fake data.&lt;br /&gt;
&lt;br /&gt;
Later today first meeting to figure out a more concrete plan for version 1.0.&lt;br /&gt;
&lt;br /&gt;
=== Fennec performance issues (philipp) ===&lt;br /&gt;
&lt;br /&gt;
* Killed most history events &amp;gt;150ms&lt;br /&gt;
* Broke up long blocking password and form events into smaller chunks. They&#039;re now bound by the synchronous I/O which is in the 500-2000ms range.&lt;br /&gt;
* Pretty much any improvement at this point requires platform API support, e.g.:&lt;br /&gt;
** async bulk APIs for forms, passwords, bookmarks&lt;br /&gt;
** improved API for history (less callbacks, accept strings instead of nsIURI, etc.)&lt;br /&gt;
** tailoured crypto API to encrypt and sign records&lt;br /&gt;
&lt;br /&gt;
=== Fx4 Sync Blockers (philipp/rnewman) ===&lt;br /&gt;
&lt;br /&gt;
* Our last Fennec blockers landed on m-c last night.&lt;br /&gt;
* fx-sync is on its way to retirement, for add-on bugfixes only. Long live services-central!&lt;br /&gt;
&lt;br /&gt;
=== Notifications (Shane/Alex) ===&lt;br /&gt;
* Full-circle workflow is now fully functional&lt;br /&gt;
* Sync key exchange on multiple clients&lt;br /&gt;
* Encryption and HMAC support almost done&lt;br /&gt;
&lt;br /&gt;
= QA =&lt;br /&gt;
* Testing 1.7; extension and interaction with Fx4&lt;br /&gt;
&lt;br /&gt;
= Metrics  =&lt;br /&gt;
&lt;br /&gt;
= Product =&lt;br /&gt;
&lt;br /&gt;
* Planning currently underway for Fx 5 and beyond within Product team. See #services for link. &lt;br /&gt;
* Expect conversations around this in the upcoming days to jump start projects.&lt;br /&gt;
&lt;br /&gt;
= Security =&lt;br /&gt;
&lt;br /&gt;
= Marketing  =&lt;br /&gt;
&lt;br /&gt;
= Roundtable  =&lt;br /&gt;
&lt;br /&gt;
== Notes and actions ==&lt;br /&gt;
&lt;br /&gt;
== Follow ups from last week ==&lt;br /&gt;
&lt;br /&gt;
* SCL2 should be ready to take on live users this week (target: Wed)&lt;br /&gt;
* Load tests are being run right now. Target for initial sync is 100K/hour.&lt;br /&gt;
* Account Portal is going to be launched in production today and be user facing either Wed/Thurs.&lt;br /&gt;
* Tomorrow&#039;s nightly is a good target for all the perf fixes to be tested by a wider audience.&lt;br /&gt;
* March 15 is the target readiness date.&lt;br /&gt;
* General consensus around the room that everyone is good and confident with that date.&lt;br /&gt;
* An add-on update will be required to be completed by 3/15 as well to bring add-on users up to the latest sync changes and also auto disable itself on Fx 4.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Fx 4 client ===&lt;br /&gt;
=== Fx 4 server ===&lt;br /&gt;
&lt;br /&gt;
=== Other issues ===&lt;/div&gt;</summary>
		<author><name>Sdasilva</name></author>
	</entry>
</feed>