Installations
npm install aedes-protocol-decoder
Developer
moscajs
Developer Guide
Module System
CommonJS
Min. Node Version
>=10
Typescript Support
Yes
Node Version
18.13.0
NPM Version
8.19.3
Statistics
3 Stars
20 Commits
3 Forks
8 Watching
2 Branches
3 Contributors
Updated on 20 Sept 2023
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
341,243
Last day
22.8%
528
Compared to previous day
Last week
11.2%
2,657
Compared to previous week
Last month
-13.4%
11,069
Compared to previous month
Last year
9.6%
83,029
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
aedes-protocol-decoder
Protocol decoder for Aedes MQTT Broker
The purpose of this module is to be used inside aedes-server-factory bindConnection
function, which is called when the server receives a connection from client (before CONNECT packet). The client object state is in default and its connected state is false.
The function extract socket details and if aedes-server-factory
trustProxy
option is set to true, it will first parse http headers (x-real-ip | x-forwarded-for) and/or proxy protocol (v1 and v2), then passing the informations to aedes
that will assign them to client.connDetails
.
Additionally, if the current socket is a TLS socket, the module will extract the authorization status and the full certificate chain.
The function protocolDecoder
and extractSocketDetails
returns ConnectionDetails, if the object contains data
property, it will be parsed as an mqtt-packet.
Install
1npm install aedes-protocol-decoder --save
Example
1var aedes = require('aedes') 2var { protocolDecoder } = require('aedes-protocol-decoder') 3var { createServer } = require('aedes-server-factory') 4var port = 1883 5 6var broker = aedes({ 7 preConnect: function (client, packet, done) { 8 if (client.connDetails && client.connDetails.ipAddress) { 9 client.ip = client.connDetails.ipAddress 10 } 11 return done(null, true) 12 }, 13}) 14 15var server = createServer(broker, { trustProxy: true, protocolDecoder }) 16server.listen(port, function () { 17 console.log('server listening on port', port) 18})
License
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 7/13 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/moscajs/aedes-protocol-decoder/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/moscajs/aedes-protocol-decoder/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/moscajs/aedes-protocol-decoder/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/moscajs/aedes-protocol-decoder/ci.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:27
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 14 are checked with a SAST tool
Score
3.9
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More