view doc/jp/uri.rst @ 3160:330a5f1d9eea

core (memory/crypto): replaced `PyCrypto` by `cryptography`: `PyCrypto` is unmaintained for years but was used in SàT for password hashing. This patch fixes that by replacing `PyCrypto` by the reference `cryptography` module which is well maintained. The behaviour stays the same (except that previously async `hash`, `encrypt` and `decrypt` methods are now synchronous, as they are quick and using a deferToThread may actually be more resource intensive than using blocking methods). It is planed to improve `memory.crypto` by using more up-to-date cryptography/hashing algorithms in the future. PyCrypto is no more a dependency of SàT
author Goffi <goffi@goffi.org>
date Sun, 09 Feb 2020 23:50:26 +0100
parents 72583524cfd3
children
line wrap: on
line source

================================
uri: XMPP URI parsing/generation
================================

URI commands are helper to easily parse/build XMPP URIs.

parse
=====

Parse an XMPP URI, and print different parts.

When possible, the ``type`` of URI is shown (e.g. ``pubsub``) and the ``sub_type`` (e.g.
``microblog``).

The ``path`` is always displayed (see `RFC 5122 Path section`_ for details).

If suitable, you'll also get data like ``node`` (for a PubSub URI).

.. _RFC 5122 Path section: https://tools.ietf.org/html/rfc5122#section-2.4

examples
--------

Parse a blog URI::

  $ jp uri parse "xmpp:somebody@example.org?;node=urn%3Axmpp%3Amicroblog%3A0"

build
======

Build an XMPP URI according to arguments. 2 positional arguments are expected: ``type``
and ``path``. For now, only ``pubsub`` type is supported.

examples
--------

Build XMPP URI for a blog::

  $ jp uri build pubsub somebody@example.org -f node urn:xmpp:microblog:0