|
Version Control with Subversion - Chapter 8. Developer Information - RA-DAV (Repository Access Using HTTP/DAV)
RA-DAV (Repository Access Using HTTP/DAV)
The libsvn_ra_dav library is designed for use by clients
that are being run on different machines than the servers
with which they communicating, specifically servers reached
using URLs that contain the https: or
https: protocol portions. To understand
how this module works, we should first mention a couple of
other key components in this particular configuration of the
Repository Access Layer—the powerful Apache HTTP
Server, and the Neon HTTP/WebDAV client library.
Subversion's primary network server is the Apache HTTP
Server. Apache is a time-tested, extensible open-source
server process that is ready for serious use. It can
sustain a high network load and runs on many platforms. The
Apache server supports a number of different standard
authentication protocols, and can be extended through the
use of modules to support many others. It also supports
optimizations like network pipelining and caching. By using
Apache as a server, Subversion gets all of these features
for free. And since most firewalls already allow HTTP
traffic to pass through, system administrators typically
don't even have to change their firewall configurations to
allow Subversion to work.
Subversion uses HTTP and WebDAV (with DeltaV) to
communicate with an Apache server. You can read more about
this in the WebDAV section of this chapter, but in short,
WebDAV and DeltaV are extensions to the standard HTTP 1.1
protocol that enable sharing and versioning of files over
the web. Apache 2.0 and later versions come with mod_dav,
an Apache module that understands the DAV extensions to
HTTP. Subversion itself supplies mod_dav_svn, though, which
is another Apache module that works in conjunction with
(really, as a back-end to) mod_dav to provide Subversion's
specific implementations of WebDAV and DeltaV.
When communicating with a repository over HTTP, the RA
loader library chooses libsvn_ra_dav as the proper access
module. The Subversion client makes calls into the generic
RA interface, and libsvn_ra_dav maps those calls (which
embody rather large-scale Subversion actions) to a set of
HTTP/WebDAV requests. Using the Neon library, libsvn_ra_dav
transmits those requests to the Apache server. Apache
receives these requests (exactly as it does generic HTTP
requests that your web browser might make), notices that the
requests are directed at a URL that is configured as a DAV
location (using the <Location>
directive in httpd.conf ), and hands the
request off to its own mod_dav module. When properly
configured, mod_dav knows to use Subversion's mod_dav_svn for
any filesystem-related needs, as opposed to the generic
mod_dav_fs that comes with Apache. So ultimately, the client
is communicating with mod_dav_svn, which binds directly to the
Subversion Repository Layer.
That was a simplified description of the actual
exchanges taking place, though. For example, the Subversion
repository might be protected by Apache's authorization
directives. This could result in initial attempts to
communicate with the repository being rejected by Apache on
authorization grounds. At this point, libsvn_ra_dav gets
back the notice from Apache that insufficient identification
was supplied, and calls back into the Client Layer to get
some updated authentication data. If the data is supplied
correctly, and the user has the permissions that Apache
seeks, libsvn_ra_dav's next automatic attempt at performing
the original operation will be granted, and all will be
well. If sufficient authentication information cannot be
supplied, the request will ultimately fail, and the client
will report the failure to the user.
By using Neon and Apache, Subversion gets free
functionality in several other complex areas, too. For
example, if Neon finds the OpenSSL libraries, it allows the
Subversion client to attempt to use SSL-encrypted
communications with the Apache server (whose own mod_ssl can
“speak the language”). Also, both Neon itself
and Apache's mod_deflate can understand the
“deflate” algorithm (the same one used by the
PKZIP and gzip programs), so requests can be sent in smaller,
compressed chunks across the wire. Other complex features
that Subversion hopes to support in the future include the
ability to automatically handle server-specified redirects
(for example, when a repository has been moved to a new
canonical URL) and taking advantage of HTTP
pipelining.
[an error occurred while processing this directive]
|
|