Release date: 2025-01-01
- JSON-RPC handler now performs request validation in a dedicated method, allowing better customization of that part. Inspired by #73, thanks to @hwalinga
- JSON-RPC handler now correctly checks type of request "id" field, according to the specification (#72). Thanks to @moonburnt
- Fixed docstring parser to allow empty or multi-line arg description
- Fixed registration of methods with same names under different entry points (#74). Thanks to @hwalinga
- Added support for Django 5.1
- Added support for Python 3.13
- Dropped support of Django 2.1
Release date: 2024-02-29
- When package
defusedxml
is installed in the same environment, builtinxmlrpc.client
module is patched to reduce the risk of various XML payload based attacks on the server
- Fix dependency to
packaging
introduced in previous release.
- Added support for Django 5.0 (Thanks to @washeck)
- Reduced the verbosity of the package. Startup initialization message is now a DEBUG log instead of an INFO one (Thanks to @washeck)
- Dropped use of Black and PyLint. Use Ruff to enforce all linting rules and code formatting
Release date: 2023-11-27
- When request is received with an invalid Content-Type (or missing one), the error response is now returned with a "text/plain" Content-Type header.
- Dropped support of python 3.5 and 3.6
- Added support for python 3.12 and Django 4.2
Release date: 2023-01-26
- Fixed invalid argument used to initialized default handlers instances (#52). Thanks to @washeck
Release date: 2023-01-03
After months of work, the 1.0 milestone is a major refactoring of the library. Many parts of the project have been modernized to improve readability and robustness, and a few issues were fixed.
- Type hinting is now supported in RPC methods. Auto-generated documentation will use it when it is defined. Old-style "doctypes" are still supported.
- Dependency to
six
have been completely removed
- When an authentication error is raised, the returned status code is now 200 instead of 403 for consistency with batch and system.multicall requests (#35)
- Django < 2.1 and Python < 3.5 support have been dropped.
- A new
modernrpc.core.Protocol
enum has been introduced to enforce correct protocol value when needed. (#29, #30). This new class replacesmodernrpc.core.JSONRPC_PROTOCOL
andmodernrpc.core.XMLRPC_PROTOCOL
but aliases were created for backward compatibility. RPCUnknownMethod
exception has been renamed toRPCMethodNotFound
. An alias has been created for backward compatibility
- Initialization process updated: exceptions are now raised on startup for invalid RPC modules. In addition, Django check system is used to notify common errors. This was requested multiple times (#2, #13, #34).
- JSON-RPC notification behavior has been fixed to respect standard. Requests without
id
are handled as notifications but requests with nullid
are considered invalid and will return an error - Batch request behavior has been fixed when one or more results failed to be serialized
- Builtin
system.methodSignature
behavior have been updated to respect standard. It now returns a list of list and unknown types are returned as "undef" (see http://xmlrpc-c.sourceforge.net/introspection.html)
- Added support for Python 3.9, 3.10 and 3.11
- Added support for Django 3.2, 4.0 and 4.1
- Documentation tree was completely reworked for clarity and simplicity. A new theme (Book) is now used to improve readability. See https://django-modern-rpc.rtfd.io.
- Poetry is now used to configure project dependencies and build distributions. The new
pyproject.toml
file replacessetup.py
,setup.cfg
,MANIFEST.in
andrequirements.txt
to centralize all dependencies, external tools settings (pytest, flake8, etc.) and packaging configuration - Black is now used to automatically format code
- Mypy is now used to verify type hints consistency
- Tox configuration now includes pylama, mypy, pylint and black environments
- All tests have been rewritten to have a strong separation between unit and functional tests. Test classes where created to group tests by similarities. Many fixtures have been added, with more parameterization, resulting in about 350 tests executed covering more than 95% of the code.
Release date: 2020-06-11
- Fix
ImportError
with Django 3.1
Release date: 2019-12-05
- Django 2.1, 2.2 and 3.0 are now officially supported. Thanks to @atodorov for 3.0 compatibility
- Added Python 3.7 and 3.8 support
- Dropped Python 3.3 support
- 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
Release date: 2018-05-13
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.
Release date: 2018-04-25
- Django 2.0 is now officially supported. Tox and Travis default config have been updated to integrate Django 2.0 in existing tests environments.
- 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.
- Many units tests have been improved. Some tests with many calls to LiveServer have been split into shorter ones.
- Class RPCRequest has been removed and replaced by method
execute_procedure(name, args, kwargs)
inRPCHandler
class. This method contains common logic used to retrieve an 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 marked as "safe" anymore, using
django.utils.safestring.mark_safe()
. You have to use Django decoratorsafe
in your template if you display this value.
- 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.
Release date: 2017-12-06
- 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)
Release date: 2017-10-03
This is a major release with many improvements, protocol support and bug fixes. This version introduces an API break, please read carefully.
- 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 a payload is no longer considered as invalid, but is correctly handled. No HTTP response is returned in such case, according to the standard.
- XML-RPC: exception raised when serializing data to XML are now caught as
InternalError
and a clear error message
- Both
modernrpc.handlers.JSONRPC
andmodernrpc.handlers.XMLRPC
constants were moved and renamed. They become respectivelymodernrpc.core.JSONRPC_PROTOCOL
andmodernrpc.core.XMLRPC_PROTOCOL
RPCHandler
class updated, as well as subclassesXMLRPCHandler
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).
- Code has been improved to prepare future compatibility with Django 2.0
Release date: 2017-10-02
important
This version is a security fix. Upgrade is highly recommended
- Authentication backend is correctly checked when executing method using
system.multicall()
Release date: 2017-07-12
- 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. It can now be used as decorator (#8). See the documentation for details. Thanks to @aplicacionamedida
Release date: 2017-06-24
- 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.
Release date: 2017-06-24
- Default logging behavior has changed. The library will not output any log anymore, unless
MODERNRPC_ENABLE_LOGGING
is set to True. See docs for details
Release date: 2017-05-13
- 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.
Release date: 2017-04-18
- 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
Release date: 2017-03-25
- When RPC methods are registered, if a module file contains errors, a python warning is produced. This ensures 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.
Release date: 2017-02-18
- 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.
Release date: 2016-11-20
- 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 the parenthesis (and this feature is tested)
- System methods have been documented
Release date: 2016-11-17
- 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.
Release date: 2016-11-17
- 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.
- When django use a persistent cache (Redis, memcached, etc.), ensure the registry is up-to-date with current sources at startup
Release date: 2016-10-26
- Include missing templates in pypi distribution packages
Release date: 2016-10-26
- HTML documentation automatically generated for an entry point
system.multicall
is now supported, only in XML-RPC- Many tests added
Release date: 2016-10-18
-
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 https://django-modern-rpc.rtfd.io/en/latest/basic_usage/settings.html
- 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
Release date: 2016-10-13
- Packages
modernrpc.tests
andtestsite
were excluded from Pypi distribution (both binary and source). This action was forgotten in the last release
Release date: 2016-10-13
- Packages
modernrpc.tests
andtestsite
were excluded from Pypi distribution (both binary and source)
Release date: 2016-10-12
- 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 https://django-modern-rpc.rtfd.io/
- Many unit tests added to increase coverage
RPCEntryPoint
class can now be configured to handle only requests from a specific protocol
Release date: 2016-10-05
- Added very basic documentation: https://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
Release date: 2016-10-02
This is the very first version of the library. Only a subset of planned features were implemented
- 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
- 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 (apart from the README.md)