Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions emqx/acl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
%% Allow uplink username to publish to FL mesh topics except FL/LWS mesh topics, but not subscribe to any topics.
{deny, {username, "uplink"}, all, ["msh/US/FL/LWS/#"]}.
{allow, {username, "uplink"}, publish, ["msh/US/FL/#"]}.
%% Allow lonewolf username to publish+subscribe to FL/LWS mesh topics, but not subscribe to any topics.
{allow, {username, "lonewolf"}, all, ["msh/US/FL/LWS/#"]}.
%% Allow lonewolf username to publish+subscribe to FL mesh topics.
{allow, {username, "lonewolf"}, all, ["msh/US/FL/#"]}.


%% Group users with identical permissions
Expand Down
67 changes: 16 additions & 51 deletions mongodb/mqtt_init.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ function ensureProfile(profileDoc) {

function ensureDefaultProfiles() {
/*
{
deny,
{username, "${username}"},
all,
["msh/US/FL/LWS/#"]
}.
{
allow,
{username, "${username}"},
Expand All @@ -117,25 +111,10 @@ function ensureDefaultProfiles() {
*/
ensureProfile({
name: "default",
description: "Default Florida Mesh access. Deny Lone Wolf subtree and allow the broader Florida subtree.",
description: "Default Florida Mesh access.",
status: "active",
is_default: true,
rules: [
{
permission: "deny",
who: {
username: "${username}"
},
action: {
type: "all"
},
topics: [
{
match: "filter",
value: "msh/US/FL/LWS/#"
}
]
},
{
permission: "allow",
who: {
Expand Down Expand Up @@ -190,18 +169,19 @@ function ensureDefaultProfiles() {
{
allow,
{username, "${username}"},
all, ["msh/US/FL/LWS/#"]
publish,
["msh/US/FL/#"]
}.
{
allow,
{username, "${username}"},
publish,
["$SYS/broker/connection/${clientid}/state"]
["$SYS/broker/connection/${clientid}/#"]
}.
*/
ensureProfile({
name: "bridge",
description: "Florida Mesh Bridge profile. Allow PUBLISH to Florida subtree and $SYS/broker/connection/ topics.",
description: "Florida Mesh Bridge profile. Allow PUBLISH to Florida subtree and $SYS broker connection topics.",
status: "active",
is_default: false,
rules: [
Expand All @@ -226,12 +206,12 @@ function ensureDefaultProfiles() {
username: "${username}"
},
action: {
type: "publish"
type: "all"
},
topics: [
{
match: "filter",
value: "$SYS/broker/connection/${clientid}/state"
value: "$SYS/broker/connection/${clientid}/#"
}
]
}
Expand All @@ -249,12 +229,12 @@ function ensureDefaultProfiles() {
allow,
{username, "${username}"},
publish,
["$SYS/broker/connection/${clientid}/state"]
["$SYS/broker/connection/${clientid}/#"]
}.
*/
ensureProfile({
name: "fullbridge",
description: "Florida Mesh Full Bridge profile. Allow PUB/SUB to Florida subtree and $SYS/broker/connection/ topics.",
description: "Florida Mesh Full Bridge profile. Allow PUB/SUB to Florida subtree and $SYS broker connection topics.",
status: "active",
is_default: false,
rules: [
Expand All @@ -279,25 +259,25 @@ function ensureDefaultProfiles() {
username: "${username}"
},
action: {
type: "publish"
type: "all"
},
topics: [
{
match: "filter",
value: "$SYS/broker/connection/${clientid}/state"
value: "$SYS/broker/connection/${clientid}/#"
}
]
}
]
})

/*
{
deny,
{username, "${username}"}, all, ["msh/US/FL/LWS/#"]}.
{
allow,
{username, "${username}"}, all, ["msh/US/FL/#"]}.
{username, "${username}"},
all,
["msh/US/FL/#"]
}.
{
allow,
{
Expand All @@ -313,25 +293,10 @@ function ensureDefaultProfiles() {
*/
ensureProfile({
name: "meshpoint",
description: "Meshpoint access. Deny Lone Wolf subtree and allow the broader Florida subtree and homeassistant topics.",
description: "Meshpoint access. Allow the broader Florida subtree and homeassistant topics.",
status: "active",
is_default: false,
rules: [
{
permission: "deny",
who: {
username: "${username}"
},
action: {
type: "all"
},
topics: [
{
match: "filter",
value: "msh/US/FL/LWS/#"
}
]
},
{
permission: "allow",
who: {
Expand Down
Loading