INTERNET-DRAFT Mandatory H. Frystyk Nielsen, W3C draft-frystyk-http-mandatory P. Leach, Microsoft Scott Lawrence, Agranat Systems Expires: July 20, 1998 Tuesday, January 20, 1998 Mandatory Extensions in HTTP Status of this Document This document is an Internet-Draft. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. 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". To learn the current status of any Internet-Draft, please check the "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or ftp.isi.edu (US West Coast). Distribution of this document is unlimited. Please send comments to the mailing list. This list is archived at "http://lists.w3.org/Archives/Public/ietf-http-ext/". The contribution of World Wide Web Consortium (W3C) staff is part of the W3C HTTP Activity (see "http://www.w3.org/Protocols/Activity"). Abstract HTTP is used increasingly in applications that need more facilities than the standard version of the protocol provides, ranging from distributed authoring, collaboration, and printing, to various remote procedure call mechanisms. This document proposes the use of a mandatory extension mechanism designed to address the tension between private agreement and public specification and to accommodate extension of applications such as HTTP clients, servers, and proxies. The proposal associates each extension with a URI[2], and use a few new RFC 822[1] style header fields to carry the extension identifier and related information between the parties involved in an extended transaction. Table of Contents 1. Introduction.....................................................2 2. Notational Conventions...........................................2 3. Extension Declarations...........................................3 3.1 Header Field Prefixes.........................................3 Frystyk et al [Page 1] INTERNET-DRAFT Mandatory Tuesday, January 20, 1998 4. Extension Header Fields..........................................4 4.1 End-to-End Extensions.........................................4 4.2 Hop-by-Hop Extensions.........................................5 5. Mandatory HTTP Requests..........................................5 6. 510 Not Extended.................................................6 7. Publishing an Extension..........................................7 8. Security Considerations..........................................7 9. References.......................................................8 10. Acknowledgements................................................8 11. Authors Addresses...............................................8 12. Summary of Protocol Interactions................................9 13. Examples.......................................................10 13.1 Client Queries Server for DAV...............................10 13.2 Server Uses ZipFlate Compression Extension..................10 1. Introduction The mandatory proposal is designed to accommodate dynamic extension of HTTP clients and servers by software components; and to address the tension between private agreement and public specification. The proposal uses features in HTTP/1.1 but is compatible with both HTTP/1.0 and HTTP/1.1 applications. The kind of extensions capable of being introduced range from: o extending a single HTTP message; o introducing new encodings; o initiating HTTP-derived protocols for new applications; to... o switching to protocols which, once initiated, run independent of the original protocol stack. The proposal is intended to be used as follows: o Some party designs and specifies an extension; the party assigns the extension an identifier, which is a URI, and makes one or more representations of the extension available at that address (see section 7). o A party using an agent implementing the extension wishes to use it; the agent declares the use of the extension by referencing its URI in an extension declaration (see section 3). 2. Notational Conventions This specification uses the same notational conventions and basic parsing constructs as RFC 2068[7]. In particular the BNF constructs "token", "quoted-string", "field-name", and "URI" in this document are to be interpreted as described in RFC 2068[7]. 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 RFC 2119[8]. Frystyk, et al [Page 2] INTERNET-DRAFT Mandatory Tuesday, January 20, 1998 This proposal does not rely on particular features defined in URLs [3] that cannot potentially be expressed using URNs (see section 7). Therefore, the more generic term URI[2] is used throughout the specification. 3. Extension Declarations An extension declaration can be used to indicate that an extension has been applied to a message and possibly to reserve a part of the header namespace identified by a header field prefix (see 3.1). The grammar for an extension declaration is as follows: ext-decl = <"> URI <"> [ ext-params ] ext-params = ";" namespace *( ext-extension ) namespace = ";" "ns" "=" prefix prefix = 1*DIGIT "-" ext-extension = ";" token [ "=" ( token | quoted-string ) ] An extension is identified by a URI. Extension identifier URIs can be either relative or absolute. Relative extension identifiers are interpreted relative to the IANA registry (see RFC 1808[4]). Examples of URIs are "http://www.temporary.com/extension" "rfc6534" "Content-FooBar" An extension declaration can be extended through the use of one or more ext-extension parameters. Unrecognized ext-extension parameters SHOULD be ignored and MUST NOT be removed by proxies when forwarding the extension declaration. Note: In layered implementations, unknown ext-extension parameters should be passed to the upper layers as they may have other mechanisms of knowing the semantics of the parameters. 3.1 Header Field Prefixes The header-prefix can be used to indicate that all header fields in the message matching the header-prefix value using string prefix- matching are introduced by this extension instance. This allows an extension instance to dynamically reserve a subspace of the header space in a protocol message in order to prevent header field name clashes. Agents SHOULD NOT reuse header-prefix values in the same message. Examples of header-prefix values are 1234- 546- 234345653- Frystyk, et al [Page 3] INTERNET-DRAFT Mandatory Tuesday, January 20, 1998 Linear white space (LWS) MUST NOT be used between the 1*DIGIT and the "-". The format of the prefix using a combination of digits and the dash "-" guarantees that no extension declaration can reserve the whole header field name space. Note: Old applications may introduce header fields independent of this extension mechanism, potentially conflicting with header fields introduced by the prefix mechanism. In order to minimize this risk, prefixes should contain at least 3 digits. 4. Extension Header Fields This proposal introduces two types of extension declarations: mandatory and optional declarations. A mandatory extension declaration indicates that the ultimate recipient MUST consult and adhere to the rules given by the extension when processing the message or report an error (see section 5 and 6). An optional extension declaration indicates that the ultimate recipient of the extension MAY consult and adhere to the rules given by the extension when processing the message, or ignore the extension declaration completely. An agent may not be able to distinguish whether the ultimate recipient does not understand an extension referred to by an optional extension or simply ignores the extension declaration. There are two scopes for extensions declarations: Hop-by-hop and end- to-end. The scopes are distinguished by separate header field names so that multiple extensions with different scopes can be applied to the same message. 4.1 End-to-End Extensions End-to-end and hop-by-hop. End-to-end declarations MUST be transmitted to the ultimate recipient of the declaration. The Man and the Opt general header fields are end-to-end header fields and are defined as follows: mandatory = "Man" ":" 1#ext-decl optional = "Opt" ":" 1#ext-decl For example HTTP/1.1 200 OK Content-Length: 421 Opt: "http://www.digest.org/Digest"; ns=54- 54-digest: "4525dct344v@fsdfsg" ... Proxies MAY act as both the initiator and the ultimate recipient of end-to-end extension declarations. It is outside the scope of this Frystyk, et al [Page 4] INTERNET-DRAFT Mandatory Tuesday, January 20, 1998 specification to define how an agreement is reached between a party representing the proxy and the party on which behalf it can act, but for example, the parties may be within the same trust domain. If a proxy is the ultimate recipient of a mandatory end-to-end extension declaration then it MUST handle that extension declaration as described in section 5. The proxy SHOULD remove all parts of the extension declaration from the message before forwarding it. 4.2 Hop-by-Hop Extensions Hop-by-hop extension declarations are meaningful only for a single transport-level connection. The C-Man and the C-Opt general header field are hop-by-hop header fields and MUST NOT be communicated by proxies over further connections. The two headers have the following grammar: c-mandatory = "C-Man" ":" 1#ext-decl c-optional = "C-Opt" ":" 1#ext-decl For example GET / HTTP/1.1 Host: some.host C-Man: "http://www.digest.org/ProxyAuth"; ns=23- 23-Credentials: "g5gj262jdw@4df" Connection: C-Man, 23-Credentials In HTTP/1.1, the C-Man and the C-Opt header field MUST be protected by a Connection header. That is, the header fields are to be included as Connection header directives (see section [7], section 14.10). An agent MUST NOT send the C-Man or the C-Opt header field to an HTTP/1.0 proxy as it does not obey the HTTP/1.1 rules for parsing the Connection header field (see [7], section 19.7.1). 5. Mandatory HTTP Requests An HTTP request is called a mandatory request if it includes at least one mandatory extension declaration (using the Man or the C-Man header fields). The method name of a mandatory request MUST be prefixed by "M-". For example, a client might express the binding rights- management constraints in an HTTP PUT request as follows: M-PUT /a-resource HTTP/1.1 Man: "http://www.copyright.org/rights-management"; ns=43- 43-copyright: http://www.copyright.org/COPYRIGHT.html- 43-contributions: http://www.copyright.org/PATCHES.html Host: www.w3.org Content-Length: 1203 Content-Type: text/html Frystyk, et al [Page 5] INTERNET-DRAFT Mandatory Tuesday, January 20, 1998