﻿<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<?rfc comments="yes" ?>
<?rfc inline="yes" ?>

<rfc category="std" ipr="trust200902" docName="draft-damaggio-webpush-http2-00">
  <front>
    <title abbrev="HTTP Web Push">
      Generic Event Delivery Using HTTP Push
    </title>

    <author initials="E." surname="Damaggio" fullname="Elio Damaggio">
      <organization>Microsoft</organization>
      <address>
        <postal>
          <street>One Microsoft Way</street>
          <city>Redmond</city>
          <region>WA</region>
          <code>98052</code>
          <country>US</country>
        </postal>
        <email>elioda@microsoft.com</email>
      </address>
    </author>

	    <author initials="B." surname="Raymor" fullname="Brian Raymor">
      <organization>Microsoft</organization>
      <address>
        <postal>
          <street>One Microsoft Way</street>
          <city>Redmond</city>
          <region>WA</region>
          <code>98052</code>
          <country>US</country>
        </postal>
        <email>brian.raymor@microsoft.com</email>
      </address>
    </author>

    <date year="2015"/>
    <area>RAI</area>
    <workgroup>WEBPUSH</workgroup>
    <keyword>Internet-Draft</keyword>
    <keyword>HTTP</keyword>
    <keyword>HTTP2</keyword>
    <keyword>Push</keyword>
    <keyword>WebPush</keyword>

    <abstract>
      <t>
        A simple protocol for the delivery of realtime events to user agents is
        described.  This scheme uses HTTP/2 server push.
      </t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t>
        Many applications on mobile and embedded devices require continuous access to
        network communications so that real-time events - such as incoming calls or messages -
        can be conveyed (or "pushed") in a timely fashion. 
      </t>
      <t>
        Mobile and embedded devices typically have limited power reserves, so finding more
        efficient ways to serve application requirements greatly benefits the application
        ecosystem. One significant contributor to power usage is the radio. Radio communications
        consume a significant portion of the energy budget on a wirelessly connected device.
      </t>
      <t>
        Uncoordinated use of persistent connections or sessions can contribute to
        unnecessary use of the device radio, since each independent session independently
        incurs overheads.  In particular, keep alive traffic used to ensure that middleboxes
        do not prematurely time out sessions, can result in significant waste.  Maintenance
        traffic tends to dominate over the long term, since events are relatively rare.
      </t>
      <t>
        Consolidating all real-time events into a single session ensures more
        efficient use of network and radio resources.  A single service
        consolidates all events, distributing those events to applications as
        they arrive.  This requires just one session, avoiding duplicated
        overhead costs.
      </t>
      <t>
        A push server that does not support reliable delivery over intermittent network
        connections or failing applications on devices, forces the device to acknowledge
        receipt directly to the application server, incurring additional power drain in
        order to establish (usually secure) connections to the individual application servers.
      </t>
      <t>
        While reliability is not required for messages that expire in few seconds
        (e.g. an incoming call) or collapsible ones (e.g. the current number of unread emails),
        it is more important when messages contain information that is longer lasting,
        e.g. a command to update a configuration value, or the acknowledgement of a financial
        transaction or workflow step. In particular, in the case of power-constrained devices,
        it is preferable to transmit the actual information in the “pushed” message reliably,
        instead of forcing them to reconnect periodically to get the current state.
      </t>
      <t>
        An open standard to "push" messages to embedded and mobile devices:
        <list style="symbols">
          <t>
            Simplifies deployment of "push" features across a variety of mobile and embedded device platforms
          </t>
          <t>
            Creates an ecosystem of services (e.g. consolidation services) and development tools
            enabling efficient "push"
          </t>
          <t>
           Technically enables consolidating real-time events into a single session which is impossible
            when each "push" implementation is built in isolation
          </t>
        </list>
      </t>
  
      <t>
        There are two primary scenarios under consideration:
        <list style="symbols">
          <t>
            Web applications in a mobile user agent and
         </t>
          <t>
            Embedded devices receiving push messages from cloud services through an
            intermediate “field gateway”, i.e. a reasonably powerful device
            (capable of secure HTTP/2 communications), which acts as a local agent.
          </t>
        </list>
      </t>
    <t>
      The <xref target="API">W3C Web Push API</xref> describes an API that enables
      the use of a consolidated push service from web applications.  This
      expands on that work by describing a protocol that can be used to:
      <list style="symbols">
        <t>
          request the delivery of a push message to a user agent,
        </t>
        <t>
          create new push message delivery subscriptions, and
        </t>
        <t>
          monitor for new push messages.
        </t>
      </list>
    </t>
    <t>
      Requesting the delivery of events is particularly important for the Web
      Push API.  The registration, management and monitoring functions are
      currently fulfilled by proprietary protocols; these are adequate, but do
      not offer any of the advantages that standardization affords.
    </t>
    <t>
      In the embedded field gateway scenario, small (possibly much less capable devices)
      connect to a field gateway to receive push messages. This protocol does not detail
      the device-to-field gateway connection, instead it details how the field-gateway can
      efficiently receive push messages on behalf of many devices.
    </t>
    <t>
     This document intentionally does not describe how a push service is
     discovered.  Discovery of push services is left for future efforts,
     if it turns out to be necessary at all.  User agents are expected to
     be configured with a URL for one (or more) push services.
    </t>
  
      <section anchor="terminology" title="Conventions and Terminology">
        <t>
          In cases where normative language needs to be emphasized, this
          document falls back on established shorthands for expressing
          interoperability requirements on implementations: the capitalized
          words "MUST", "MUST NOT", "SHOULD" and "MAY".  The meaning of these is
          described in <xref target="RFC2119"/>.
        </t>

        <t>
          This document defines the following terms:
          <list style="hanging">
            <t hangText="application:">
              Both the sender and ultimate consumer of push messages.  Many
              applications have components that are run on a user agent and
              other components that run on servers.
            </t>
            <t hangText="application server:">
              The component of an application that runs on a server and requests
              the delivery of a push message.
            </t>
            <t hangText="push message:">
              A message, sent from an application server to a user agent via a
              push service.
            </t>
            <t hangText="push service:">
              A service that delivers push messages to user agents.
            </t>
            <t hangText="subscription:">
              A message delivery context that is established between the user
              agent and the push service and shared with applications.  All push
              messages are associated with a subscription.
            </t>
            <t hangText="user agent:">
              A device and software that is the recipient of push messages.
            </t>
          </list>
        </t>

        <t>
          Examples in this document use the <xref target="RFC7230">HTTP/1.1
          message format</xref>.  Many of the exchanges can be completed using
          HTTP/1.1, where HTTP/2 is necessary, the more verbose frame format
          from <xref target="I-D.ietf-httpbis-http2"/> is used.
        </t>
      </section>
    </section>

    <section title="Overview">
      <t>
        A general model for push services includes three basic actors: a user
        agent, a push service, and an application (server).
      </t>
      <figure>
          <artwork><![CDATA[
 +-------+           +--------------+       +-------------+
 |  UA   |           | Push Service |       | Application |
 +-------+           +--------------+       +-------------+
     |                      |                      |
     |      Subscribe       |                      |
     |--------------------->|                      |
     |       Monitor        |                      |
     |<====================>|                      |
     |                      |                      |
     |           Provide Subscription              |
     |-------------------------------------------->|
     |                      |                      |
     :                      :                      :
     |                      |     Push Message     |
     |    Push Message      |<---------------------|
     |<---------------------|                      |
     |                      |                      |
]]></artwork>
      </figure>
      <t>
        At the very beginning of the process, a new subscription is created by
		the user agent and then distributed to an application server. The 
		subscription is the basis of all future interactions between the user 
		agent and push service.
      </t>
      <t>
        It is expected that a different subscription will be provided to each
        application; however, there are no inherent cardinality constraints in
        the protocol.  Multiple subscriptions might be created for the same
        application, or multiple applications could use the same subscription.
        Note however that sharing subscriptions can have security and privacy
        implications.
      </t>
      <t>
        Application servers use subscriptions to deliver push messages to
        user agents, via the push service.
      </t>
      <t>
        Subscriptions have a limited lifetime.  They can
        also be terminated by either push service or user agent at any time.
        User agents and application servers need to be prepared to manage
        changes in subscription state. 
      </t>

      <section anchor="resources" title="HTTP Resources">
        <t>
          This protocol uses <xref target="RFC7230">HTTP resources</xref> and
          <xref target="RFC5988">link relations</xref>.  The following resources
          are defined:
          <list style="hanging">
            <t hangText="push service:">
              This resource is used in <xref
              target="subscribe">Subscribing</xref>.  It is configured into user
              agents.
            </t>
            <t hangText="subscription:">
              A link relation of type "urn:ietf:params:push" refers to a
              subscription resource.  Subscription resources are used to deliver
              push messages.  An application server <xref target="send">sends
              push messages</xref> and a user agent <xref
              target="monitor">receives push messages</xref> using this
              resource.
            </t>
            <t hangText="receipt:">
              A link relation of type "urn:ietf:params:push:receipt" refers to a
              delivery receipt resource.  An application server <xref target="request_receipt"> receives
			  delivery confirmation</xref> for push messages using this resource.
            </t>
          </list>
        </t>
      </section>
    </section>

    <section anchor="register" title="Registration">
      <t>
        The Registration and Subscribe resources referenced in <xref target="I-D.draft-thomson-webpush-http2-02"/>
        were deprecated to eliminate the overhead of maintaining registration-subscription relationships in the
        push server.
      </t>
    </section>
    <section anchor="subscribe" title="Subscribing">
      <t>
        A user agent sends a POST request to its configured push service
		    resource to create a new subscription. 
      </t>
      <figure>
        <artwork type="inline"><![CDATA[
POST /subscribe/ HTTP/1.1
Host: push.example.net

]]></artwork>
      </figure>
      <t>
        A response with a 201 (Created) status code includes a URI for the
		subscription in the Location header field.
      </t>
      <figure>
        <artwork type="inline"><![CDATA[
HTTP/1.1 201 Created
Date: Thu, 11 Dec 2014 23:56:52 GMT
Link: </p/LBhhw0OohO-Wl4Oi971UGsB7sdQGUibx>;
        rel="urn:ietf:params:push"
Location: https://push.example.net/p/LBhhw0OohO-Wl4Oi971UGsB7sdQGUibx
Cache-Control: max-age:864000, private

]]></artwork>
      </figure>
	  <t>
	  The user agent should securely distribute the "subscription" resource to its application server.
	  (Details are outside the scope of this document.)
	  </t>
    </section>

    <section anchor="send" title="Requesting Push Message Delivery">

      <t>
        An application server requests the delivery of a push message by sending
        an HTTP POST request to the "subscription" resource distributed by its user
		agent. The push message is included in the body of the request.
      </t>
	  <t>
	  The push message is a JSON <xref target="RFC7159"/> object which contains
	  the push message data and directives for the push server: 
	  </t>

<texttable anchor="message_request_format" title="Push Message Request Format">
    <preamble></preamble>
    <ttcol align='left'>Member</ttcol>
    <ttcol align='left'>Use</ttcol>
    <ttcol align='left'>Description</ttcol>
    <c>message</c>
    <c>optional</c>
    <c>A JSON object that contains push message data</c>
    <c>request_receipt</c>
    <c>optional</c>
    <c>A JSON boolean indicating whether the application
	 server requests a confirmation that the push message was delivered
	 to the user agent. Its default value is false.
	</c>
    <c>time_to_live</c>
    <c>optional</c>
    <c>
      A JSON number that represents the expiration time in
	  seconds for a push message. It is relative to the time that the push
	  server receives the request. A message MUST NOT be delivered after it
    expires.
   </c>
</texttable>

      <figure>
        <artwork type="inline"><![CDATA[
POST /p/LBhhw0OohO-Wl4Oi971UGsB7sdQGUibx HTTP/1.1
Host: push.example.net
Content-Type: application/json
Content-Length: ...

{
 "request_receipt": true,
 "message": {"data": "Hello World"}
}

]]></artwork>
      </figure>
      <figure>
        <preamble>
          A response with a 201 (Created) status code includes a URI for the message 
		  in the Location header field. This does not indicate that the message was
		  delivered to the user agent. If a receipt was requested, then a URI
		  for the receipt resource is included in the Link header field in the
		  response.
        </preamble>
        <artwork type="inline"><![CDATA[
HTTP/1.1 201 Created
Date: Thu, 11 Dec 2014 23:56:55 GMT
Link: </r/LBhhw0OohO-Wl4Oi971UGsB7sdQGUibx/;
        rel="urn:ietf:params:push:receipt"
Cache-Control: max-age=600
Location: https://push.example.net/p/LBhhw0OohO-Wl4Oi971UGsB7sdQGUibx/id
]]></artwork>
      </figure>
	  <t>
	  A push server MUST return a 400 (Bad Request) status code in response
	  to a POST request that contains malformed JSON in the body.
	  </t>
    <t>
    [Should the push server return a 400 if the requested time_to_live exceeds its
    storage limits?]
    </t>
      <t>
        A push service MAY generate a 413 (Payload Too Large) status code in
        response to POST requests that include an entity body that is too large.
        Push services MUST NOT generate a 413 status code in responses to an
        entity body that is 4k (4096 bytes) or less in size.
      </t>

	  <section anchor="request_receipt" title="Requesting Push Message Receipts">
	  <t>
	  The application server MAY request to be notified by the push server
	  when a push message has been successfully delivered to the user agent.
	  </t>
	  <t>
        To request a receipt, the application server sets the value of
		the push message request_receipt member to true 
		in the HTTP POST request to the "subscription" resource.
	  </t>

	  <t>
	   The application server requests the delivery of receipts from
	   the push server by making a HTTP GET request to the "receipt"
	   resource. The push service does not respond to this request, it instead
	   uses <xref target="I-D.ietf-httpbis-http2">HTTP/2 server push</xref>
	   to send the content of push receipts when messages are acknowledged
	   by the user agent.
	  </t>
    <t>
    [Details on the message format for push receipt responses is TBD]  
    </t>
	  <t>
	  The push server MUST generate a 504 (Gateway Timeout) if the user agent
	  fails to acknowledge the receipt of the push message or the push server
    fails to deliver the message prior to its expiration.
	  </t>
	  </section>
    </section>

    <section anchor="monitor" title="Receiving Push Messages">
      <t>
        A user agent requests the delivery of new push messages by making a GET
        request to the "subscription" resource.  The push service does not
        respond to this request, it instead uses <xref
        target="I-D.ietf-httpbis-http2">HTTP/2 server push</xref> to send the
        contents of push messages as they are sent by application servers.
      </t>

      <t>
        Each push message is pushed in response to a synthesized GET request.
        The GET request is made to the "subscription" resource.  The response
		body is the entity body from the most recent POST request sent to the
		"subscription" resource by the application server.
      </t>


      <figure>
        <preamble>
          The following example request is made over HTTP/2.
        </preamble>
        <artwork><![CDATA[
HEADERS      [stream 7] +END_STREAM +END_HEADERS
  :method        = GET
  :path          = /p/LBhhw0OohO-Wl4Oi971UGsB7sdQGUibx
  :authority     = push.example.net
]]></artwork>
      </figure>

      <figure>
        <preamble>
          The push service permits the request to remain outstanding.  When a
          push message is sent by an application server, a server push is
          associated with the initial request.  The response includes the push
          message.
        </preamble>
        <artwork><![CDATA[
PUSH_PROMISE [stream 7; promised stream 4] +END_HEADERS
  :method        = GET
  :path          = /p/LBhhw0OohO-Wl4Oi971UGsB7sdQGUibx/id
  :authority     = push.example.net

HEADERS      [stream 4] +END_HEADERS
  :status        = 200
  date           = Thu, 11 Dec 2014 23:56:55 GMT
  last-modified  = Thu, 11 Dec 2014 23:56:55 GMT
  cache-control  = private
  content-type   = ...
  content-length = ...

DATA         [stream 4] +END_STREAM
  { // JSON Object // }
]]></artwork>
      </figure>

      <t>
        A user agent might receive a PUSH_PROMISE for a resource for which it
        has no active subscription.  The resulting unwanted push message can be
        ignored, or the corresponding stream can be reset (using RST_STREAM) to
        avoid expending bandwidth.
      </t>

      <t>
        A user agent can request the contents of the "subscription" resource
        immediately by including a <xref target="RFC7240">Prefer header
        field</xref> with a "wait" parameter set to "0".  The push server SHOULD
        return a link reference to the "subscription" resource and expiration
        information in response to this request.  This request also triggers the
        delivery of all push messages that the push service has stored but not
        yet delivered.  The server MUST generate a server push for all stored
        messages that have not yet been delivered.
      </t>
      <t>
        Different collapsing or coalescing disciplines for messages are possible but
        outside the scope of this document.
      </t>
	   <section anchor="acknowledge_receipt" title="Acknowledging Push Message Receipts">
	     <t>
          To enable "at least once delivery", the user agent MUST acknowledge receipt of
          the message by performing a HTTP DELETE on the resource in the :path pseudo-header
          field from the PUSH_PROMISE.
      </t>

      <figure>
        <artwork type="inline"><![CDATA[
DELETE /p/LBhhw0OohO-Wl4Oi971UGsB7sdQGUibx/id HTTP/1.1
Host: push.example.net

]]></artwork>
      </figure>

		 <t>
		 If the application has requested a delivery receipt, the push server MUST deliver a
     response to the application server monitoring the "receipt" resource.
		 </t>
	  </section>
    </section>

    <section anchor="operational" title="Operational Considerations">
      <t>
        [No changes to <xref target="I-D.draft-thomson-webpush-http2-02"/>]
      </t>

      <section anchor="load" title="Load Management">
      <t>
        [No changes to <xref target="I-D.draft-thomson-webpush-http2-02"/>]
      </t>
      </section>

      <section anchor="storage" title="Push Message Expiration">
        <t>
          [This section from <xref target="I-D.draft-thomson-webpush-http2-02"/> was updated to include
          the time_to_live option.]
        </t>
        <t>
          Push services typically store messages for some time to allow for
          limited recovery from transient faults.  If a push message is stored,
          but not delivered, the push service can indicate the probable duration
          of storage by including expiration information in the response to the
          push request.
        </t>
        <t>
          A push service is not obligated to store messages indefinitely.  If a
          user agent is not actively monitoring for push messages, those
          messages can be lost or overridden by newer messages on the same
          subscription.
        </t>
        <t>
          Push messages that were stored and not delivered to a user agent are
          delivered when the user agent recommences monitoring. (A message with a
          time_to_live option MUST NOT be delivered once it expires.)
          Stored push messages SHOULD include a Last-Modified header field (see Section 2.2
          of <xref target="RFC7232"/>) indicating when delivery was requested by
          an application server.
        </t>
        <t>
          A GET request to a "subscription" resource that has expired messages
          results in a 204 (No Content) status response, equivalent to if no
          push message were ever sent.
        </t>
        <t>
          Push services might need to limit the size and number of stored push
          messages to avoid overloading.  In addition to using the 413 (Payload
          Too Large) status code for too large push messages, a push service MAY
          expire push messages prior to any advertised expiration time.
        </t>
      </section>

      <section anchor="delete" title="Subscription Expiration">
        <t>
          [Minor editorial changes to <xref target="I-D.draft-thomson-webpush-http2-02"/> to
          remove references to registration]
        </t>
        <t>
          In some cases, it may be necessary to terminate
          subscriptions so that they can be refreshed.
        </t>
        <t>
          A push service might choose to set a fixed expiration time.  If a
          resource has a known expiration time, expiration information is
          included in responses to requests that create the resource, or in
          requests that retrieve a representation of the resource.
        </t>
        <t>
          Expiration is indicated using either the Expires header field, or by
          setting a "max-age" parameter on a Cache-Control header field (see
          <xref target="RFC7234"/>).  The Cache-Control header field MUST also
          include the "private" directive.
        </t>
        <t>
          A push service can invalidate a subscription at any
          time.  If a user agent has an outstanding request to the
          "subscription" resource, this can be
          signaled by returning a 400-series status code, such as 410 (Gone).  A
          push service uses server push to indicate that a subscription has
          expired; a pushed 400-series status code for the subscription resource
          signals the termination of a subscription.
        </t>
        <t>
          A user agent can request that a subscription be
          removed by sending a DELETE request to the corresponding URI.
        </t>
        <t>
          A push service MUST send a 400-series status code, such as 404 (Not
          Found) or 410 (Gone) if an application server atttempts to send a push
          message to a removed or expired subscription.
        </t>
      </section>

      <section title="Implications for Application Reliability">
        <t>
          [This section from <xref target="I-D.draft-thomson-webpush-http2-02"/> was updated to include
          receipts.]
        </t>
        <t>
          The availability of push message delivery receipts in the protocol ensures that the
          application developer is not tempted to create alternative mechanisms
          for message delivery in case the push service fails to deliver a critical message.
          Setting up a polling mechanism or a backup messaging channel in order to compensate for
          these shortcomings negates almost all of the advantages a push service provides.
        </t>

      </section>
    </section>

    <section anchor="security" title="Security Considerations">
      <t>
      [Minor editorial changes throughout Section 8 to <xref target="I-D.draft-thomson-webpush-http2-02"/> to
      remove references to registration]
      </t>
      <t>
        This protocol MUST use <xref target="RFC2818">HTTP over TLS</xref>; this
        includes any communications between user agent and push service, plus
        communications between the application and the push service.  Thus, all
        URIs use the "https" scheme.  This provides confidentiality and
        integrity protection for subscriptions and push messages from external
        parties.
      </t>

      <section title="Confidentiality from Push Service Access">
        <t>
          The protection afforded by TLS does not protect content from the push
          service.  Without additional safeguards, a push service is able to see
          and modify the content of the messages.
        </t>
        <t>
          Applications are able to provide additional confidentiality, integrity
          or authentication mechanisms within the push message itself.  The
          application server sending the push message and the application on the
          user agent that receives it are frequently just different instances of
          the same application, so no standardized protocol is needed to
          establish a proper security context.  The process of providing the
          application server with subscription information provides a convenient
          medium for key agreement.
        </t>
        <t>
          The Web Push API codifies this practice by requiring that each push
          subscription created by the browser be bound to a browser generated
          encryption key.  Pushed messages are authenticated and decrypted by
          the browser before delivery to applications.  This scheme ensures that
          the push service is unable to examine the contents of push messages.
        </t>
        <t>
          The public key for a subscription ensures that applications using that
          subscription can identify messages from unknown sources and discard
          them.  This depends on the public key only being disclosed to entities
          that are authorized to send messages on the channel.  The push server
          does not require access to this public key.
        </t>
     </section>

     <section title="Privacy Considerations">
       <t>
         Push message confidentiality does not ensure that the identity of who
         is communicating and when they are communicating is protected.
         However, the amount of information that is exposed can be limited.
       </t>
       <t>
         Subscription URIs MUST NOT provide any basis to correlate
         communications for a given user agent.  It MUST NOT be possible to
         correlate any two subscription URIs based solely on the content of the
         subscription URIs.  This allows a user agent to control correlation
         across different applications, or over time.
       </t>
       <t>
         In particular, user and device information MUST NOT be exposed through
         the subscription URI.
       </t>
       <t>
         In addition, subscription URIs established by the same user agent MUST
         NOT include any information that allows them to be correlated with the
         associated user agent. 
         <list style="hanging">
           <t hangText="Note:">
             This need not be perfect as long as the resulting anonymity set
             (see <xref target="RFC6973"/>, Section 6.1.1) is sufficiently
             large.  A subscription URI necessarily identifies a push service or
             a single server instance.  It is also possible that traffic
             analysis could be used to correlate subscriptions.
           </t>
         </list>
       </t>
       <t>
         A user agent MUST be able to create new subscriptions
         with new identifiers at any time.
       </t>
     </section>

     <section title="Authorization">
       <t>
         This protocol does not define how a push service establishes whether a
         user agent is permitted to create a subscription, or
         whether push messages can be delivered to the user agent.  A push
         service MAY choose to authorize request based on any HTTP-compatible
         authorization method available, of which there are numerous options.
         The authorization process and any associated credentials are expected
         to be configured in the user agent along with the URI for the "push
         service".
       </t>

       <t>
         Authorization for sending push messages is managed using capability
         URLs (see <xref target="CAP-URI"/>).  A capability URL grants access to
         a resource based solely on knowledge of the URL.  Capability URLs are
         used for their "easy onward sharing" and "easy client API" properties.
         These make it possible to avoid relying on relationships between push
         services and application servers, with the protocols necessary to build
         and support those relationships.
       </t>
       <t>
         A subscription URI therefore acts as a bearer token: knowledge of the
         URI implies authorization to send push messages.  Subscription URIs
         MUST be extremely difficult to guess.  Encoding a large amount of
         random entropy (at least 120 bits) in the path component ensures that
         it is difficult to successfully guess a valid subscription URI.
       </t>
     </section>

     <section title="Denial of Service Considerations">
       <t>
         Discarding unwanted messages at the user agent based on message
         authentication doesn't protect against a denial of service attack on
         the user agent.  Even a relatively small volume of push messages can
         cause battery-powered devices to exhaust power reserves.  Limiting the
         number of entities with access to push channels limits the number of
         entities that can generate value push requests of the push server.
       </t>
       <t>
         An application can limit where push messages can originate by limiting
         the distribution of subscription URIs to authorized entities.  Ensuring
         that subscription URIs are hard to guess ensures that only applications
         servers that have been given a subscription URI can use it.
       </t>
       <t>
         A malicious application with a valid subscription use the greater
         resources of a push service to mount a denial of service attack on a
         user agent.  Push service SHOULD limit the rate at which push messages
         are sent to individual user agents.  A push service or user agent MAY
         <xref target="delete">terminate subscriptions</xref> that receives too
         many push messages.
       </t>

       <t>
         Conversely, a push service is also able to deny service to user agents.
         Intentional failure to deliver messages is difficult to distinguish
         from faults, which might occur due to transient network errors,
         interruptions in user agent availability, or genuine service outages.
       </t>
     </section>

     <section title="Logging Risks">
       <t>
         Server request logs can reveal subscription URIs. Acquiring a
         subscription URI permits the sending of push messages.  Logging could
         also reveal relationships between different subscription URIs for the
         same user agent.
       </t>
       <t>
         Limitations on log retention and strong access control mechanisms can
         ensure that URIs are not learned by unauthorized entities.
       </t>
     </section>

    </section>

    <section title="IANA Considerations">
      <t>
        This document registers XXXXX URNs for use in identifying link relation
        types.  These are added to a new "Web Push Identifiers" registry
        according to the procedures in Section 4 of <xref target="RFC3553"/>;
        the corresponding "push" sub-namespace is entered in the "IETF URN
        Sub-namespace for Registered Protocol Parameter Identifiers" registry.
      </t>
      <t>
        The "Web Push Identifiers" registry operates under the <xref
        target="RFC5226">IETF Review policy</xref>.
        <list style="hanging">
          <t hangText="Registry name:">Web Push Identifiers</t>
          <t hangText="URN Prefix:">urn:ietf:params:push</t>
          <t hangText="Specification:">(this document)</t>
          <t hangText="Respository:">[Editor/IANA note: please include a link to
          the final registry location.]</t>
          <t hangText="Index value:">Values in this registry are URNs or URN
          prefixes that start with the prefix <spanx
          style="verb">urn:ietf:params:push</spanx>.  Each is registered
          independently.</t>
        </list>
      </t>
      <t>
        New registrations in the "Web Push Identifiers" are encouraged to
        include the following information:
        <list style="hanging">
          <t hangText="URN:">A complete URN or URN prefix.</t>
          <t hangText="Description:">A summary description.</t>
          <t hangText="Specification:">A reference to a specification describing
          the semantics of the URN or URN prefix.</t>
          <t hangText="Contact:">Email for the person or group making the
          registration.</t>
          <t hangText="Index value:">As described in <xref target="RFC3553"/>,
          URN prefixes that are registered include a description of how the URN
          is constructed.  This is not applicable for specific URNs.</t>
        </list>
      </t>
      <t>
        Two values are entered as the initial content of the "Web Push
        Identifiers" registry.
      </t>
      <t>
        <list style="hanging">
          <t hangText="URN:">urn:ietf:params:push</t>
          <t hangText="Description:">This link relation type is used to identify
          a web push subscription.</t>
          <t hangText="Specification:">(this document)</t>
          <t hangText="Contact:">Web Push WG (webpush@ietf.org)</t>
        </list>
      </t>
      <t>
        <list style="hanging">
          <t hangText="URN:">urn:ietf:params:push:receipt</t>
          <t hangText="Description:">This link relation type is used to identify
          a resource for receiving delivery receipts for push messages.</t>
          <t hangText="Specification:">(this document)</t>
          <t hangText="Contact:">Web Push WG (webpush@ietf.org)</t>
        </list>
      </t>
    </section>

    <section anchor="ack" title="Acknowledgements">
      <t>
        This document incorporates and iterates on material from <xref target="I-D.draft-thomson-webpush-http2-02"/>.
      </t>
    </section>

  </middle>

  <back>

    <references title="Normative References">
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2818.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.3553.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.5226.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.5988.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.7159.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.7230.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.7232.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.7234.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.7240.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-httpbis-http2.xml"?>

      <reference anchor="CAP-URI" target="http://www.w3.org/TR/capability-urls/">
        <front>
          <title>Good Practices for Capability URLs</title>
          <author initials="J." surname="Tennison" fullname="Jeni Tennison"/>
          <date month="February" year="2014"/>
        </front>
        <seriesInfo name="FPWD" value="capability-urls"/>
      </reference>

      <reference anchor="I-D.draft-thomson-webpush-http2-02" target="https://tools.ietf.org/html/draft-thomson-webpush-http2-02.txt">
       <front>
        <title>Generic Event Delivery Using HTTP Push (work in progress)</title>
          <author initials="M." surname="Thomson" fullname="Martin Thomson"/>
       <date month="December" year="2014" />
       </front>
      </reference>
    </references>

    <references title="Informative References">
      <reference anchor="API" target="https://w3c.github.io/push-api/">
        <front>
          <title>Web Push API</title>
          <author initials="B." surname="Sullivan" fullname="Bryan Sullivan"/>
          <author initials="E." surname="Fullea" fullname="Eduardo Fullea"/>
          <date month="December" year="2014" />
        </front>
        <seriesInfo name="ED" value="push-api" />
      </reference>

      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.6973.xml"?>

    </references>

    <!--
        <section title="Change Log">
        <t>[[The RFC Editor is requested to remove this section at publication.]]</t>
        <t>Changes since -0-1:
        <list style="symbols">
        <t>Document created.</t>
        </list>
        </t>
        </section>
    -->
  </back>
</rfc>
