[英]Why we have to pass clients array to modifyGroup command in dynamic security plugin?
In mosquitto docs, we have to pass both roles and clients whenever we are updating a group.在mosquitto文档中,每当我们更新组时,我们都必须传递角色和客户端。 When we pass it, the client belongs to group, but the client object is not updated and the group where it was attached is not listened on GetGroup command.
当我们传递它时,客户端属于组,但客户端 object 没有更新,并且它所在的组没有在 GetGroup 命令上侦听。
I thought there is a hierarchy of Mqtt Entities (Clients->Groups->Roles) and lower level entities cannot contain higher level entities, but groups somehow can.我认为存在 Mqtt 实体的层次结构(客户端->组->角色),较低级别的实体不能包含较高级别的实体,但组可以以某种方式包含。
Why we have to pass clients array to modifyGroup command?为什么我们必须将 clients 数组传递给 modifyGroup 命令?
Only the entries that are present in the modifyGroup
object are modified.仅修改
modifyGroup
object 中存在的条目。 So if you send:所以如果你发送:
{
"commands":[{
"command": "modifyGroup",
"groupname": "mygroup",
"clients": [ { "username": "client", "priority": 1 } ]
}]
}
Then mygroup
will be modified to have a single user client
.然后
mygroup
将被修改为具有单个用户client
。
If instead you send:相反,如果您发送:
{
"commands":[{
"command": "modifyGroup",
"groupname": "mygroup",
"clients": []
}]
}
Then mygroup
will be modified to have no clients.然后
mygroup
将被修改为没有客户端。
Finally, if you send:最后,如果您发送:
{
"commands":[{
"command": "modifyGroup",
"groupname": "mygroup",
"textdescription": "text"
}]
}
Then the group members will not be modified.那么群成员就不会被修改了。
If you don't have this behaviour, please update your question with examples of exactly what you are sending that produces an error.如果您没有这种行为,请使用示例更新您的问题,具体说明您发送的内容会产生错误。
Both roles
and clients
are marked as optional in the example for modifying a group在修改组的示例中,
roles
和clients
都标记为可选
Modify Group修改群组
Command:命令:
{
"commands":[
{
"command": "modifyGroup",
"groupname": "group to modify",
"textname": "", # Optional
"textdescription": "", # Optional
"roles": [
{ "rolename": "role", "priority": 1 }
], # Optional
"clients": [
{ "username": "client", "priority": 1 }
] # Optional
}
]
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.