dgiot/etc/acl.conf

42 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2021-05-18 14:54:48 +08:00
%%--------------------------------------------------------------------
%% [ACL](https://docs.emqx.io/broker/v3/en/config.html)
%%
%% -type(who() :: all | binary() |
%% {ipaddr, esockd_access:cidr()} |
2021-08-16 15:07:42 +08:00
%% {ipaddrs, [esockd_access:cidr()]} |
2021-05-18 14:54:48 +08:00
%% {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, "dashboard"}, subscribe, ["$SYS/#"]}.
{allow, {ipaddr, "127.0.0.1"}, pubsub, ["$SYS/#", "#"]}.
{deny, all, subscribe, ["$SYS/#", {eq, "#"}]}.
2021-12-30 17:32:52 +08:00
{allow, {ipaddr, "127.0.0.1"}, pubsub, ["$dg/#", "#"]}.
2022-01-07 16:30:56 +08:00
{allow, all, pubsub, ["$dg/device/%c/#"]}.
2021-12-30 17:32:52 +08:00
2022-01-07 16:30:56 +08:00
{allow, all, pubsub, ["$dg/thing/%c/#"]}.
2021-12-30 17:32:52 +08:00
2022-01-07 16:30:56 +08:00
{allow, all, pubsub, ["$dg/device/%u/#"]}.
{allow, all, pubsub, ["$dg/thing/%u/#"]}.
{deny, all, subscribe, ["$dg/device/#"]}.
{deny, all, subscribe, ["$dg/thing/#"]}.
2021-12-30 17:32:52 +08:00
2021-05-18 14:54:48 +08:00
{allow, all}.