From cec3f781a0c7b4ae1c0762e5bac1382ac7250282 Mon Sep 17 00:00:00 2001 From: Feng Date: Sun, 2 Oct 2016 18:42:55 +0800 Subject: [PATCH] 2.0-rc.1 - update docs for redis plugin --- docs/source/changes.rst | 21 +++++++++++++++++++++ docs/source/plugins.rst | 39 ++++++++++++++++++++------------------- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/docs/source/changes.rst b/docs/source/changes.rst index 218d9e0a7..3d659666a 100644 --- a/docs/source/changes.rst +++ b/docs/source/changes.rst @@ -5,6 +5,27 @@ Changes ======= +.. _release_2.0_rc.1: + +---------------- +Version 2.0-rc.1 +---------------- + +*Release Date: 2016-10-03* + +1. `mqtt/superuser` POST called two times in `emqtt_auth_http` (#696) + +2. Close MQTT TCP connection if authentication failed (#707) + +3. Improve the plugin management. Developer don't need to add plugin's config to rel/sys.config + +4. Add `BUILD_DEPS` in the plugin's Makefile:: + + BUILD_DEPS = emqttd + dep_emqttd = git https://github.com/emqtt/emqttd emq20 + +5. Improve the design of Redis ACL. + .. _release_2.0_beta.3: ------------------ diff --git a/docs/source/plugins.rst b/docs/source/plugins.rst index aecc1966d..2b90427cb 100644 --- a/docs/source/plugins.rst +++ b/docs/source/plugins.rst @@ -415,26 +415,25 @@ etc/plugins/emqttd_auth_redis.conf: %% Variables: %u = username, %c = clientid - %% HMGET mqtt_user:%u is_superuser - {supercmd, ["HGET", "mqtt_user:%u", "is_superuser"]}. - %% HMGET mqtt_user:%u password - {authcmd, ["HGET", "mqtt_user:%u", "password"]}. + {authcmd, "HGET mqtt_user:%u password"}. %% Password hash algorithm: plain, md5, sha, sha256, pbkdf2? {password_hash, sha256}. - %% SMEMBERS mqtt_acl:%u - {aclcmd, ["SMEMBERS", "mqtt_acl:%u"]}. + %% HMGET mqtt_user:%u is_superuser + {supercmd, "HGET mqtt_user:%u is_superuser"}. + + %% HGETALL mqtt_acl:%u + {aclcmd, "HGETALL mqtt_acl:%u"}. %% If no rules matched, return... {acl_nomatch, deny}. %% Load Subscriptions form Redis when client connected. - {subcmd, ["HGETALL", "mqtt_subs:%u"]}. + {subcmd, "HGETALL mqtt_sub:%u"}. - -Redis User HASH +Redis User Hash --------------- Set a 'user' hash with 'password' field, for example:: @@ -442,16 +441,18 @@ Set a 'user' hash with 'password' field, for example:: HSET mqtt_user: is_superuser 1 HSET mqtt_user: password "passwd" -Redis ACL Rule SET ------------------- +Redis ACL Rule Hash +------------------- -The plugin uses a redis SET to store ACL rules:: +The plugin uses a redis Hash to store ACL rules:: - SADD mqtt_acl: "publish topic1" - SADD mqtt_acl: "subscribe topic2" - SADD mqtt_acl: "pubsub topic3" + HSET mqtt_acl: topic1 1 + HSET mqtt_acl: topic2 2 + HSET mqtt_acl: topic3 3 -Redis Subscription HASH +.. NOTE:: 1: subscribe, 2: publish, 3: pubsub + +Redis Subscription Hash ----------------------- The plugin can store static subscriptions in a redis Hash:: @@ -495,14 +496,14 @@ etc/plugins/emqttd_plugin_mongo.conf: %% Variables: %u = username, %c = clientid %% Superuser Query - {superquery, pool, [ + {superquery, [ {collection, "mqtt_user"}, {super_field, "is_superuser"}, {selector, {"username", "%u"}} ]}. %% Authentication Query - {authquery, pool, [ + {authquery, [ {collection, "mqtt_user"}, {password_field, "password"}, %% Hash Algorithm: plain, md5, sha, sha256, pbkdf2? @@ -511,7 +512,7 @@ etc/plugins/emqttd_plugin_mongo.conf: ]}. %% ACL Query: "%u" = username, "%c" = clientid - {aclquery, pool, [ + {aclquery, [ {collection, "mqtt_acl"}, {selector, {"username", "%u"}} ]}.