XQuery/Publishing to Subversion

Motivation
To have a single button on a content management system that will copy a file to a remote subversion repository.

Method
Configuration of the subversion repository on a standard Apache server that is configured with an SSL certificate. This will encrypt all communication between the intranet system and the remote subversion server. We will also set the authentication to be Basic Authentication.

HTTP Put Function for Basic Authentication
HTTP Basic authentication requires the user to concatenate the user and password with a colon separating the strings and then do a base64-encoding on that string. This is then sent in the HTTP header with the key of "Authorization". The HTTP header must look like the following:

Authorization = Basic BASE64-ENCODED-USER-PASSWORD

The following XQuery function performs this process.

To put the file, put the URL in the correct content area, and the content to be inserted, the user name and password and

Monitoring HTTP Client Libraries
Debugging authentication protocols is very difficult if you do not have the correct tools. A useful tool is to enable logging for the httpclient module.