1
0
Fork 0
bthlabs-jsonrpc/packages/bthlabs-jsonrpc-core/docs/source/ext.rst

52 lines
1.3 KiB
ReStructuredText

Extensions
==========
.. module:: bthlabs_jsonrpc_core.ext
This section provides documentation for built-in extensions for BTHLabs
JSONRPC - Core.
JWT Codec
---------
This extension implements codec for using JWT instead of JSON for request and
response payloads.
**Installation**
Since JWT has external dependencies it needs to explicitly named to be
installed.
.. code-block::
$ pip install bthlabs_jsonrpc_core[jwt]
This will install ``python-jose[cryptography]``. Consult *python-jose* docs for
additional information on supported backends. If you wish to install another
backend, install *python-jose* accordingly and skip the *jwt* extra when
installing *bthlabs-jsonrpc-core*.
**API**
.. data:: bthlabs_jsonrpc_core.ext.jwt.ALGORITHMS
Supported algorithms. Directly exported from :py:data:`jose.constants.ALGORITHMS`.
.. class:: bthlabs_jsonrpc_core.ext.jwt.ECKey
ECDSA key wrapper. Directly exported from :py:class:`jose.jwk.ECKey`.
.. class:: bthlabs_jsonrpc_core.ext.jwt.HMACKey
HMAC key wrapper. Directly exported from :py:class:`jose.jwk.HMACKey`.
.. class:: bthlabs_jsonrpc_core.ext.jwt.RSA
RSA key wrapper. Directly exported from :py:class:`jose.jwk.RSA`.
.. autoclass:: bthlabs_jsonrpc_core.ext.jwt.KeyPair
:members:
.. autoclass:: bthlabs_jsonrpc_core.ext.jwt.JWTCodec
:members: