This is a NodeJS module for managing eclipse-mosquitto Dynamic Security plugin.
import {MosquittoDynsec} from "mosquitto-dynsec"
const dynsec = new MosquittoDynsec()
try {
await dynsec.connect({
hostname: "mqtt.example.com",
username: "foo",
password: "bar"
})
} catch(e) {
console.error("Connect error:", e)
}
const res = await dynsec.createClient({ username: "user1", password: "pass" })
The folowing commands specs were imeplmented using the source code of mosquitto_ctlr as reference. (dynsec.c)