mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-12-26 23:16:47 +01:00
Bump snmp lib and add extra SHAtypes
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-snmp",
|
"name" : "node-red-node-snmp",
|
||||||
"version" : "2.0.1",
|
"version" : "2.1.0",
|
||||||
"description" : "A Node-RED node that gets and sets SNMP oid values. Supports v1, v2c and v3",
|
"description" : "A Node-RED node that gets and sets SNMP oid values. Supports v1, v2c and v3",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"net-snmp" : "^3.9.0"
|
"net-snmp" : "^3.26.0"
|
||||||
},
|
},
|
||||||
"repository" : {
|
"repository" : {
|
||||||
"type":"git",
|
"type":"git",
|
||||||
|
|||||||
@@ -93,6 +93,10 @@
|
|||||||
<select type="text" id="node-input-authprot" style="width:150px;">
|
<select type="text" id="node-input-authprot" style="width:150px;">
|
||||||
<option value="MD5">MD5</option>
|
<option value="MD5">MD5</option>
|
||||||
<option value="SHA">SHA</option>
|
<option value="SHA">SHA</option>
|
||||||
|
<option value="SHA224">SHA224</option>
|
||||||
|
<option value="SHA256">SHA256</option>
|
||||||
|
<option value="SHA384">SHA384</option>
|
||||||
|
<option value="SHA512">SHA512</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row form-row-snmpv3 form-row-snmpv3-auth">
|
<div class="form-row form-row-snmpv3 form-row-snmpv3-auth">
|
||||||
|
|||||||
@@ -77,14 +77,34 @@ module.exports = function (RED) {
|
|||||||
} else if (node.version === "3") {
|
} else if (node.version === "3") {
|
||||||
user.name = node.username || msg.username || "";
|
user.name = node.username || msg.username || "";
|
||||||
user.level = SNMP.SecurityLevel.noAuthNoPriv;
|
user.level = SNMP.SecurityLevel.noAuthNoPriv;
|
||||||
user.authProtocol = SNMP.AuthProtocols.none;
|
switch (node.authprot) {
|
||||||
|
case "MD5":
|
||||||
|
user.authProtocol = SNMP.AuthProtocols.md5;
|
||||||
|
break;
|
||||||
|
case "SHA":
|
||||||
|
user.authProtocol = SNMP.AuthProtocols.sha;
|
||||||
|
break;
|
||||||
|
case "SHA224":
|
||||||
|
user.authProtocol = SNMP.AuthProtocols.sha224;
|
||||||
|
break;
|
||||||
|
case "SHA256":
|
||||||
|
user.authProtocol = SNMP.AuthProtocols.sha256;
|
||||||
|
break;
|
||||||
|
case "SHA384":
|
||||||
|
user.authProtocol = SNMP.AuthProtocols.sha384;
|
||||||
|
break;
|
||||||
|
case "SHA512":
|
||||||
|
user.authProtocol = SNMP.AuthProtocols.sha512;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
user.authProtocol = SNMP.AuthProtocols.none;
|
||||||
|
}
|
||||||
user.authKey = "";
|
user.authKey = "";
|
||||||
user.privProtocol = SNMP.PrivProtocols.none;
|
user.privProtocol = SNMP.PrivProtocols.none;
|
||||||
user.privKey = "";
|
user.privKey = "";
|
||||||
options.version = SNMP.Version3;
|
options.version = SNMP.Version3;
|
||||||
if (node.auth === "authNoPriv" || node.auth === "authPriv") {
|
if (node.auth === "authNoPriv" || node.auth === "authPriv") {
|
||||||
user.level = SNMP.SecurityLevel.authNoPriv;
|
user.level = SNMP.SecurityLevel.authNoPriv;
|
||||||
user.authProtocol = (node.authprot === "SHA") ? SNMP.AuthProtocols.sha : SNMP.AuthProtocols.md5;
|
|
||||||
user.authKey = node.authkey || msg.authkey || "";
|
user.authKey = node.authkey || msg.authkey || "";
|
||||||
if (node.auth === "authPriv") {
|
if (node.auth === "authPriv") {
|
||||||
user.level = SNMP.SecurityLevel.authPriv;
|
user.level = SNMP.SecurityLevel.authPriv;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-node-markdown",
|
"name": "node-red-node-markdown",
|
||||||
"version": "0.5.1",
|
"version": "0.6.0",
|
||||||
"description": "A Node-RED node to convert a markdown string to html.",
|
"description": "A Node-RED node to convert a markdown string to html.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"markdown-it": "^14.1.0"
|
"markdown-it": "^14.1.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user