Registry / auth-security / wedeploy-middleware

wedeploy-middleware

JSON →
library3.2.0jsnpmunverified

Express middleware for authenticating requests using WeDeploy Auth service. Supports multiple authentication methods including Basic Auth, OAuth2 bearer tokens (header, query string, cookie). Version 3.2.0 is the latest stable release. Integrates with WeDeploy platform for federated identity providers. Requires Node.js >= 7.6.0. Note: WeDeploy service is deprecated; use only for legacy systems.

npm install wedeploy-middleware
INSTALL
IMPORT
SIG · WEDEPLOY-MIDDLEWAR
W
wedeploy-middleware
auth-securityjavascriptv3.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const wedeployMiddleware = require('wedeploy-middleware');
import wedeployMiddleware from 'wedeploy-middleware';
Package uses CommonJS; no default ES module export available.
auth
const { auth } = require('wedeploy-middleware');
import { auth } from 'wedeploy-middleware';
Destructuring works in CommonJS but not ES imports as no named exports.
wedeployMiddleware.auth
const wedeployMiddleware = require('wedeploy-middleware'); wedeployMiddleware.auth(options);
auth is a method on the default exported object.

Sets up Express app with WeDeploy auth middleware, protecting a private route.

const express = require('express'); const wedeployMiddleware = require('wedeploy-middleware'); const app = express(); const authUrl = process.env.AUTH_URL ?? 'auth.project.wedeploy.io'; app.use(wedeployMiddleware.auth({ url: authUrl })); app.get('/private', (req, res) => { res.json({ user: res.locals.auth.currentUser }); }); app.listen(3000);
Debug
Known issues
deprecatedWeDeploy service is deprecated. This middleware will not work with new projects.
fix
Migrate to a different authentication middleware like passport.js.
affects: >=3.0.0
gotchaAuth middleware does not run on unmatched routes; must be applied per route or globally.
fix
Use app.use(middleware) to apply globally.
affects: >=3.0.0
gotchaThe option 'unauthorizedOnly' may prevent access to routes intended for unauthenticated users.
fix
Set 'unauthorizedOnly' only on routes where no user should be logged in.
affects: >=3.0.0
Errors
Common errors & fixes
TypeError: wedeployMiddleware.auth is not a function
Using ES module import syntax with CommonJS package.
fix
Use require() instead of import.
Cannot find module 'wedeploy-middleware'
Package not installed or missing from node_modules.
fix
Run: npm install wedeploy-middleware
Upgrade
Version history
3.2.0latest on npm
Audit
Dependencies
expressrequiredMiddleware designed for Express framework
Agent activity
25 hits · last 30 days
node
22
OpenAI (training)
1
Resources
wedeploy-middleware — npm install wedeploy-middleware · libregistry