deliberateDistortions.COM member

WeedNS Update Protocol

Revision: 1.13 (Date: 2002/06/15 20:05:23)
By Tyler "Crackerjack" MacDonald.
Questions/Comments: www@weedns.com

Contents


Goals and Features

The weeDNS Update Protocol meets the following goals:

These are the features of weeDNS's Update Protocol:

The following goals/features are set for the future of the protocol:


Request Syntax

Requests are in HTTP POST format, with parameters as the posted contents, in application/x-www-form-urlencoded format.

Requests may either have an action field, credential_* fields, but not both. Requests with an action field must also have a valid session cookie. In the event that both an action field, and credential_* fields, are specified, only the action field will be processed; the credential_* fields will be ignored.

Request Headers

The WeedNS Update Server pays attention to the following headers when dealing with a client request:

Authentication

To log in, send the following fields in application/x-www-form-urlencoded format to a weedns update engine:

The names of these fields were based off of the syntax for the Apache::AuthCookie module.

When a login is successful, you will be sent a HTTP Cookie, which should be used to authenticate subsequent requests, until either the expiry time specified in credential_2 is reached, or an attempt to update with the session key results in an authentication failure, at which point basic userid/password authentication should be specified again. A successful login will invalidate any old session keys associated with that account. This means that users logging in through a web based interface will invalidate the session key present in their client software. See the section on Client Efficiency below for more on this.

Actions

After a successful login, a WeedNS client can preform two possible actions. These are specified by setting the action field of the application/x-www-form-urlencoded data to the appropriate value; set action to logout to log out, or set it to update to preform a database update. These actions are described in more detail below:

Responses

The response sent back from the server describes how the request was handled. The HTTP Result Code indicates whether or not an action was taken, and if not, why not; the headers may contain some other useful auxillary information, and the body is, when a request has been processed, information about that request, and when a request has not been processed, usually informtion about why not, or how to make the reuest go through.

HTTP Result Code

The HTTP Result Code sent back from the server will indicate exactly what was done with your request; in all instances where the result code is 400 or higher, nothing was done with your request due to client or server error. The actual numeric response codes sent back from the server are as follows (listed along with their HTTP Standard english translations):

HTTP Headers

The HTTP Headers contain some extra information not included in the response. The only fields you actually need to check are Content-Type and Location, and the latter only in the case of a 302 HTTP Result Code. However, Server and Content-Language also provide some other useful information.

HTTP Content

Once the HTTP Result Code and Headers have been parsed, in most instances the weeDNS client will need to parse the content. The way that this is done is dependant on the Content-Type header.

Result Docuemnts (text/plain)

WeedNS document bodies that come with a Content-Type header set to text/plain contain one result per line. Each line will begin with either with the character "1" (one) to indicate success, or "0" (zero) to indicate failure. Within square brackets ("[]") there will be a reference to what succeeded or failed, and after the sqaure brackets there may be additional information about the request.

The result within the square brackets will be one of the following:

Prompt Docuemnts (application/x-www-form-urlencoded)

When a document with a Content-Language of weedns and a Content-Type of application/x-www-form-urlencoded is sent by the update server, the weedns server is prompting the client, indicating that not enough information has been supplied to fufill a request. The client should take the prompt and answer with the information that was requested in it.

The content of the response is a template of parameters that can be specified at this point. The parameters are specified as a urlencoded query string; the names of the parameters being the same as the names that should be sent back to the server when the conditions of the prompt are satisfied, and the values being a description of the data requested.

If a value for a parameter is not enclosed in brackets ("()"), that exact value should be sent back to the server for that parameter in the client's answer to the prompt. If the value for a paremeter is enclosed in brackets, then the following rules apply:

Client Guidelines

When writing a client that talks to weeDNS servers, especially if you're intending on releasing it to the public, it makes everybody's lives easier if you make sure you pay attention to certain details.

Efficiency

Security

Configurability

Reference Implementation

Revision History

This is the revision history for update_protocol.html:
Id: update_protocol.html,v 1.13 2002/06/15 20:05:23 faraway Exp


  Id: update_protocol.html,v 1.13 2002/06/15 20:05:23 faraway Exp - <www@weeDNS.com>