diff options
author | Petr Viktorin <pviktori@redhat.com> | 2012-12-19 04:25:24 -0500 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2013-11-26 16:59:59 +0100 |
commit | 1e836d2d0c8916f5b8a352cc8395048f1147554d (patch) | |
tree | 6c13ccd9083803e3945d40516d2add39533a4929 /ipalib/constants.py | |
parent | a1165ffbb80446890e3757113c9682c8526ed666 (diff) | |
download | freeipa-1e836d2d0c8916f5b8a352cc8395048f1147554d.tar.gz freeipa-1e836d2d0c8916f5b8a352cc8395048f1147554d.tar.xz freeipa-1e836d2d0c8916f5b8a352cc8395048f1147554d.zip |
Switch client to JSON-RPC
Modify ipalib.rpc to support JSON-RPC in addition to XML-RPC.
This is done by subclassing and extending xmlrpclib, because
our existing code relies on xmlrpclib internals.
The URI to use is given in the new jsonrpc_uri env variable. When
it is not given, it is generated from xmlrpc_uri by replacing
/xml with /json.
The rpc_json_uri env variable existed before, but was unused,
undocumented and not set the install scripts.
This patch removes it in favor of jsonrpc_uri (for consistency
with xmlrpc_uri).
Add the rpc_protocol env variable to control the protocol
IPA uses. rpc_protocol defaults to 'jsonrpc', but may be changed
to 'xmlrpc'.
Make backend.Executioner and tests use the backend specified by
rpc_protocol.
For compatibility with unwrap_xml, decoding JSON now gives tuples
instead of lists.
Design: http://freeipa.org/page/V3/JSON-RPC
Ticket: https://fedorahosted.org/freeipa/ticket/3299
Diffstat (limited to 'ipalib/constants.py')
-rw-r--r-- | ipalib/constants.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ipalib/constants.py b/ipalib/constants.py index 79885a33a..5f9f03a4a 100644 --- a/ipalib/constants.py +++ b/ipalib/constants.py @@ -111,10 +111,12 @@ DEFAULT_CONFIG = ( ('container_otp', DN(('cn', 'otp'))), # Ports, hosts, and URIs: - # FIXME: let's renamed xmlrpc_uri to rpc_xml_uri ('xmlrpc_uri', 'http://localhost:8888/ipa/xml'), - ('rpc_json_uri', 'http://localhost:8888/ipa/json'), + # jsonrpc_uri is set in Env._finalize_core() ('ldap_uri', 'ldap://localhost:389'), + + ('rpc_protocol', 'jsonrpc'), + # Time to wait for a service to start, in seconds ('startup_timeout', 120), @@ -199,5 +201,6 @@ DEFAULT_CONFIG = ( ('in_server', object), # Whether or not running in-server (bool) ('logdir', object), # Directory containing log files ('log', object), # Path to context specific log file + ('jsonrpc_uri', object), # derived from xmlrpc_uri in Env._finalize_core() ) |