
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
deepstream-passport
Advanced tools
This project is no longer supported. My other module use-express-middleware
covers this use case.
npm install deepstream-passport --save
import Deepstream from 'deepstream.io'
import deepstreamPassport from 'deepstream-passport'
import expressSession from 'express-session'
const server = new Deepstream()
// You can define this somewhere in your app and then import it both
// for express and deepstream.
// If you use a store such as redis for you sessions, you'll be able
// to run express and deepstream in two seperate processes and/or on
// two seperate ports if you so please.
const session = expressSession({
...options
})
// Basic:
server.set('permissionHandler', deepstreamPassport(session, {
canPerformAction(user, callback) {
callback(null, user.isAdmin)
}
}))
// Custom `isValidUser`:
server.set('permissionHandler', deepstreamPassport(session, {
isValidUser: (user, callback) => {
if(user) {
callback(null, user.id)
} else {
callback(null, 'open')
}
},
canPerformAction(user, callback) {
callback(null, user.isAdmin)
}
}))
FAQs
Passport Session Authentication for Deepstream.io
We found that deepstream-passport 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.