<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep xmlns="">
<header>
  <title>Service Outage Status</title>
  <abstract>This document defines an XMPP protocol extension that enables server administrators
            to communicate issues with the server to all users in a semantic manner.</abstract>
  
<legal>
<copyright>This XMPP Extension Protocol is copyright © 1999 – 2024 by the <link url="https://xmpp.org/">XMPP Standards Foundation</link> (XSF).</copyright>
<permissions>Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.</permissions>
<warranty>## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##</warranty>
<liability>In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.</liability>
<conformance>This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at &lt;<link url="https://xmpp.org/about/xsf/ipr-policy">https://xmpp.org/about/xsf/ipr-policy</link>&gt; or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).</conformance>
</legal>
  <number>0455</number>
  <status>Experimental</status>
  <type>Standards Track</type>
  <sig>Standards</sig>
  <approver>Council</approver>
  <dependencies>
    <spec>XMPP Core</spec>
    <spec>XEP-0128</spec>
  </dependencies>
  <supersedes/>
  <supersededby/>
  <shortname>sos</shortname>
  <author>
    <firstname>Mathieu</firstname>
    <surname>Pasquet</surname>
    <email>mathieui@mathieui.net</email>
    <jid>mathieui@mathieui.net</jid>
  </author>
  <revision>
    <version>0.4.0</version>
    <date>2025-08-15</date>
    <initials>mp</initials>
    <remark>Remove leftover pubsub references, add accessibility considerations.</remark>
  </revision>
  <revision>
    <version>0.3.1</version>
    <date>2025-04-20</date>
    <initials>ka</initials>
    <remark>Fix typo in JSON Schema.</remark>
  </revision>
  <revision>
    <version>0.3.0</version>
    <date>2025-04-05</date>
    <initials>mp</initials>
    <remark>Remove all in-band event signaling.</remark>
  </revision>
  <revision>
    <version>0.2.0</version>
    <date>2021-02-09</date>
    <initials/>
    <remark>Evolve the standard: Editorial restructuring, add business rules and security considerations and clarify some wording.</remark>
  </revision>
  <revision>
    <version>0.1.0</version>
    <date>2021-02-09</date>
    <initials>XEP Editor (jsc)</initials>
    <remark>Accepted by vote of Council on 2021-01-20.</remark>
  </revision>
  <revision>
    <version>0.0.1</version>
    <date>2021-01-18</date>
    <initials>mp</initials>
    <remark><p>First draft.</p></remark>
  </revision>
</header>
<section1 topic="Introduction" anchor="intro">
  <p>The XMPP Network is a network of servers which each have their own administration policies, status reports, and other peculiarities. <span class="ref"><link url="https://xmpp.org/extensions/xep-0157.html">Contact Addresses for XMPP Services (XEP-0157)</link></span> <note>XEP-0157: Contact Addresses for XMPP Services &lt;<link url="https://xmpp.org/extensions/xep-0157.html">https://xmpp.org/extensions/xep-0157.html</link>&gt;.</note> provides a consistent framework for reaching out to administrators and reporting abuse, incidents, or even giving feedback on the service, and the goal of this specification is to provide a similar framework for letting users (or other entities) know the server status in-band or out of band (in case of hard failures).</p>
  <p>Centralized systems usually control both the infrastructure and client code, making it easy to hardcode information retrieval one way or the other.</p>
  <p>The usual way of informing users of planned maintenance, partial or total outage was previously through "announce" modules that lets the admin broadcast server-wided messages. This approach has several drawbacks, as it will appear in most clients as a new discussion with the server JID, which can prove confusing. It also does not provide a way to reach the user when the XMPP server is offline.</p>
    <p>This XEP provides:</p>
    <ul>
        <li>An informational way of exposing an external service endpoint containing machine-readable data using <span class="ref"><link url="https://xmpp.org/extensions/xep-0128.html">Service Discovery Extensions (XEP-0128)</link></span> <note>XEP-0128: Service Discovery Extensions &lt;<link url="https://xmpp.org/extensions/xep-0128.html">https://xmpp.org/extensions/xep-0128.html</link>&gt;.</note></li>
        <li>A specification of the data this service should provide</li>
        <li>A normative way of providing such information in-band, when the outage is not complete</li>
    </ul>
</section1>
<section1 topic="External status" anchor="external-status">
  <section2 topic="Discovery" anchor="external-disco">
    <p>To make such discovery possible, we specify a <span class="ref"><link url="https://xmpp.org/extensions/xep-0128.html">Service Discovery Extensions (XEP-0128)</link></span> <note>XEP-0128: Service Discovery Extensions &lt;<link url="https://xmpp.org/extensions/xep-0128.html">https://xmpp.org/extensions/xep-0128.html</link>&gt;.</note> mechanism that a server SHOULD return in response to service discovery information ("disco#info") requests sent to the bare domain of the server. This information MUST be scoped using a FORM_TYPE of "urn:xmpp:sos:0" (as already specified in <span class="ref"><link url="https://xmpp.org/extensions/xep-0128.html">Service Discovery Extensions (XEP-0128)</link></span> <note>XEP-0128: Service Discovery Extensions &lt;<link url="https://xmpp.org/extensions/xep-0128.html">https://xmpp.org/extensions/xep-0128.html</link>&gt;.</note>) and data form fields registered for this purpose as defined in the <link url="#registrar">XMPP Registrar Considerations</link> section of this document.</p>

    <p>Values of 'external-status-addresses' form field MUST be valid URIs, i.e. comply with the 'xs:anyURI' datatype of <span class="ref"><link url="http://www.w3.org/TR/xmlschema11-2/">XML Schema Part 2</link></span> <note>XML Schema Part 2: Datatypes &lt;<link url="http://www.w3.org/TR/xmlschema11-2/">http://www.w3.org/TR/xmlschema11-2/</link>&gt;.</note>.</p>
    <example caption="Entity queries server for information"><![CDATA[
<iq from='thirdwitch@shakespeare.lit/chamber'
    to='shakespeare.lit'
    id='disco1'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>

    <example caption="Server communicates information"><![CDATA[
<iq from='shakespeare.lit'
    to='thirdwitch@shakespeare.list/chamber'
    id='disco1'
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <identity category='server' type='im'/>
    <feature var='http://jabber.org/protocol/disco'/>
    <x xmlns='jabber:x:data' type='result'>
      <field var='FORM_TYPE' type='hidden'>
        <value>urn:xmpp:sos:0</value>
      </field>
      <field var='external-status-addresses'>
        <value>http://secondary.shakespeare.lit/status.json</value>
      </field>
    </x>
  </query>
</iq>
]]></example>

    <p>Links present inside the 'external-status-addresses' field SHOULD use HTTP/HTTPS protocol and the resources referenced MUST be available without authentication.</p>

  </section2>
  <section2 topic="External status format" anchor="json-schema">
    <p>The format used for the external status is defined here, to allow a wide range
       of compatibility across services and clients.</p>
    <p>A client MUST ignore unknown extra fields present in the JSON file, to allow extensibility, and implementations MAY add other fields.</p>
    <example caption="Example status"><![CDATA[
{
  "planned": true,
  "beginning": "2021-01-12T01:01:01Z",
  "expected_end": "2021-01-12T05:00:00Z",
  "message": {
    "default": "Mise à jour du serveur",
    "en": "The serveur is being updated"
  }
}
  ]]></example>

    <p>The "message" field, when set, MUST contain at least a message on the "default" key
        which will be used by clients if the current user language is not found. It is left
        to the operator to determine which language is more relevant as a default, according
        to the server’s user base.</p>

    <p>When the outage is over, the file SHOULD be replaced with an empty JSON object.</p>

    <example caption="Empty file after resolution of the issue"><![CDATA[
{}
]]></example>

    <p>The following JSON schema is provided as a means to describe and validate the
       file exposed by the external service:</p>

    <code><![CDATA[
{
  "$id": "http://xmpp.org/server-outage-schema.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "XMPP Server Outage Format",
  "type": "object",
  "required": ["beginning"],
  "additionalProperties": true,
  "properties": {
    "planned": {
      "type": "boolean",
      "description": "If the outage was planned or not."
    },
    "beginning": {
      "type": "string",
      "format": "date-time",
      "description": "Approximate time of the start of the outage."
    },
    "expected_end": {
      "type": "string",
      "format": "date-time",
      "description": "Estimated time of the end of the outage (if known)."
    },
    "message": {
    "type": "object",
      "description": "Textual message to service users, each key being 'default' or a BCP47 language tag.",
      "required": ["default"],
      "properties": {
        "default": { "type": "string"}
      },
      "patternProperties": {
        "default": {"type": "string"},
        ".*": {"type": "string"}
      }
    }
  }
}
]]></code>
  </section2>

</section1>
<section1 topic="Use Cases" anchor="usecases">
  <p>This extension has been thought for several different cases of service outages:</p>
  <ul>
    <li>A client failing to connect to a server is able to display an informative message to the user if the server is having issues.</li>
    <li>A server experiencing difficulties is able to communicate it to the users, and clients can display the information prominently.</li>
    <li>An external service can keep track of the various outages, either for a single server or a number of them, and present the information in a structured manner.</li>
  </ul>
</section1>
<section1 topic="Business Rules" anchor="rules">
  <p>A client implementing this extension MUST fetch the addresses of the external service and cache it
    for later use. Doing so allows the client to use this information when it is impossible to connect
    to the server.</p>
  <p>A client fetching an outage event for a time in the future SHOULD treat it as a planned event
     that is not already happening and adapt its display consequently.</p>
</section1>
<section1 topic="Internationalization Considerations" anchor="i18n">
  <p>Both the JSON and the XML format defined in this document allow for internationalization in the fields that are expected to be presented to the user as-is. The other fields are machine-readable and their various values SHOULD be translated in the implementing applications.</p>
</section1>
<section1 topic="Accessibility Considerations" anchor="access">
  <p>Clients MUST display the message in a way that makes it as readable as the rest of the application for visually impaired people, and the message text MUST likewise be available to screen readers.</p>
</section1>
<section1 topic="Security Considerations" anchor="security">
  <p>Server administrators MUST ensure the servers provided in 'external-status-addresses' are trusted, as malicious administrators of this server could use the referenced file
     to display arbitrary messages to users.</p>
</section1>
<section1 topic="IANA Considerations" anchor="iana">
  <p>This document requires no interaction with the <span class="ref"><link url="http://www.iana.org/">Internet Assigned Numbers Authority (IANA)</link></span> <note>The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see &lt;<link url="http://www.iana.org/">http://www.iana.org/</link>&gt;.</note>.</p>
</section1>
<section1 topic="XMPP Registrar Considerations" anchor="registrar">
  <p>The <span class="ref"><link url="https://xmpp.org/registrar/">XMPP Registrar</link></span> <note>The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see &lt;<link url="https://xmpp.org/registrar/">https://xmpp.org/registrar/</link>&gt;.</note> includes the following information in its registries.</p>
  <section2 topic="Field Standardization" anchor="registrar-formtype">
    <p><span class="ref"><link url="https://xmpp.org/extensions/xep-0068.html">Field Standardization for Data Forms (XEP-0068)</link></span> <note>XEP-0068: Field Data Standardization for Data Forms &lt;<link url="https://xmpp.org/extensions/xep-0068.html">https://xmpp.org/extensions/xep-0068.html</link>&gt;.</note> defines a process for standardizing the fields used within Data Forms qualified by a particular namespace, and <span class="ref"><link url="https://xmpp.org/extensions/xep-0128.html">Service Discovery Extensions (XEP-0128)</link></span> <note>XEP-0128: Service Discovery Extensions &lt;<link url="https://xmpp.org/extensions/xep-0128.html">https://xmpp.org/extensions/xep-0128.html</link>&gt;.</note> describes how to use field standardization in the context of service discovery. This section registers fields for server information scoped by the "urn:xmpp:sos:0" FORM_TYPE.</p>
    <code caption="Registry Submission"><![CDATA[
<form_type>
  <name>urn:xmpp:sos:0</name>
  <doc>XEP-0455</doc>
  <desc>
    Form enabling a the registration of a machine-readable
    external file to describe a service status.
  </desc>
  <field
      var='external-status-addresses'
      type='list-multi'
      label='One or more addresses containing a file with the server status'/>
</form_type>
]]></code>
  </section2>
</section1>
<section1 topic="XML Schema" anchor="schema">
  <p>No XML Schema is required as this does not define new XML elements.</p>
</section1>
</xep>
