+8
-2
| const mqtt = require('mqtt') | ||
| class Hub { | ||
| constructor(accountID, apiKey, options) { | ||
| constructor(accountID, apiKey, deviceID, options) { | ||
| this.accountID = accountID | ||
| this.apiKey = apiKey | ||
| this.deviceID = this._normalizeDeviceID(deviceID) | ||
| this.handlers = {} | ||
@@ -11,2 +12,6 @@ this.options = options || {} | ||
| _normalizeDeviceID(id) { | ||
| return `${this.accountID}:${id}` | ||
| } | ||
| _normalizeTopic(topic) { | ||
@@ -23,3 +28,4 @@ return `${this.accountID}/${topic}` | ||
| username: this.accountID, | ||
| password: this.apiKey | ||
| password: this.apiKey, | ||
| clientId: this.deviceID | ||
| }) | ||
@@ -26,0 +32,0 @@ this.client.on('connect', function () { |
+1
-1
| { | ||
| "name": "labstack", | ||
| "version": "0.32.0", | ||
| "version": "0.32.1", | ||
| "description": "Official Node.js client library for the LabStack platform", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+1
-1
@@ -5,3 +5,3 @@ const express = require('express') | ||
| const hub = new Hub('ie8t5fgcb6s2vaxgg02y', 'VouXFKK2A1TkuMUVz3wV2zvmapIdRuFM', { | ||
| const hub = new Hub('ie8t5fgcb6s2vaxgg02y', 'VouXFKK2A1TkuMUVz3wV2zvmapIdRuFM', 'node', { | ||
| messageHandler: function(topic, message) { | ||
@@ -8,0 +8,0 @@ console.log(topic, message) |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
55707
0.31%455
1.11%