mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-10 07:05:28 +08:00
update ACLs
This commit is contained in:
parent
8a9f569c4f
commit
949438d5b5
1 changed files with 32 additions and 5 deletions
37
mq/emqx.go
37
mq/emqx.go
|
@ -291,6 +291,11 @@ func CreateHostACL(hostID, serverName string) error {
|
|||
Permission: "allow",
|
||||
Action: "all",
|
||||
},
|
||||
{
|
||||
Topic: fmt.Sprintf("host/serverupdate/%s", hostID),
|
||||
Permission: "allow",
|
||||
Action: "all",
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -333,11 +338,33 @@ func AppendNodeUpdateACL(hostID, nodeNetwork, nodeID string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
aclObject.Rules = append(aclObject.Rules, aclRule{
|
||||
Topic: fmt.Sprintf("node/update/%s/%s", nodeNetwork, nodeID),
|
||||
Permission: "allow",
|
||||
Action: "subscribe",
|
||||
})
|
||||
aclObject.Rules = append(aclObject.Rules, []aclRule{
|
||||
{
|
||||
Topic: fmt.Sprintf("node/update/%s/%s", nodeNetwork, nodeID),
|
||||
Permission: "allow",
|
||||
Action: "subscribe",
|
||||
},
|
||||
{
|
||||
Topic: fmt.Sprintf("ping/%s", nodeID),
|
||||
Permission: "allow",
|
||||
Action: "all",
|
||||
},
|
||||
{
|
||||
Topic: fmt.Sprintf("update/%s", nodeID),
|
||||
Permission: "allow",
|
||||
Action: "all",
|
||||
},
|
||||
{
|
||||
Topic: fmt.Sprintf("signal/%s", nodeID),
|
||||
Permission: "allow",
|
||||
Action: "all",
|
||||
},
|
||||
{
|
||||
Topic: fmt.Sprintf("metrics/%s", nodeID),
|
||||
Permission: "allow",
|
||||
Action: "all",
|
||||
},
|
||||
}...)
|
||||
payload, err := json.Marshal(aclObject)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Reference in a new issue