<?xml version="1.0" encoding="us-ascii"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- when the namespace version bumps, update this and it will update
    everywhere --><!ENTITY VERSION "0.1">
<!ENTITY I-D.narten-iana-considerations-rfc2434bis SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.narten-iana-considerations-rfc2434bis.xml">
<!ENTITY RFC2119 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC3688 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml">
<!ENTITY RFC5730 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5730.xml">
<!ENTITY RFC5910 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5910.xml">
<!ENTITY RFC7451 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7451.xml">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<?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" docName="draft-brown-epp-reverse-00" ipr="trust200902">

<front>
  <title abbrev="Command Reversal Extension for EPP">Command Reversal Extension for the Extensible Provisioning Protocol (EPP)</title>
  <author fullname="Gavin Brown" initials="G" surname="Brown">
    <organization>CentralNic Group plc</organization>
    <address>
      <postal>
        <street>35-39 Moorgate</street>
        <city>London</city>
        <region>England</region>
        <code>EC2R 6AR</code>
        <country>GB</country>
      </postal>
      <phone>+44 20 33 88 0600</phone>
      <email>gavin.brown@centralnic.com</email>
      <uri>https://www.centralnic.com</uri>
    </address>
  </author>
  <author fullname="Jothan Frakes" initials="J" surname="Frakes">
    <address>
      <email>jothan@jothan.com</email>
      <uri>http://jothan.com</uri>
    </address>
  </author>
  <date month="November" year="2015"/>
  <area>Applications</area>
  <workgroup>Internet Engineering Task Force</workgroup>
  <keyword>EPP, XML</keyword>
  <abstract>
    <t>This document describes an Extensible Provisioning Protocol (EPP) extension mapping for reversing previous EPP commands.</t>
  </abstract>
</front>

<middle>

<section title="Introduction">

  <t>The Extensible Provisioning Protocol (EPP) provides a way for clients to create and update objects in a central repository. Usually, the commands that a client sends to a server will have been initiated upon request of a human being. As a result, occasionally a command is sent which contains an error.</t>
  <t>EPP clients have some options to remedy such mistakes: for example, they can send a &lt;delete&gt; command to delete an object created in error (and may receive a refund if they do so within some grace period), cancel a previous &lt;transfer&gt; request, or send an &lt;update&gt; command to amend the properties of an object.</t>
  <t>However, there are some circumstances where it is not possible to correct an error by using an existing command. For example, clients may inadvertently send multiple &lt;renew&gt; commands (because their implementation queries the server for a domain's expiry date, thereby defeating the idempotency measures built into EPP) or specify an incorrect period (e.g. a two-year renewal which should have only been for one year).</t>
  <t>As another example, a client may perform an &lt;update&gt; command on an object, but keep no record of the previous state of the object, preventing them from correcting the error.</t>
  <t>None of the mistakes in the examples above can be fixed using the existing EPP command repertoire. The extension described in this document attempts to provide an additional remedy for such cases, by providing a way for a client to request that a previous command be reversed. In order to reverse a command, the client need only record the &lt;svTRID&gt; returned by the server in its response to the command.</t>

  <section title="Conventions Used in This Document">
    <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in <xref target="RFC2119">RFC 2119</xref>.</t>
    <t>XML is case sensitive. Unless stated otherwise, XML specifications and examples provided in this document MUST be interpreted in the character case presented in order to develop a conforming implementation.</t>
    <t>"reverse" is used as an abbreviation for "urn:ietf:params:xml:ns:reverse-&VERSION;". The XML namespace prefix "reverse" is used, but implementations MUST NOT depend on it and instead employ a proper namespace-aware XML parser and serializer to interpret and output the XML documents.</t>
    <t>(Note to RFC Editor: remove the following paragraph before publication as an RFC.)</t>
    <t>The XML namespace prefix above contains a version number, specifically "&VERSION;". This version number will increment with successive versions of this document, and will reach 1.0 if and when this document is published as an RFC. This permits clients to distinguish which version of the extension a server has implemented.</t>
  </section>
</section>

<section title="Extension Elements">

  <t>This specification provides a new EPP command, called &lt;reverse&gt;. As the set of EPP command verbs cannot be updated without updating the core EPP specifications, this command is implemented as an extension.</t>

  <t>When a client wants to reverse a previous command, it sends an EPP command frame containing only an &lt;extension&gt; element. The &lt;extension&gt; element contains a &lt;reverse&gt; element, which in turn contains the details of the command the client wishes to reverse. The &lt;reverse&gt; element has the following child elements:</t>

  <t><list style="hanging">
    <t>An OPTIONAL &lt;reason&gt; element which contains a human-readable explanation of why the client is submitting the request. The server MAY require inclusion of a &lt;reason&gt; element depending on its own policy.</t>
    <t>A &lt;trID&gt; element which uniquely identifies the command that the client wishes to reverse. The &lt;trID&gt; element is derived from the element of the same name in <xref target="RFC5730"/>.</t>
    <t>An OPTIONAL &lt;clTRID&gt; element that uniquely identifies this command to the server.</t>
  </list></t>

  <t>Example &lt;reverse&gt; request frame:</t>

  <figure>
  <artwork>
C: &lt;?xml version="1.0" encoding="UTF-8"?&gt;
C: &lt;epp xmlns="urn:ietf:params:xml:ns:epp-1.0"&gt;
C:   &lt;extension&gt;
C:     &lt;reverse:reverse
C:       xmlns:reverse="urn:ietf:params:xml:ns:reverse-0.1"&gt;
C:       &lt;reverse:reason&gt;Reversing an accidental
C:       double renewal.&lt;/reverse:reason&gt;
C:       &lt;reverse:trID&gt;
C:         &lt;reverse:clTRID&gt;ABC-10001&lt;/reverse:clTRID&gt;
C:         &lt;reverse:svTRID&gt;54321-XYZ&lt;/reverse:svTRID&gt;
C:       &lt;/reverse:trID&gt;
C:       &lt;reverse:clTRID&gt;ABC-12345&lt;/reverse:clTRID&gt;
C:     &lt;/reverse:reverse&gt;
C:   &lt;/extension&gt;
C: &lt;/epp&gt;
</artwork>
  </figure>
</section>

<section title="Server Handling of Reverse Commands">
  <t>Which commands a server will accept &lt;reverse&gt; commands for is a matter of server policy (which server operators should provide to client operators). If a server acceps a &lt;reverse&gt; command, it MUST respond with a 1000 or 1001 result code. If the server returns a 1001 response, the client MUST be notified of outcome of the offline process via the EPP message queue. If the server rejects the command, it MUST respond with a 2400 result code.</t>

  <t>Servers MUST NOT allow a client to reverse a command that it did not originally submit. Servers SHOULD implement policies that flag &lt;reverse&gt; commands for offline processing where changes might have security implications (such as those which would remove client-assigned status codes, alter authorisation information or add or remove <xref target="RFC5910">secDNS</xref> records, etc).</t>

  <t>Servers MUST reject a command which attempts to reverse a &lt;reverse&gt; command.</t>
</section>

<section title="EPP &lt;poll&gt; command">
  <t>Servers which return 1001 response codes to &lt;reverse&gt; commands MUST notify clients of the outcome of the out-of-band process via the EPP message queue. The format of the &lt;poll&gt; message is as follows.</t>
  <t>The &lt;resData&gt; element of the &lt;poll&gt; response contains a &lt;panData&gt; element which contains a &lt;paTRID&gt; element. This element contains an OPTIONAL &lt;clTRID&gt; and a &lt;svTRID&gt; which together identify the &lt;reverse&gt; command submitted by the client. The &lt;paTRID&gt; element has a MANDATORY "paResult" element which is a boolean, and which indicates the outcome of the offline review.</t>
  <t>The &lt;msg&gt; element contains a human-readable message describing the outcome of the review.</t>

  <t>Example of a &lt;poll&gt; message:</t>

  <figure>
    <artwork>
C: &lt;?xml version="1.0" encoding="utf-8" standalone="no"?&gt;
C: &lt;epp xmlns="urn:ietf:params:xml:ns:epp-1.0"&gt;
C:   &lt;response&gt;
C:     &lt;result code="1301"&gt;
C:       &lt;msg&gt;Command completed successfully; ack to dequeue&lt;/msg&gt;
C:     &lt;/result&gt;
C:     &lt;msgQ count="5" id="12345"&gt;
C:       &lt;qDate&gt;2016-04-04T22:01:00.0Z&lt;/qDate&gt;
C:       &lt;msg&gt;Pending action completed successfully.&lt;/msg&gt;
C:     &lt;/msgQ&gt;
C:     &lt;resData&gt;
C:       &lt;reverse:panData
C:         xmlns:reverse="urn:ietf:params:xml:ns:reverse-0.1"&gt;
C:         &lt;reverse:paTRID paResult="1"&gt;
C:           &lt;reverse:clTRID&gt;ABC-12345&lt;/reverse:clTRID&gt;
C:           &lt;reverse:svTRID&gt;54321-XYZ&lt;/reverse:svTRID&gt;
C:         &lt;/reverse:paTRID&gt;
C:         &lt;reverse:paDate&gt;2016-04-04T22:00:00.0Z&lt;/reverse:paDate&gt;
C:       &lt;/reverse:panData&gt;
C:     &lt;/resData&gt;
C:     &lt;trID&gt;
C:       &lt;clTRID&gt;BCD-23456&lt;/clTRID&gt;
C:       &lt;svTRID&gt;65432-WXY&lt;/svTRID&gt;
C:     &lt;/trID&gt;
C:   &lt;/response&gt;
C: &lt;/epp&gt;
</artwork>
  </figure>
</section>

<section title="Formal Syntax">
  <t>An EPP object mapping is specified in XML Schema notation. The formal syntax presented here is a complete schema representation of the object mapping suitable for automated validation of EPP XML instances.</t>
  <t>Copyright (c) 2015 IETF Trust and the persons identified as authors of the code. All rights reserved.</t>
  <t>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</t>
  <t><list style="symbols">
    <t>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</t>
    <t>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</t>
    <t>Neither the name of Internet Society, IETF or IETF Trust, nor the names of specific contributors, may be used to endorse or promote products derived from this software without specific prior written permission.</t>
  </list></t>
  <t>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</t>
  <figure>
  <artwork>
BEGIN 
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;schema xmlns="http://www.w3.org/2001/XMLSchema"
  xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
  xmlns:reverse="urn:ietf:params:xml:ns:reverse-0.1"
  targetNamespace="urn:ietf:params:xml:ns:reverse-0.1"
  elementFormDefault="qualified"&gt;
  &lt;annotation&gt;
    &lt;documentation&gt;
      Extensible Provisioning Protocol v1.0 extension
      schema for command reverseal.
    &lt;/documentation&gt;
  &lt;/annotation&gt;

  &lt;import
    namespace="urn:ietf:params:xml:ns:epp-1.0"
    schemaLocation="epp-1.0.xsd"/&gt;

  &lt;!-- command element --&gt;
  &lt;element name="reverse" type="reverse:reverseType"/&gt;

  &lt;complexType name="reverseType"&gt;
    &lt;sequence&gt;
      &lt;element name="reason" type="epp:msgType"
        minOccurs="0" /&gt;
        &lt;element name="trID" type="reverse:trIDType"/&gt;
        &lt;element name="clTRID" type="epp:trIDStringType"
          minOccurs="0" /&gt;
    &lt;/sequence&gt;
  &lt;/complexType&gt;

  &lt;complexType name="trIDType"&gt;
    &lt;sequence&gt;
      &lt;element name="clTRID" type="epp:trIDStringType"
        minOccurs="0" /&gt;
      &lt;element name="svTRID" type="epp:trIDStringType" /&gt;
    &lt;/sequence&gt;
  &lt;/complexType&gt;

  &lt;!-- poll response element --&gt;
  &lt;element name="panData" type="reverse:panDataType" /&gt;

  &lt;complexType name="panDataType"&gt;
    &lt;sequence&gt;
      &lt;element name="paTRID" type="reverse:paTRIDType" /&gt;
      &lt;element name="paDate" type="dateTime" /&gt;
    &lt;/sequence&gt;
  &lt;/complexType&gt;

  &lt;complexType name="paTRIDType"&gt;
    &lt;complexContent&gt;
      &lt;extension base="reverse:trIDType"&gt;
        &lt;attribute name="paResult" type="boolean" use="required" /&gt;
      &lt;/extension&gt;
    &lt;/complexContent&gt;
  &lt;/complexType&gt;

&lt;/schema&gt;
END</artwork>
  </figure>
</section>

<section anchor="Security" title="Security Considerations">
  <t>The mapping extensions described in this document do not provide any security services beyond those described by <xref target="RFC5730">EPP</xref>, and protocol layers used by EPP. The security considerations described in these other specifications apply to this specification as well.</t>
</section>

<section anchor="IANA" title="IANA Considerations">
  <section title="XML Namespace">
    <t>This document uses URNs to describe XML namespaces and XML schemas conforming to a registry mechanism described in 
    <xref target="RFC3688"/>. The following URI assignment is requested of IANA:</t>
    <t>URI: urn:ietf:params:xml:ns:reverse-&VERSION;</t>
    <t>Registrant Contact: See the "Author's Address" section of this document.</t>
    <t>XML: See the "Formal Syntax" section of this document.</t>
  </section>
  <section title="EPP Extension Registry">
    <t>The EPP extension described in this document should be registered by the IANA in the EPP Extension Registry described in 
    <xref target="RFC7451"/>. The details of the registration are as follows:</t>
    <t>Name of Extension: EPP Reverse Extension</t>
    <t>Document status: Standards Track</t>
    <t>Reference: (insert reference to RFC version of this document)</t>
    <t>Registrant Name and Email Address: See the "Author's Address" section of this document.</t>
    <t>TLDs: any</t>
    <t>IPR Disclosure: none</t>
    <t>Status: active</t>
    <t>Notes: none</t>
  </section>
</section>

<section title="Acknowledgements">
  <t>The authors wish to thank Keith Gaughan for early feedback.</t>
</section>

</middle>
<back>
  <references title="Normative References">
    &RFC2119;
    &RFC3688;
    &RFC5730;
    &RFC5910;
    &RFC7451;
  </references>
  </back>
</rfc>
