From 78e79f327967f576d401ca53e00800ab32e2963b Mon Sep 17 00:00:00 2001 From: Ery Lee Date: Mon, 6 Apr 2015 14:22:27 +0800 Subject: [PATCH] default acl config --- rel/files/acl.config | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/rel/files/acl.config b/rel/files/acl.config index e408d1f68..f7ce98042 100644 --- a/rel/files/acl.config +++ b/rel/files/acl.config @@ -1,14 +1,24 @@ -{allow, {ipaddr, "127.0.0.1"}, subscribe, ["$SYS/#", "#"]}. +%%%----------------------------------------------------------------------------- +%% +%% [ACL Design](https://github.com/emqtt/emqttd/wiki/ACL-Design) +%% +%% -type who() :: all | binary() | +%% {ipaddr, esockd_access:cidr()} | +%% {client, binary()} | +%% {user, binary()}. +%% +%% -type access() :: subscribe | publish | pubsub. +%% +%% -type topic() :: binary(). +%% +%% -type rule() :: {allow, all} | +%% {allow, who(), access(), list(topic())} | +%% {deny, all} | +%% {deny, who(), access(), list(topic())}. +%% +%%%----------------------------------------------------------------------------- -{allow, {user, "testuser"}, subscribe, ["a/b/c", "d/e/f/#"]}. - -{allow, {user, "admin"}, pubsub, ["a/b/c", "d/e/f/#"]}. - -{allow, {client, "testClient"}, subscribe, ["testTopics/testClient"]}. - -{allow, all, subscribe, ["clients/$c"]}. - -{allow, all, subscribe, ["users/$u/#"]}. +{allow, {ipaddr, "127.0.0.1"}, pubsub, ["$SYS/#", "#"]}. {deny, all, subscribe, ["$SYS/#", "#"]}.