From cece85a75e2cf003e37290efc921344ea00edc36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rom=C3=A1n=20C=C3=A1rdenas?= Date: Sat, 5 Jan 2019 19:49:00 +0100 Subject: [PATCH] documentation --- docs/references/broker.rst | 5 +++-- samples/{boker_acl.py => broker_acl.py} | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) rename samples/{boker_acl.py => broker_acl.py} (96%) diff --git a/docs/references/broker.rst b/docs/references/broker.rst index 377ca87..7a9a334 100644 --- a/docs/references/broker.rst +++ b/docs/references/broker.rst @@ -81,6 +81,7 @@ The :class:`~hbmqtt.broker.Broker` ``__init__`` method accepts a ``config`` para enabled: true / false # Set to False if topic filtering is not needed plugins: ['topic_acl'] #List of plugins to activate for topic filtering among all registered plugins acl: + # username: [list of allowed topics] username1: ['repositories/+/master', 'calendar/#', 'data/memes'] # List of topics on which client1 can publish and subscribe username2: ... anonymous: [] # List of topics on which an anonymous client can publish and subscribe @@ -104,9 +105,9 @@ The ``topic-check`` section setup access control policies for publishing and sub * ``enabled``: set to true if you want to impose an access control policy. Otherwise, set it to false. * ``plugins``: defines the list of activated plugins. Note the plugins must be defined in the ``hbmqtt.broker.plugins`` `entry point `_. -* aditional parameters: depending on the plugin used for access control, additional parameters should be added. +* additional parameters: depending on the plugin used for access control, additional parameters should be added. * In case of ``topic_acl`` plugin, the Access Control List (ACL) must be defined in the parameter ``acl``. - * For each of the usernames, a list with the allowed topics must be defined. + * For each username, a list with the allowed topics must be defined. * If the client logs in anonymously, the ``anonymous`` entry within the ACL is used in order to grant/deny subscriptions. diff --git a/samples/boker_acl.py b/samples/broker_acl.py similarity index 96% rename from samples/boker_acl.py rename to samples/broker_acl.py index 83fda2f..165e6f3 100644 --- a/samples/boker_acl.py +++ b/samples/broker_acl.py @@ -32,6 +32,7 @@ config = { 'topic_acl' ], 'acl': { + # username: [list of allowed topics] 'test': ['repositories/+/master', 'calendar/#', 'data/memes'], 'anonymous': [] }