mirror of
https://gitee.com/dgiiot/dgiot.git
synced 2024-11-29 18:57:41 +08:00
42 lines
1.2 KiB
Plaintext
42 lines
1.2 KiB
Plaintext
%%--------------------------------------------------------------------
|
|
%% [ACL](https://docs.emqx.io/broker/v3/en/config.html)
|
|
%%
|
|
%% -type(who() :: all | binary() |
|
|
%% {ipaddr, esockd_access:cidr()} |
|
|
%% {ipaddrs, [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, "dashboard"}, subscribe, ["$SYS/#"]}.
|
|
|
|
{allow, {ipaddr, "127.0.0.1"}, pubsub, ["$SYS/#", "#"]}.
|
|
|
|
{deny, all, subscribe, ["$SYS/#", {eq, "#"}]}.
|
|
|
|
{allow, {ipaddr, "127.0.0.1"}, pubsub, ["$dg/#", "#"]}.
|
|
|
|
{allow, all, pubsub, ["$dg/device/%c/#"]}.
|
|
|
|
{allow, all, pubsub, ["$dg/thing/%c/#"]}.
|
|
|
|
{allow, all, pubsub, ["$dg/device/%u/#"]}.
|
|
|
|
{allow, all, pubsub, ["$dg/thing/%u/#"]}.
|
|
|
|
{deny, all, subscribe, ["$dg/device/#"]}.
|
|
|
|
{deny, all, subscribe, ["$dg/thing/#"]}.
|
|
|
|
{allow, all}.
|
|
|