Requirements
- Python 3.3 support has been dropped.
Improvements
- To ensure compatibility with JSON-RPC 1.2, 2 more "Content-Type" values are supported by JSON-RPC Handler: "application/json-rpc" and "application/jsonrequest" (#24). Thanks to @dansan
- Django 2.1 has been added to supported tests environment. It is now officially supported.
Improvements
Last release introduced some undocumented breaking API changes regarding RPC registry management. Old API has been restored for backward compatibility. The following global functions are now back in the API:
- modernrpc.core.register_rpc_method()
- modernrpc.core.get_all_method_names()
- modernrpc.core.get_all_methods()
- modernrpc.core.get_method()
- modernrpc.core.reset_registry()
In addition, some improvements have been applied to unit tests, to make sure test environment is the same after each test function. In addition, some exclusion patterns have been added in .coveragerc file to increase coverage report accuracy.
Improvements
- Django 2.0 is now officially supported. Tox and Travis default config have been updated to integrate Django 2.0 in existing tests environements.
- Method's documentation is generated only if needed and uses Django's @cached_property decorator
- HTML documentation default template has been updated: Bootstrap 4.1.0 stable is now used, and the rendering has been improved.
API Changes
- Class RPCRequest has been removed and replaced by method
execute_procedure(name, args, kwargs)
inRPCHandler
class. This method contains common logic used to retrieve a RPC method, execute authentication predicates to make sure it can be run, execute the concrete method and return the result. - HTML documentation content is not anymore marked as "safe" using
django.utils.safestring.mark_safe()
. You have to use Django decoratorsafe
in your template if you display this value.
Settings
- The
kwargs
dict passed to RPC methods can have customized keys (#18). Set the following values:settings.MODERNRPC_KWARGS_REQUEST_KEY
settings.MODERNRPC_KWARGS_ENTRY_POINT_KEY
settings.MODERNRPC_KWARGS_PROTOCOL_KEY
settings.MODERNRPC_KWARGS_HANDLER_KEY
to override dict keys and prevent conflicts with your own methods arguments.
Other updates
- Many units tests have been improved. Some tests with many calls to LiveServer have been splitted into shorter ones.
Improvements
- Logging system / error management
- In case of error, current exception stacktrace is now passed to logger by default. This allows special handler like
django.utils.log.AdminEmailHandler
orraven.handlers.logging.SentryHandler
to use it to report more useful information (#13) - Error messages have been rewritten to be consistent across all modules and classes
- Decrease log verbosity: some
INFO
log messages now haveDEBUG
level (startup methods registration)
- In case of error, current exception stacktrace is now passed to logger by default. This allows special handler like
- Documentation has been updated
- Added a page to explain how to configure RPC methods documentation generation, and add a note to explicitly
state that
markdown
ordocutils
package must be installed ifsettings.MODERNRPC_DOC_FORMAT
is set to non-empty value (#16) - Added a page to list implemented system introspection methods
- Added a bibliography page, to list all references used to write the library
- Added a page to explain how to configure RPC methods documentation generation, and add a note to explicitly
state that
- Default template for generated RPC methods documentation now uses Bootstrap 4.0.0-beta.2 (previously 4.0.0-alpha.5)
This is a major release with many improvements, protocol support and bug fixes. This version introduce an API break, please read carefully.
Improvements
- Class
RPCException
and its subclasses now accept an additionaldata
argument (#10). This is used by JSON-RPC handler to report additional information to user in case of error. This data is ignored by XML-RPC handler. - JSON-RPC: Batch requests are now supported (#11)
- JSON-RPC: Named parameters are now supported (#12)
- JSON-RPC: Notification calls are now supported. Missing id in payload is no longer considered as invalid, but is correectly handled. No HTTP response is returned in such case, according to the standard.
- XML-RPC: exception raised when serializing data to XML are now catched as
InternalError
and a clear error message
API Changes
modernrpc.handlers.JSONRPC
andmodernrpc.handlers.XMLRPC
constants have been moved and renamed. They become respectivelymodernrpc.core.JSONRPC_PROTOCOL
andmodernrpc.core.XMLRPC_PROTOCOL
RPCHandler
class updated, as well as subclasesXMLRPCHandler
andJSONRPCHandler
.RPCHandler.parse_request()
is nowRPCHandler.process_request()
. The new method does not return a tuple(method_name, params)
anymore. Instead, it executes the underlying RPC method using new classRPCRequest
. If you customized your handlers, please make sure you updated your code (if needed).
Minor updates
- Code has been improved to prepare future compatibility with Django 2.0
Important
This version is a security fix. Upgrade is highly recommended
Security fix
- Authentication backend is correctly checked when executing method using
system.multicall()
Bugfixes
- Fixed invalid HTML tag rendered from RPC Method documentation. Single new lines are converted to space since they are mostly used to limit docstrings line width. See pull request #7, thanks to @adamdonahue
- Signature of
auth.set_authentication_predicate
has been fixed so it can be used as decorator (#8). Thanks to @aplicacionamedida
Minor fix
- Removed useless settings variable introduced in last 0.7.0 release. Logging capabilities are now enabled by simply
configuring a logger for
modernrpc.*
modules, using Django variableLOGGING
. The documentation has been updated accordingly.
Improvement
- Default logging behavior has changed. The library will not output any log anymore, unless
MODERNRPC_ENABLE_LOGGING
is set to True. See documentation for more information
Performance Improvements
- Django cache system was previously used to store the list of available methods in the current project. This was useless, and caused issues with some cache systems (#5). Use of cache system has been removed. The list of RPC methods is computed when the application is started and kept in memory until it is stopped.
Improvements
- HTTP Basic Authentication backend: User instance is now correctly stored in current request after successful authentication (#4)
- Unit testing with Django 1.11 is now performed against release version (Beta and RC are not tested anymore)
- Various Documentation improvements
Improvements
- When RPC methods are registered, if a module file contains errors, a python warning is produced. This ensure the message will be displayed even if the logging system is not configured in a project (#2)
- Python 2 strings standardization. Allow to configure an automatic conversion of incoming strings, to ensure they have
the same type in RPC method, no matter what protocol was used to call it. Previously, due to different behavior
between JSON and XML deserializers, strings were received as
str
when method was called via XML-RPC and asunicode
with JSON-RPC. This standardization process is disabled by default, and can be configured for the whole project or for specific RPC methods. - Tests are performed against Django 1.11rc1
modernrpc.core.register_method()
function was deprecated since version 0.4.0 and has been removed.
Improvements
- Typo fixes
- JSON-RPC 2.0 standard explicitly allows requests without 'params' member. This doesn't produce error anymore.
- Setting variable
MODERNRPC_XML_USE_BUILTIN_TYPES
is now deprecated in favor ofMODERNRPC_XMLRPC_USE_BUILTIN_TYPES
- Unit tests are now performed with python 3.6 and Django 1.11 alpha, in addition to supported environment already tested. This is a first step to full support for these environments.
- HTTP "Basic Auth" support: it is now possible to define RPC methods available only to specific users. The control can be done on various user attributes: group, permission, superuser status, etc. Authentication backend can be extended to support any method based on incoming request.
Improvements
- Various performance improvements
- Better use of logging system (python builtin) to report errors & exceptions from library and RPC methods
- Rewritten docstring parser. Markdown and reStructured formatters are still supported to generate HTML documentation for RPC methods. They now have unit tests to validate their behavior.
- @rpc_method decorator can be used with or without parenthesis (and this feature is tested)
- System methods have been documented
Improvements
- Method arguments documentation keep the same order as defined in docstring
- API change:
MODERNRPC_ENTRY_POINTS_MODULES
setting have been renamed toMODERNRPC_METHODS_MODULES
. - A simple warning is displayed when
MODERNRPC_METHODS_MODULES
is not set, instead of a radicalImproperlyConfigured
exception. - Some traces have been added to allow debugging in the module easily. It uses the builtin logging framework.
API Changes
- New unified way to register methods. Documentation in progress
- XMl-RPC handler will now correctly serialize and unserialize None values by default. This behavior can be
configured using
MODERNRPC_XMLRPC_ALLOW_NONE
setting.
Bugfix
- When django use a persistent cache (Redis, memcached, etc.), ensure the registry is up-to-date with current sources at startup
Bugfix
- Include missing templates in pypi distribution packages
Improvements
- HTML documentation automatically generated for an entry point
system.multicall
is now supported, only in XML-RPC- Many tests added
API Changes
Settings variables have been renamed to limit conflicts with other libraries. In the future, all settings will have the same prefix.
JSONRPC_DEFAULT_DECODER
becomesMODERNRPC_JSON_DECODER
JSONRPC_DEFAULT_ENCODER
becomesMODERNRPC_JSON_ENCODER
See https://github.com/alorence/django-modern-rpc/blob/master/modernrpc/conf/default_settings.py for more details
Many other settings added, to make the library more configurable. See http://django-modern-rpc.readthedocs.io/en/latest/basic_usage/settings.html
Improvements
- RPC methods can now declare the special
**kwargs
parameter. The dict will contain information about current context (request, entry point, protocol, etc.) - About 12 tests added to increase coverage
- Many documentation improvements
system.methodHelp
is now supported
Minor change
- Useless tests & testsite packages have been removed from Pypi distributions (binary & source)
Minor change
- Useless tests packages have been removed from Pypi distributions (binary & source)
Improvements
- Project is now configured to report tests coverage. See https://coveralls.io/github/alorence/django-modern-rpc
- Some documentation have been added, to cover more features of the library. See http://django-modern-rpc.readthedocs.io/en/latest/
- Many unit tests added to increase coverage
RPCEntryPoint
class can now be configured to handle only requests from a specific protocol
Improvements
- Added very basic documentation: http://django-modern-rpc.rtfd.io/
system.listMethods
is now supportedsystem.methodSignature
is now supported- Error reporting has been improved. Correct error codes and messages are returned on usual fail cause.
See module
modernrpc.exceptions
for more information. - Many unit tests have been added to increase test coverage of the library
This is the very first version of the library. Only a few subset of planned features were implemented
Current features
- Work with Python 2.7, 3.3, 3.4 (Django 1.8 only) and 3.5
- Work with Django 1.8, 1.9 and 1.10
- JSON-RPC and XML-RPC simple requests support
- Multiple entry-points with defined list of methods and supported protocols
Missing features
- No authentication support
- Unit tests doesn't cover all the code
- RPC system methods utility (
listMethods
,methodSignature
, etc.) are not yet implemented - There is no way to provide documentation in HTML form
- The library itself doesn't have any documentation (appart from README.md)