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 --- ipapython/version.py.in | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ipapython/version.py.in') diff --git a/ipapython/version.py.in b/ipapython/version.py.in index 041425b50..9cf8ddbe8 100644 --- a/ipapython/version.py.in +++ b/ipapython/version.py.in @@ -23,3 +23,6 @@ VERSION="__VERSION__" # Just the numeric portion of the version so one can do direct numeric # comparisons to see if the API is compatible. NUM_VERSION=__NUM_VERSION__ + +# The version of the API. +API_VERSION=u'__API_VERSION__' -- cgit