
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@ddatabase/peer-auth
Advanced tools
Authenticate a @ddatabase/protocol connection by signing the NOISE public keys with a static key pair.
Authenticate a @ddatabase/protocol connection by signing the NOISE public keys with a static key pair.
See test.js for an example.
const dswarm = require('dswarm')
const Protocol = require('@ddatabase/protocol')
const crypto = require('@ddatabase/crypto')
const auth = require('.')
// each peer/device has a keypair that is stored (or derived)
// this could also be the keypair from an existing hypercore feed
const IDENTITY = crypto.keyPair()
// console.log('my key', IDENTITY.publicKey.toString('hex'))
// it also maintains a list of the pubkeys of peers it wants to connect with
const ALLOWED_KEYS = []
const swarm = dswarm()
swarm.on('connection', onconnection)
function onconnection (socket, details) {
const isInitiator = !!details.client
const protocol = new Protocol(!!details.client)
pump(socket, protocol, socket)
auth(protocol, {
authKeyPair: IDENTITY
onauthenticate (peerAuthKey, cb) {
for (const key of ALLOWED_KEYS) {
if (key.equals(peerAuthKey)) return cb(null, true)
}
cb(null, false)
},
onprotocol (protocol) {
// if this is called, the peer has proven:
// - it has the secret key to the peerAuthKey above
// - the peerAuthKey passed the onauthenticate hook
// so here you'd start replicating feeds:
// feed.replicate(isInitiator, { stream: protocol })
}
})
}
FAQs
Authenticate a @ddatabase/protocol connection by signing the NOISE public keys with a static key pair.
We found that @ddatabase/peer-auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.