HTTP Extentions patches for Apache 2

Status

This code has run for a while with no changes but has not debuted on a high volume production server. This should be rectified as I will install it on W3C's main server. It is made available for those collaborating and any who wish to experiment. If you have questions or bug fixes, please contact eric@w3.org. Interoperability tests can be run against the MetaPack implementations in Mozilla and libwww (not checked in yet).

Motivation

HTTP Extensions originally derived from PEP but was paired down to reduce implementation complexity. It provides a rigorous way to handle the traditionally chaotic realm of X- headers. It is a mechanism to identify and allocate additional headers and communicate which agents may or must understand them.

The growing world of dynamic protocol extension currently looks to XML protocols like SOAP. There are unfortunate protocol implications that can be handled by HTTP Extensions.

Code

http_ext.h
Header file for all Apache 2 HTTP Extensions defines the API and constants needed to implement a cooperative HTTP Extension.
http_ext.html
Brief (probably out of date) description of the API.
http_ext.tst
Simple test data if you are using the exciting telnet client.
mod_http_ext.c
The code that supports the HTTP Extensions API. It interacts with Apache as a standard module.
meta_package.h
A API for auth modules wishing to support the sample MetaPack module.
mod_meta_package.c
The core MetaPack HTTP Extension module. It provides Meta data for the standard apache modules that don't currently interact with MetaPack.
mod_auth_sqlACL.c
A module in use for a couple years at W3C which provides database-based ACLs. It is included here as the _metaPack_ap_querySqlACLData function demonstrates how auth modules can interact with MetaPack.
Makefile
A Makefile that seems to get apache to build and link these modules.
modules.mk
Something else mysterious. Important?

Building

The code for apache, mozilla and the HTTP Extensions come from three different repositories. You will first need to login to each:

cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login # password is anonymous cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot login # password is anonymous cvs -d :pserver:anonymous@dev.w3.org:/sources/public login # password is anonymous

The easiest way to build is to pick someplace with a couple gig of free space (67 Meg for apache, 1798 Meg for mozilla, and 1 Meg for patches and added modules) and create a directory for this build, for instance, httpExt in the example below:

(mkdir httpExt && cd httpExt && make -f 2002/httpExt/apache_2/cvs.mk apache-DEBUG && make -f 2002/httpExt/mozilla_1/cvs.mk mozilla-DEBUG)

Now wait a looooong time. If you want to see it in action, try the demo:

(cd httpExt && make -f 2002/httpExt/Makefile demo)

If you wish to just build apache, you can easily removie the above mozilla lines and perform the telnet tests below.

Outstanding build issues:

I have no idea how one is supposed to add modules to apache-2 so I made a directory modules/w3c and stuck all the files in it. I can answer specific questions and would be glad to update this if someone can tell me the right way to do it. I currently patch the configure.in, see the makefile.


Tests

Tests were done with mozilla (with HTTP Extensions) and telnet and monitored with patchPanel.

document server

These are documented in the mozilla tests.

proxy server

First, the cache was filled with a request variant A:

Client:
GET http://localhost:9002/doc1.xhtml HTTP/1.1
Host: localhost:9002
User-Agent: telnet
Accept: text/xhtml+xml;q=0.9
Keep-Alive: 300
Proxy-Connection: keep-alive
00-Action: GET-META(ACLs)
00-Accept: http://www.w3.org/1999/02/22-rdf-syntax-ns#
Opt: "http://www.w3.org/2001/07/07-MetaPackage/"; ns=00
Proxy Client:
GET /doc1.xhtml HTTP/1.1
Host: localhost:9002
User-Agent: telnet
Accept: text/xhtml+xml;q=0.9
00-Action: GET-META(ACLs)
00-Accept: http://www.w3.org/1999/02/22-rdf-syntax-ns#
Opt: "http://www.w3.org/2001/07/07-MetaPackage/"; ns=00
Max-Forwards: 10
Via: 1.1 127.0.0.1:9003
Server:
HTTP/1.1 200 OK
Date: Tue, 06 Aug 2002 00:23:22 GMT
Server: Apache/2.0.40-dev (Unix)
Vary: 00-Accept,Opt
Last-Modified: Mon, 05 Aug 2002 08:32:14 GMT
ETag: "204185-102-c6d39f80"
Accept-Ranges: bytes
Content-Length: 1210
Content-Type: multipart/mixed; boundary=3a780105fa6bf2ca6
00-Package-Language: http://www.w3.org/1999/02/22-rdf-syntax-ns#
00-Content-Type: application/xhtml+xml
00-Content-Length: 258
Man: "http://www.w3.org/2001/07/07-MetaPackage/"; ns=00

--3a780105fa6bf2ca6
Content-type: text/xml
Content-length: 776

<?xml version="1.0"?>
<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
   <s:resourceAccessRule
    xmlns:s="http://www.w3.org/2001/02/acls/ns#">
      <s:accessor rdf:resource="http://www.w3.org/Systems/db/webId?all=all" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#racl" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#head" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#get" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#connect" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#options" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#trace" />
      <s:hasAccessTo rdf:resource="/doc1.xhtml" />
   </s:resourceAccessRule>
</rdf:RDF>

--3a780105fa6bf2ca6
Content-type: application/xhtml+xml
Content-length: 258

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>doc1</title>
  </head>
  <body><p>content1</p></body>
</html>
--3a780105fa6bf2ca6--
Proxy Server:
HTTP/1.1 200 OK
Date: Tue, 06 Aug 2002 00:23:22 GMT
Server: Apache/2.0.40-dev (Unix)
Vary: 00-Accept,Opt
Last-Modified: Mon, 05 Aug 2002 08:32:14 GMT
ETag: "204185-102-c6d39f80"
Accept-Ranges: bytes
Content-Type: multipart/mixed; boundary=3a780105fa6bf2ca6
00-Package-Language: http://www.w3.org/1999/02/22-rdf-syntax-ns#
00-Content-Type: application/xhtml+xml
00-Content-Length: 258
Man: "http://www.w3.org/2001/07/07-MetaPackage/"; ns=00
Via: 1.1 127.0.0.1:9003
Content-Length: 1210

--3a780105fa6bf2ca6
Content-type: text/xml
Content-length: 776

<?xml version="1.0"?>
<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
   <s:resourceAccessRule
    xmlns:s="http://www.w3.org/2001/02/acls/ns#">
      <s:accessor rdf:resource="http://www.w3.org/Systems/db/webId?all=all" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#racl" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#head" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#get" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#connect" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#options" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#trace" />
      <s:hasAccessTo rdf:resource="/doc1.xhtml" />
   </s:resourceAccessRule>
</rdf:RDF>

--3a780105fa6bf2ca6
Content-type: application/xhtml+xml
Content-length: 258

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>doc1</title>
  </head>
  <body><p>content1</p></body>
</html>
--3a780105fa6bf2ca6--

The hard part of implementing HTTP Extensions is insuring cache viability when the Vary: header references HTTP Extensions headers. Cache re-use was tested with variant B which was the same as A with a change to the extension prefix. The proxy server was able to serve the request as it had already cached a semantically equivilent request:

Client:
GET http://localhost:9002/doc1.xhtml HTTP/1.1
Host: localhost:9002
User-Agent: telnet
Accept: text/xhtml+xml;q=0.9
Keep-Alive: 300
Proxy-Connection: keep-alive
01-Action: GET-META(ACLs)
01-Accept: http://www.w3.org/1999/02/22-rdf-syntax-ns#
Opt: "http://www.w3.org/2001/07/07-MetaPackage/"; ns=01
Proxy Server:
HTTP/1.1 200 OK
Date: Tue, 06 Aug 2002 01:10:15 GMT
Server: Apache/2.0.40-dev (Unix)
Vary: 00-Accept,Opt
ETag: "204185-102-c6d39f80"
Accept-Ranges: bytes
00-Package-Language: http://www.w3.org/1999/02/22-rdf-syntax-ns#
00-Content-Type: application/xhtml+xml
00-Content-Length: 258
Man: "http://www.w3.org/2001/07/07-MetaPackage/"; ns=00
Via: 1.1 127.0.0.1:9003
Last-Modified: Mon, 05 Aug 2002 08:32:14 GMT
Content-Type: multipart/mixed; boundary=3a780b75131d22ca6
Age: 12705646
Content-Length: 1210

--3a780b75131d22ca6
Content-type: text/xml
Content-length: 776

<?xml version="1.0"?>
<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
   <s:resourceAccessRule
    xmlns:s="http://www.w3.org/2001/02/acls/ns#">
      <s:accessor rdf:resource="http://www.w3.org/Systems/db/webId?all=all" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#racl" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#head" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#get" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#connect" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#options" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#trace" />
      <s:hasAccessTo rdf:resource="/doc1.xhtml" />
   </s:resourceAccessRule>
</rdf:RDF>

--3a780b75131d22ca6
Content-type: application/xhtml+xml
Content-length: 258

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>doc1</title>
  </head>
  <body><p>content1</p></body>
</html>
--3a780b75131d22ca6--

The hard part of implementing HTTP Extensions is insuring cache viability when the Vary: header references HTTP Extensions headers. First, cache re-use was tested:

Client:
GET http://localhost:9002/doc1.xhtml HTTP/1.1
Host: localhost:9002
User-Agent: telnet
Accept: text/xhtml+xml;q=0.9
Keep-Alive: 300
Proxy-Connection: keep-alive
01-Action: GET-META(ACLs)
01-Accept: http://www.w3.org/2001/12/soap-encoding
Opt: "http://www.w3.org/2001/07/07-MetaPackage/"; ns=01
Proxy Client:
GET /doc1.xhtml HTTP/1.1
Host: localhost:9002
User-Agent: telnet
Accept: text/xhtml+xml;q=0.9
01-Action: GET-META(ACLs)
01-Accept: http://www.w3.org/2001/12/soap-encoding
Opt: "http://www.w3.org/2001/07/07-MetaPackage/"; ns=01
Max-Forwards: 10
Via: 1.1 127.0.0.1:9003
Server:
HTTP/1.1 200 OK
Date: Tue, 06 Aug 2002 00:38:50 GMT
Server: Apache/2.0.40-dev (Unix)
Last-Modified: Mon, 05 Aug 2002 08:32:14 GMT
ETag: "204185-102-c6d39f80"
Accept-Ranges: bytes
Content-Length: 258
Content-Type: application/xhtml+xml

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>doc1</title>
  </head>
  <body><p>content1</p></body>
</html>
Proxy Server:
HTTP/1.1 200 OK
Date: Tue, 06 Aug 2002 00:38:50 GMT
Server: Apache/2.0.40-dev (Unix)
Vary: 01-Accept,Opt
ETag: "204185-102-c6d39f80"
Accept-Ranges: bytes
00-Package-Language: http://www.w3.org/1999/02/22-rdf-syntax-ns#
00-Content-Type: application/xhtml+xml
00-Content-Length: 258
Man: "http://www.w3.org/2001/07/07-MetaPackage/"; ns=00
Via: 1.1 127.0.0.1:9003
Last-Modified: Mon, 05 Aug 2002 08:32:14 GMT
ETag: "204185-102-c6d39f80"
Accept-Ranges: bytes
Content-Type: application/xhtml+xml
Via: 1.1 127.0.0.1:9003
Content-Length: 258

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>doc1</title>
  </head>
  <body><p>content1</p></body>
</html>

Valid XHTML 1.0!

Eric Prud'hommeaux

$Id: Overview.html,v 1.6 2002/08/06 02:09:00 eric Exp $