From c69d8084c17c5d94240bda9447ed9546159608a5 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 13 Jan 2011 14:29:16 -0500 Subject: Add API version and have server reject incompatible clients. This patch contains 2 parts. The first part is a small utility to create and validate the current API. To do this it needs to load ipalib which on a fresh system introduces a few problems, namely that it relies on a python plugin to set the default encoding to utf8. For our purposes we can skip that. It is also important that any optional plugins be loadable so the API can be examined. The second part is a version exchange between the client and server. The version has a major and a minor version. The major verion is updated whenever existing API changes. The minor version is updated when new API is added. A request will be rejected if either the major versions don't match or if the client major version is higher than then server major version (though by implication new API would return a command not found if allowed to proceed). To determine the API version of the server from a client use the ping command. ticket 584 --- BUILD.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'BUILD.txt') diff --git a/BUILD.txt b/BUILD.txt index acb5cacf0..d70351d6a 100644 --- a/BUILD.txt +++ b/BUILD.txt @@ -67,6 +67,25 @@ Some tests may be skipped. For example, all the XML-RPC tests will be skipped if you haven't started the lite-server. The DNS tests will be skipped if the underlying IPA installation doesn't configure DNS, etc. +API.txt +------- +The purpose of the file API.txt is to prevent accidental API changes. The +program ./makeapi creates file and also validates it (with the --validate +option). This validation is part of the build process. + +There are three solutions to changes to the API: + +1. Changes to existing API require a change to the MAJOR version. +2. Addition of new API requires a change to the MINOR version. +3. Or just back out your changes and don't make an API change. + +If the API changes you'll need to run ./makeapi to update API.txt and +commit it along with VERSION with your API change. + +If a module is optionally loaded then you will need to be able to +conditionally load it for API validation. The environment variable +api.env.validate_api is True during validation. + General Notes ------------- IPA is not relocatable. -- cgit