Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

libp2p-pubsub

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libp2p-pubsub - npm Package Compare versions

Comparing version 0.5.4 to 0.5.5

5

CHANGELOG.md

@@ -0,1 +1,6 @@

<a name="0.5.5"></a>
## [0.5.5](https://github.com/libp2p/js-libp2p-pubsub/compare/v0.5.4...v0.5.5) (2020-07-14)
<a name="0.5.4"></a>

@@ -2,0 +7,0 @@ ## [0.5.4](https://github.com/libp2p/js-libp2p-pubsub/compare/v0.5.3...v0.5.4) (2020-07-07)

4

package.json
{
"name": "libp2p-pubsub",
"version": "0.5.4",
"version": "0.5.5",
"description": "Pubsub base protocol for libp2p pubsub routers",

@@ -70,4 +70,4 @@ "leadMaintainer": "Vasco Santos <santos.vasco10@gmail.com>",

"Mikerah <mikerahqc@protonmail.com>",
"Cayman <caymannava@gmail.com>",
"Topper Bowers <topper@toppingdesign.com>",
"Cayman <caymannava@gmail.com>",
"Hugo Dias <hugomrdias@gmail.com>",

@@ -74,0 +74,0 @@ "Alex Potsides <alex@achingbrain.net>",

@@ -18,2 +18,12 @@ 'use strict'

/**
* @typedef {Object} InMessage
* @property {string} from
* @property {string} receivedFrom
* @property {string[]} topicIDs
* @property {Buffer} data
* @property {Buffer} [signature]
* @property {Buffer} [key]
*/
function validateRegistrar (registrar) {

@@ -261,3 +271,3 @@ // registrar handling

* Validates the given message. The signature will be checked for authenticity.
* @param {rpc.RPC.Message} message
* @param {InMessage} message
* @returns {Promise<Boolean>}

@@ -264,0 +274,0 @@ */

@@ -56,3 +56,3 @@ 'use strict'

*
* @param {Message} message
* @param {InMessage} message
* @returns {Promise<PublicKey>}

@@ -70,3 +70,8 @@ */

// should be available in the from property of the message (peer id)
const from = PeerId.createFromBytes(message.from)
let from
if (typeof message.from === 'string') {
from = PeerId.createFromB58String(message.from)
} else {
from = PeerId.createFromBytes(message.from)
}

@@ -73,0 +78,0 @@ if (from.pubKey) {

@@ -76,5 +76,6 @@ 'use strict'

* @param {Buffer|String} message.from
* @param {PeerId} peerId
* @return {Object}
*/
exports.normalizeInRpcMessage = (message) => {
exports.normalizeInRpcMessage = (message, peerId) => {
const m = Object.assign({}, message)

@@ -84,17 +85,8 @@ if (Buffer.isBuffer(message.from)) {

}
if (peerId) {
m.receivedFrom = peerId.toB58String()
}
return m
}
/**
* The same as `normalizeInRpcMessage`, but performed on an array of messages
* @param {Object[]} messages
* @return {Object[]}
*/
exports.normalizeInRpcMessages = (messages) => {
if (!messages) {
return messages
}
return messages.map(exports.normalizeInRpcMessage)
}
exports.normalizeOutRpcMessage = (message) => {

@@ -107,8 +99,1 @@ const m = Object.assign({}, message)

}
exports.normalizeOutRpcMessages = (messages) => {
if (!messages) {
return messages
}
return messages.map(exports.normalizeOutRpcMessage)
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc