754 lines
24 KiB
JSON
754 lines
24 KiB
JSON
[
|
|
{
|
|
"id": "9fbdd3f57deafc08",
|
|
"type": "tab",
|
|
"label": "User Management ASE Mosquitto",
|
|
"disabled": false,
|
|
"info": "",
|
|
"env": []
|
|
},
|
|
{
|
|
"id": "9d08dcc1d6da93f4",
|
|
"type": "ui_form",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "New user",
|
|
"label": "",
|
|
"group": "69ae86190d4eadd7",
|
|
"order": 2,
|
|
"width": 0,
|
|
"height": 0,
|
|
"options": [
|
|
{
|
|
"label": "Username",
|
|
"value": "Username",
|
|
"type": "text",
|
|
"required": true,
|
|
"rows": null
|
|
},
|
|
{
|
|
"label": "Password",
|
|
"value": "Password",
|
|
"type": "password",
|
|
"required": true,
|
|
"rows": null
|
|
},
|
|
{
|
|
"label": "ClientID",
|
|
"value": "ClientID",
|
|
"type": "text",
|
|
"required": false,
|
|
"rows": null
|
|
},
|
|
{
|
|
"label": "Description title",
|
|
"value": "Textname",
|
|
"type": "text",
|
|
"required": false,
|
|
"rows": null
|
|
},
|
|
{
|
|
"label": "Description",
|
|
"value": "Textdescription",
|
|
"type": "text",
|
|
"required": false,
|
|
"rows": null
|
|
}
|
|
],
|
|
"formValue": {
|
|
"Username": "",
|
|
"Password": "",
|
|
"ClientID": "",
|
|
"Textname": "",
|
|
"Textdescription": ""
|
|
},
|
|
"payload": "",
|
|
"submit": "submit",
|
|
"cancel": "cancel",
|
|
"topic": "",
|
|
"topicType": "str",
|
|
"splitLayout": "",
|
|
"className": "",
|
|
"x": 84,
|
|
"y": 240,
|
|
"wires": [
|
|
[
|
|
"3711eb142a27fd31",
|
|
"49e737145eab4f54",
|
|
"ca48c155d446edb2"
|
|
]
|
|
],
|
|
"inputLabels": [
|
|
"aa"
|
|
],
|
|
"outputLabels": [
|
|
"aa"
|
|
]
|
|
},
|
|
{
|
|
"id": "88376950bf613f47",
|
|
"type": "function",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Format new user payload ",
|
|
"func": "var msg = {\n payload: {\n commands: [\n {\n \"command\": \"createClient\",\n \"username\": msg.payload.Username,\n \"password\": msg.payload.Password,\n \"clientid\": msg.payload.ClientID,\n\t\t\t \"textname\": msg.payload.Textname, \n \"textdescription\": msg.payload.Textdescription,\n\t\t\t \"groups\": [\n\t\t\t ],\n\t\t\t \"roles\": [\n\t\t\t\t { \"rolename\": msg.payload.Username.concat(\"_role\"), \"priority\": 0 }\n\t\t\t ]\n }\n ]\n }\n};\nreturn msg;",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 646,
|
|
"y": 320,
|
|
"wires": [
|
|
[
|
|
"2aecbce52ca97912"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "2aecbce52ca97912",
|
|
"type": "mqtt out",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Dynamic security control",
|
|
"topic": "$CONTROL/dynamic-security/v1",
|
|
"qos": "2",
|
|
"retain": "false",
|
|
"respTopic": "",
|
|
"contentType": "",
|
|
"userProps": "",
|
|
"correl": "",
|
|
"expiry": "",
|
|
"broker": "6c0c13a328d2378c",
|
|
"x": 1210,
|
|
"y": 480,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "255fcd63d3387488",
|
|
"type": "catch",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Catch error",
|
|
"scope": null,
|
|
"uncaught": false,
|
|
"x": 84,
|
|
"y": 160,
|
|
"wires": [
|
|
[
|
|
"8669f263b392e9db"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "30603217455d8705",
|
|
"type": "ui_toast",
|
|
"z": "9fbdd3f57deafc08",
|
|
"position": "dialog",
|
|
"displayTime": "5",
|
|
"highlight": "",
|
|
"sendall": false,
|
|
"outputs": 1,
|
|
"ok": "OK",
|
|
"cancel": "",
|
|
"raw": false,
|
|
"className": "msg.error.message",
|
|
"topic": "",
|
|
"name": "Error Notification",
|
|
"x": 626,
|
|
"y": 160,
|
|
"wires": [
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "8669f263b392e9db",
|
|
"type": "change",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Set payload as error message",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "error.message",
|
|
"tot": "msg",
|
|
"dc": true
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 346,
|
|
"y": 160,
|
|
"wires": [
|
|
[
|
|
"30603217455d8705"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "79338504ed1eddba",
|
|
"type": "mqtt in",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Response",
|
|
"topic": "$CONTROL/dynamic-security/v1/response",
|
|
"qos": "2",
|
|
"datatype": "auto-detect",
|
|
"broker": "6c0c13a328d2378c",
|
|
"nl": false,
|
|
"rap": true,
|
|
"rh": 0,
|
|
"inputs": 0,
|
|
"x": 84,
|
|
"y": 744,
|
|
"wires": [
|
|
[
|
|
"4f1d82b81f042382",
|
|
"a5fdabb1abae1a6e",
|
|
"f070ff4b26975684"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "377b761521508bb9",
|
|
"type": "ui_button",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Refresh users list",
|
|
"group": "ab99b1708f72e425",
|
|
"order": 1,
|
|
"width": 0,
|
|
"height": 0,
|
|
"passthru": true,
|
|
"label": "Refresh users list",
|
|
"tooltip": "",
|
|
"color": "",
|
|
"bgcolor": "",
|
|
"className": "",
|
|
"icon": "mi-refresh",
|
|
"payload": "{\"commands\":[{\"command\":\"listClients\"}]}",
|
|
"payloadType": "json",
|
|
"topic": "$CONTROL/dynamic-security/v1",
|
|
"topicType": "msg",
|
|
"x": 626,
|
|
"y": 648,
|
|
"wires": [
|
|
[
|
|
"2aecbce52ca97912",
|
|
"7aac58500a269ff4"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "4f1d82b81f042382",
|
|
"type": "function",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Extract users list & fill dropdown ui",
|
|
"func": "let response_of = msg.payload.responses[0].command;\nif (response_of == \"listClients\") {\n var users = msg.payload.responses[0].data.clients; \n const index = users.indexOf(\"admin\");\n if (index > -1) {\n users.splice(index, 1); \n }\n msg.options = users;\n return msg;\n}\nreturn null;",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 356,
|
|
"y": 704,
|
|
"wires": [
|
|
[
|
|
"06393fdc9c737c57"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "06393fdc9c737c57",
|
|
"type": "ui_dropdown",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "",
|
|
"label": "Existing users dropdown ui",
|
|
"tooltip": "",
|
|
"place": "Select user",
|
|
"group": "ab99b1708f72e425",
|
|
"order": 2,
|
|
"width": 0,
|
|
"height": 0,
|
|
"passthru": true,
|
|
"multiple": false,
|
|
"options": [],
|
|
"payload": "",
|
|
"topic": "options",
|
|
"topicType": "msg",
|
|
"className": "",
|
|
"x": 336,
|
|
"y": 784,
|
|
"wires": [
|
|
[
|
|
"1d4c2df0e173d2e3",
|
|
"8bef671fa22d9d07"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "9c1c4f045dee7138",
|
|
"type": "ui_button",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Delete user",
|
|
"group": "ab99b1708f72e425",
|
|
"order": 6,
|
|
"width": 0,
|
|
"height": 0,
|
|
"passthru": false,
|
|
"label": "Delete selected user",
|
|
"tooltip": "",
|
|
"color": "",
|
|
"bgcolor": "#FF6666",
|
|
"className": "",
|
|
"icon": "mi-delete",
|
|
"payload": "user",
|
|
"payloadType": "flow",
|
|
"topic": "topic",
|
|
"topicType": "msg",
|
|
"x": 94,
|
|
"y": 536,
|
|
"wires": [
|
|
[
|
|
"545442acdd0b1a0d",
|
|
"4798c117a3d42c70"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "1d4c2df0e173d2e3",
|
|
"type": "function",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Set flow.user var",
|
|
"func": "flow.set(\"user\", msg.payload);\nreturn;",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 626,
|
|
"y": 808,
|
|
"wires": [
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "d82c6b29558cbc01",
|
|
"type": "function",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Format delete role payload",
|
|
"func": "let user = flow.get(\"user\");\nvar msg = {\n payload: {\n commands: [\n {\n \"command\": \"deleteRole\",\n\t\t\t\t\"rolename\": user.concat(\"_role\")\n\t\t\t}\n\t\t]\n\t}\n}\nreturn msg;",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 656,
|
|
"y": 592,
|
|
"wires": [
|
|
[
|
|
"2aecbce52ca97912"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "3711eb142a27fd31",
|
|
"type": "function",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Format new role payload ",
|
|
"func": "var msg = {\n payload: {\n commands: [\n {\n \"command\": \"createRole\",\n \"rolename\": msg.payload.Username.concat(\"_role\"),\n \"textname\": \"\", \n\t\t\t \"textdescription\": \"\", \n\t\t\t \"acls\": [\n { \"acltype\": \"publishClientSend\", \"topic\": msg.payload.Username.concat(\"/#\"), \"priority\": 0, \"allow\": true }\n ]\n }\n ]\n }\n};\nreturn msg;",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 646,
|
|
"y": 216,
|
|
"wires": [
|
|
[
|
|
"2aecbce52ca97912"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "49e737145eab4f54",
|
|
"type": "delay",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Delay user def. after group",
|
|
"pauseType": "delay",
|
|
"timeout": "500",
|
|
"timeoutUnits": "milliseconds",
|
|
"rate": "1",
|
|
"nbRateUnits": "1",
|
|
"rateUnits": "second",
|
|
"randomFirst": "1",
|
|
"randomLast": "5",
|
|
"randomUnits": "seconds",
|
|
"drop": false,
|
|
"allowrate": false,
|
|
"outputs": 1,
|
|
"x": 336,
|
|
"y": 344,
|
|
"wires": [
|
|
[
|
|
"88376950bf613f47",
|
|
"94124ffc77e8335d"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "4798c117a3d42c70",
|
|
"type": "function",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Format delete user payload",
|
|
"func": "let user = flow.get(\"user\");\nvar msg = {\n payload: {\n commands: [\n {\n \"command\": \"deleteClient\",\n\t\t\t\t\"username\": user\n\t\t\t}\n\t\t]\n\t}\n}\nreturn msg;",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 656,
|
|
"y": 536,
|
|
"wires": [
|
|
[
|
|
"2aecbce52ca97912"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "545442acdd0b1a0d",
|
|
"type": "delay",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Delay role dele. after user",
|
|
"pauseType": "delay",
|
|
"timeout": "500",
|
|
"timeoutUnits": "milliseconds",
|
|
"rate": "1",
|
|
"nbRateUnits": "1",
|
|
"rateUnits": "second",
|
|
"randomFirst": "1",
|
|
"randomLast": "5",
|
|
"randomUnits": "seconds",
|
|
"drop": false,
|
|
"allowrate": false,
|
|
"outputs": 1,
|
|
"x": 326,
|
|
"y": 592,
|
|
"wires": [
|
|
[
|
|
"d82c6b29558cbc01"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "8d3eb0f225aaba0e",
|
|
"type": "ui_button",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Disable user",
|
|
"group": "ab99b1708f72e425",
|
|
"order": 5,
|
|
"width": 0,
|
|
"height": 0,
|
|
"passthru": false,
|
|
"label": "Disable selected user",
|
|
"tooltip": "",
|
|
"color": "",
|
|
"bgcolor": "",
|
|
"className": "",
|
|
"icon": "mi-person_off",
|
|
"payload": "user",
|
|
"payloadType": "flow",
|
|
"topic": "topic",
|
|
"topicType": "msg",
|
|
"x": 94,
|
|
"y": 424,
|
|
"wires": [
|
|
[
|
|
"b97f2e66e9ea4702"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "b97f2e66e9ea4702",
|
|
"type": "function",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Format disable user payload",
|
|
"func": "let user = flow.get(\"user\");\nvar msg = {\n payload: {\n commands: [\n {\n \"command\": \"disableClient\",\n\t\t\t\t\"username\": user\n\t\t\t}\n\t\t]\n\t}\n}\nreturn msg;",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 656,
|
|
"y": 424,
|
|
"wires": [
|
|
[
|
|
"2aecbce52ca97912"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "2272690dede6a475",
|
|
"type": "ui_button",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Enable user",
|
|
"group": "ab99b1708f72e425",
|
|
"order": 4,
|
|
"width": 0,
|
|
"height": 0,
|
|
"passthru": false,
|
|
"label": "Enable selected user",
|
|
"tooltip": "",
|
|
"color": "",
|
|
"bgcolor": "",
|
|
"className": "",
|
|
"icon": "mi-person",
|
|
"payload": "user",
|
|
"payloadType": "flow",
|
|
"topic": "topic",
|
|
"topicType": "msg",
|
|
"x": 94,
|
|
"y": 480,
|
|
"wires": [
|
|
[
|
|
"1b7e77253c8b385d"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "1b7e77253c8b385d",
|
|
"type": "function",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Format enable user payload",
|
|
"func": "let user = flow.get(\"user\");\nvar msg = {\n payload: {\n commands: [\n {\n \"command\": \"enableClient\",\n\t\t\t\t\"username\": user\n\t\t\t}\n\t\t]\n\t}\n}\nreturn msg;",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 656,
|
|
"y": 480,
|
|
"wires": [
|
|
[
|
|
"2aecbce52ca97912"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "8bef671fa22d9d07",
|
|
"type": "function",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Format get client info",
|
|
"func": "let user = msg.payload;\nvar msg = {\n payload: {\n commands: [\n {\n \"command\": \"getClient\",\n\t\t\t\t\"username\": user\n\t\t\t}\n\t\t]\n\t}\n}\nreturn msg;",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 636,
|
|
"y": 760,
|
|
"wires": [
|
|
[
|
|
"2aecbce52ca97912"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f070ff4b26975684",
|
|
"type": "function",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Extract users info & fill text field",
|
|
"func": "let response_of = msg.payload.responses[0].command;\nif (response_of == \"getClient\") {\n let user = msg.payload.responses[0].data.client.username; \n let disabled = msg.payload.responses[0].data.client.disabled; \n let role = msg.payload.responses[0].data.client.roles[0].rolename; \n msg = {\n payload: {\n \"username\": user,\n \"disabled\": disabled,\n \"role\": role\n }\n }\n return msg;\n}\nreturn null;",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 346,
|
|
"y": 864,
|
|
"wires": [
|
|
[
|
|
"934816df4e8f7fe2"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "a5fdabb1abae1a6e",
|
|
"type": "function",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Check command",
|
|
"func": "\nlet response_of = msg.payload.responses[0].command;\nif ((response_of == \"createClient\") || (response_of == \"deleteClient\") || (response_of == \"enableClient\") || (response_of == \"disableClient\")) {\n return msg;\n}\n\nreturn null;",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 306,
|
|
"y": 648,
|
|
"wires": [
|
|
[
|
|
"377b761521508bb9"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "7aac58500a269ff4",
|
|
"type": "function",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Clean client info",
|
|
"func": "msg = {\n payload: {\n \"username\": \"\",\n \"disabled\": \"\",\n \"role\": \"\"\n }\n}\nreturn msg;\n",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 888,
|
|
"y": 808,
|
|
"wires": [
|
|
[
|
|
"934816df4e8f7fe2"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "934816df4e8f7fe2",
|
|
"type": "ui_template",
|
|
"z": "9fbdd3f57deafc08",
|
|
"group": "ab99b1708f72e425",
|
|
"name": "User Info",
|
|
"order": 3,
|
|
"width": 0,
|
|
"height": 0,
|
|
"format": "<div style=\"display: flex; align-items: center; margin-bottom: 10px;\">\n <label for=\"{{'user_'+$id}}\" style=\"margin-right: 10px;\">Username:</label>\n <div id=\"{{'user_'+$id}}\" style=\"{{'color:'+theme.base_color}}\"></div>\n</div>\n\n<div style=\"display: flex; align-items: center; margin-bottom: 10px;\">\n <label for=\"{{'dis_'+$id}}\" style=\"margin-right: 10px;\">Status:</label>\n <div id=\"{{'dis_'+$id}}\" style=\"{{'color:'+theme.base_color}}\"></div>\n</div>\n\n<div style=\"display: flex; align-items: center; margin-bottom: 10px;\">\n <label for=\"{{'role_'+$id}}\" style=\"margin-right: 10px;\">Role:</label>\n <div id=\"{{'role_'+$id}}\" style=\"{{'color:'+theme.base_color}}\"></div>\n</div>\n\n<script>\n (function(scope) {\n scope.$watch('msg', function(msg) {\n if (msg) {\n const disabledValue = msg.payload.username.trim() === ''\n ? ''\n : (msg.payload.disabled === true ? 'Disabled' : 'Enabled');\n $(\"#user_\" + scope.$id).html(msg.payload.username);\n $(\"#dis_\" + scope.$id).html(disabledValue);\n $(\"#role_\" + scope.$id).html(msg.payload.role);\n }\n });\n })(scope);\n</script>",
|
|
"storeOutMessages": false,
|
|
"fwdInMessages": true,
|
|
"resendOnRefresh": false,
|
|
"templateScope": "local",
|
|
"className": "",
|
|
"x": 868,
|
|
"y": 864,
|
|
"wires": [
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "ca48c155d446edb2",
|
|
"type": "function",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Format new ase role payload ",
|
|
"func": "var msg = {\n payload: {\n commands: [\n {\n \"command\": \"createRole\",\n \"rolename\": msg.payload.Username.concat(\"_ase_role\"),\n \"textname\": \"\", \n\t\t\t \"textdescription\": \"\", \n\t\t\t \"acls\": [\n { \"acltype\": \"publishClientSend\", \"topic\": msg.payload.Username.concat(\"/#\"), \"priority\": 0, \"allow\": true },\n { \"acltype\": \"publishClientReceive\", \"topic\": msg.payload.Username.concat(\"/#\"), \"priority\": 0, \"allow\": true },\n { \"acltype\": \"subscribeLiteral\", \"topic\": msg.payload.Username.concat(\"/#\"), \"priority\": 0, \"allow\": true },\n { \"acltype\": \"subscribePattern\", \"topic\": msg.payload.Username.concat(\"/#\"), \"priority\": 0, \"allow\": true },\n { \"acltype\": \"unsubscribeLiteral\", \"topic\": msg.payload.Username.concat(\"/#\"), \"priority\": 0, \"allow\": true },\n { \"acltype\": \"unsubscribePattern\", \"topic\": msg.payload.Username.concat(\"/#\"), \"priority\": 0, \"allow\": true }\n ]\n }\n ]\n }\n};\nreturn msg;",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 656,
|
|
"y": 264,
|
|
"wires": [
|
|
[
|
|
"2aecbce52ca97912"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "94124ffc77e8335d",
|
|
"type": "function",
|
|
"z": "9fbdd3f57deafc08",
|
|
"name": "Format new ase user payload ",
|
|
"func": "var msg = {\n payload: {\n commands: [\n {\n \"command\": \"createClient\",\n \"username\": msg.payload.Username.concat(\"_ase\"),\n \"password\": msg.payload.Password.concat(\"AsE\"),\n \"clientid\": msg.payload.ClientID.concat(\"_ase\"),\n \"textname\": msg.payload.Textname.concat(\" ASE subscriber\"), \n \"textdescription\": msg.payload.Textdescription.concat(\" ASE subscriber\"),\n\t\t\t \"groups\": [\n\t\t\t ],\n\t\t\t \"roles\": [\n\t\t\t\t { \"rolename\": msg.payload.Username.concat(\"_ase_role\"), \"priority\": 0 }\n\t\t\t ]\n }\n ]\n }\n};\nreturn msg;",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 666,
|
|
"y": 368,
|
|
"wires": [
|
|
[
|
|
"2aecbce52ca97912"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "69ae86190d4eadd7",
|
|
"type": "ui_group",
|
|
"name": "Define new user",
|
|
"tab": "f47c763c366069c9",
|
|
"order": 1,
|
|
"disp": true,
|
|
"width": 8,
|
|
"collapse": false,
|
|
"className": ""
|
|
},
|
|
{
|
|
"id": "6c0c13a328d2378c",
|
|
"type": "mqtt-broker",
|
|
"name": "mosquitto-ase",
|
|
"broker": "209.227.230.114",
|
|
"port": "1883",
|
|
"clientid": "nodered",
|
|
"autoConnect": true,
|
|
"usetls": false,
|
|
"protocolVersion": "5",
|
|
"keepalive": "60",
|
|
"cleansession": false,
|
|
"autoUnsubscribe": true,
|
|
"birthTopic": "",
|
|
"birthQos": "0",
|
|
"birthRetain": "false",
|
|
"birthPayload": "",
|
|
"birthMsg": {},
|
|
"closeTopic": "",
|
|
"closeQos": "0",
|
|
"closeRetain": "false",
|
|
"closePayload": "",
|
|
"closeMsg": {},
|
|
"willTopic": "",
|
|
"willQos": "0",
|
|
"willRetain": "false",
|
|
"willPayload": "",
|
|
"willMsg": {},
|
|
"userProps": "",
|
|
"sessionExpiry": ""
|
|
},
|
|
{
|
|
"id": "ab99b1708f72e425",
|
|
"type": "ui_group",
|
|
"name": "Manage existing users",
|
|
"tab": "204076c20d6cbcab",
|
|
"order": 2,
|
|
"disp": true,
|
|
"width": "8",
|
|
"collapse": false,
|
|
"className": ""
|
|
},
|
|
{
|
|
"id": "f47c763c366069c9",
|
|
"type": "ui_tab",
|
|
"name": "Define new user",
|
|
"icon": "fa-user",
|
|
"disabled": false,
|
|
"hidden": false
|
|
},
|
|
{
|
|
"id": "204076c20d6cbcab",
|
|
"type": "ui_tab",
|
|
"name": "Manage existing users",
|
|
"icon": "fa-users",
|
|
"order": 2,
|
|
"disabled": false,
|
|
"hidden": false
|
|
}
|
|
] |