Commit Graph

14 Commits

Author SHA1 Message Date
Petr Viktorin
1e836d2d0c 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
2013-11-26 16:59:59 +01:00
Petr Viktorin
7336a176b4 Add the version option to all Commands
Several Commands were missing the 'version' option. Add it to those
that were missing it.

Do not remove the version option before calling commands. This means
methods such as execute(), forward(), run() receive it.
Several of these needed `**options` added to their signatures.
Commands in the Cert plugin passed any unknown options to the underlying
functions, these are changed to pass what's needed explicitly.
Some commands in DNS and Batch plugins now pass version to commands
they call.

When the option is not given, fill it in automatically. (In a subsequent
commit, a warning will be added in this case).

Note that the public API did not change: all RPC calls already accepted
a version option. There's no need for an API version bump (even though
API.txt changes substantially).

Design page: http://freeipa.org/page/V3/Messages
Tickets:
  https://fedorahosted.org/freeipa/ticket/2732
  https://fedorahosted.org/freeipa/ticket/3294
2013-02-21 16:26:09 +01:00
Martin Kosek
092dd8db12 Replace float with Decimal
Having float type as a base type for floating point parameters in
ipalib introduces several issues, e.g. problem with representation
or value comparison. Python language provides a Decimal type which
help overcome these issues.

This patch replaces a float type and Float parameter with a
decimal.Decimal type in Decimal parameter. A precision attribute
was added to Decimal parameter that can be used to limit a number
of decimal places in parameter representation. This approach fixes
a problem with API.txt validation where comparison of float values
may fail on different architectures due to float representation error.

In order to safely transfer the parameter value over RPC it is
being converted to string which is then converted back to
decimal.Decimal number on a server side.

https://fedorahosted.org/freeipa/ticket/2260
2012-01-20 08:13:44 +01:00
Alexander Bokovoy
bce3cd945c Rename included snippets to avoid problems with pylint 2011-11-22 17:04:03 +02:00
Alexander Bokovoy
e9a9e2afdf Small fix to the guide CSS: enable vertical scroll bar 2011-11-22 16:06:02 +02:00
Alexander Bokovoy
d09389ab6f Add "Extending FreeIPA" developer guide
"Extending FreeIPA" is a developer guide of FreeIPA core framework.
Please make sure to improve the guide every time parts of the core framework
are affected by your changes. This document ideally should correspond to
the current state of the framework.

The Guide is written using Emacs Org Mode but can be edited with any
plain text editing tool. Emacs is only required to convert it to
distribution formats like HTML and TXT.

See guide/Makefile for building the guide and README for details of
the build environment.
2011-11-22 15:52:02 +02:00
Alexander Bokovoy
9837bb0d10 Minor typos in the examples 2011-06-27 23:04:18 -04:00
Yuri Chornoivan
be0308cf68 Typos in freeIPA messages and man page
https://fedorahosted.org/freeipa/ticket/1128
2011-05-10 08:46:57 +02:00
Martin Kosek
0353a2be67 Typos in freeIPA messages
This patch fixes several reported typos in IPA messages and
in comments.

Contributors file has been updated + the original author of the
patch reporting the typos was added.

https://fedorahosted.org/freeipa/ticket/848
2011-02-02 15:38:50 -05:00
Rob Crittenden
d7bd9138c8 Execute /usr/bin/python directly instead of /usr/bin/env python
ticket 608
2011-01-14 16:27:48 -05:00
Jakub Hrozek
7493d781df Change FreeIPA license to GPLv3+
The changes include:
 * Change license blobs in source files to mention GPLv3+ not GPLv2 only
 * Add GPLv3+ license text
 * Package COPYING not LICENSE as the license blobs (even the old ones)
   mention COPYING specifically, it is also more common, I think

 https://fedorahosted.org/freeipa/ticket/239
2010-12-20 17:19:53 -05:00
Jakub Hrozek
a874d5f8e5 Clarify the description of --raw and -all
https://fedorahosted.org/freeipa/ticket/244
2010-11-08 15:23:03 -05:00
Pavel Zuna
a8409b7db1 Add file with example plugins/tutorial.
Note that this is still work in progress and will be finished
in another patch. Specifically, it currently doesn't cover baseldap.py
classes.
2010-04-27 16:33:08 -04:00
Jason Gerard DeRose
5e871a0abb Fleshed out krb plugin and added example of scripting against Python API 2009-08-31 15:47:14 -06:00