简体   繁体   English

为什么我们必须将客户端数组传递给动态安全插件中的 modifyGroup 命令?

[英]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在修改组的示例中, rolesclients都标记为可选

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.

相关问题 Mosquitto 动态安全不允许插入客户端或角色 - Mosquitto dynamic security does not allow to insert clients or roles MQTT 动态安全插件 API 控制 - 使用发布/订阅命令的客户端/角色/组管理 - MQTT dynamic security plugin API control - client/role/group management using publish/subscribe commands 我们如何在Maven项目中使用gatling-mqtt插件进行负载测试 - how can we use gatling-mqtt plugin in a maven project for load testing 为什么我不能通过 HAProxy 将超过 8000 个客户端连接到 MQTT 代理? - Why cant I connect more than 8000 clients to MQTT brokers via HAProxy? 独立使用多个客户端MQTTAsync - Using multiple clients MQTTAsync independently 与 TCP/IP 相比,MQTT 有哪些优势? 既然MQTT是基于TCP的,为什么我们不用TCP/IP来代替呢? - What are advantages of MQTT over TCP/IP? Since MQTT is based on TCP, Why don't we use TCP/IP instead of it? 有多少客户使用MQTT订阅了主题 - How many clients subscribed to a topic using MQTT 可以在睡眠期间向 MQTT 客户端发布吗? - Is possible to publish to MQTT clients during their sleep? 获取连接到 Vernemq 代理的活跃客户端数量 - Get active number of clients connected to Vernemq broker mqtt 创建证书以在服务器上验证客户端 - mqtt create certificate to authentificate clients at the server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM