Communicating Warning Information in HTTP APIs
draft-cedik-http-warning-01

Document Type Active Internet-Draft (individual)
Last updated 2020-03-30
Stream (None)
Intended RFC status (None)
Formats plain text xml pdf htmlized (tools) htmlized bibtex
Stream Stream state (No stream defined)
Consensus Boilerplate Unknown
RFC Editor Note (None)
IESG IESG state I-D Exists
Telechat date
Responsible AD (None)
Send notices to (None)
Network Working Group                                           A. Cedik
Internet-Draft                                            shipcloud GmbH
Intended status: Standards Track                                E. Wilde
Expires: October 1, 2020                                           Axway
                                                          March 30, 2020

             Communicating Warning Information in HTTP APIs
                      draft-cedik-http-warning-01

Abstract

   This document defines a new HTTP header field Content-Warning and a
   standard response format for representing warning information in HTTP
   APIs.

Note to Readers

   This draft should be discussed on the rfc-interest mailing list
   (<https://lists.w3.org/Archives/Public/ietf-http-wg/>).

   Online access to all versions and files is available on GitHub
   (<https://github.com/dret/I-D/tree/master/http-warning>).

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on October 1, 2020.

Copyright Notice

   Copyright (c) 2020 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents

Cedik & Wilde            Expires October 1, 2020                [Page 1]
Internet-DrafCommunicating Warning Information in HTTP APIs   March 2020

   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Notational Conventions  . . . . . . . . . . . . . . . . . . .   3
   3.  Content-Warning Header Field  . . . . . . . . . . . . . . . .   3
   4.  The "embedded-warning" Content-Warning Type . . . . . . . . .   4
   5.  JSON Warning Format . . . . . . . . . . . . . . . . . . . . .   4
   6.  Example with HTTP Header Field and Embedded Warning . . . . .   5
   7.  Security Considerations . . . . . . . . . . . . . . . . . . .   6
   8.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   6
     8.1.  HTTP Header Field Content-Warning . . . . . . . . . . . .   6
     8.2.  Content-Warning Type Registry . . . . . . . . . . . . . .   6
       8.2.1.  Registration Procedure  . . . . . . . . . . . . . . .   6
       8.2.2.  Initial Registry Content  . . . . . . . . . . . . . .   7
   9.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   7
     9.1.  Normative References  . . . . . . . . . . . . . . . . . .   7
     9.2.  Informative References  . . . . . . . . . . . . . . . . .   8
   Appendix A.  Acknowledgements . . . . . . . . . . . . . . . . . .   8
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .   8

1.  Introduction

   Many current APIs are based on HTTP [RFC7230] as their application
   protocol.  Their response handling model is based on the assumption
   that requests either are successful or they fail.  In both cases
   (success and failure) an HTTP status code [RFC7231] is returned to
   convey either fact.

   But response status is not always strictly either success or failure.
   For example, there are cases where an underlying system returns a
   response with data that cannot be defined as a clear error.  API
   providers who are integrating such a service might want to return a
   success response nonetheless, but returning a HTTP status code of
   e.g. 200 OK without any additional information is not the only
   possible approach in this case.

   As defined in the principles of Web architecture
   [W3C.REC-webarch-20041215], agents that "recover from errors by
   making a choice without the user's consent are not acting on the
   user's behalf".  Therefore APIs should be able to communicate what

Cedik & Wilde            Expires October 1, 2020                [Page 2]
Internet-DrafCommunicating Warning Information in HTTP APIs   March 2020

   has happened to their consumers, which then allows clients or users
Show full document text