
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
cf-auth-middleware
Advanced tools
Authentication middleware for APIs using cf-auth-provider
npm install --save cf-auth-middleware
var express = require('express')
, createAuthMiddleware = require('cf-auth-middleware')
, authProvider = require('cf-auth-provider')(myCollection, hashFn)
var app = express()
, authMiddleware = createAuthMiddleware(authProvider)
app.get('/private', authMiddleware, function (req, res) {
// This route is only accessible to users that are
// able to authenticate with the given authProvider
})
An authenticated request contains the following headers:
Content-Type: 'application/json'
x-cf-date: 'Tue, 05 Nov 2013 12:22:23 GMT'
authorization: 'Catfish {authorizing entity id}:{signed request}'
The client must sign the request with the following algorithm:
var crypto = require('crypto')
function createSignature(key, method, contentType, date, path) {
var hmac = crypto.createHmac('sha1', key)
, packet = method + '\n\n' + (contentType || '') + '\n' + date + '\n\n' + path
return hmac.update(packet).digest('base64')
}
authProvider
is an instance of cf-auth-provider
.
Options:
options.logger
: an object with debug()
, info()
, warn()
, error()
. Defaults to console
.options.reqProperty
: the authed client's id is stored on the request object: req[options.reqProperty]
. Defaults to authedClient
.Built by developers at Clock.
Licensed under the New BSD License
FAQs
Authentication middleware for APIs using cf-auth-provider
The npm package cf-auth-middleware receives a total of 67 weekly downloads. As such, cf-auth-middleware popularity was classified as not popular.
We found that cf-auth-middleware 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.