Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
express-drupal7-session-middleware
Advanced tools
Express middleware to retrieve a user session from a drupal 7 cookie
Express middleware to retrieve a user session from a drupal 7 cookie
npm i express-drupal7-session-middleware
You need to use knex query builder to use this package.
npm i cookie-parser knex
See knex documentation on how to create a new instance.
In your server definition
const { drupalExpressMiddleware } = require('express-drupal7-session-middleware');
app.httpServer = http.createServer(app);
// ...
app.use(cookieParser());
app.use(drupalExpressMiddleware('local.my-website.com', knex));
then in your routes
const { drupalUserAccess, drupalCSRFToken } = require('express-drupal7-session-middleware');
const myRoute = async (req, res) => {
const access = await drupalUserAccess(knex, 'access api myRoute', req.userId);
if (!access) {
return res.status(403).send();
}
// Bonus if you need it
console.log(req.cookieSessionText);
// -- and --
const drupalHashSalt = 'fwf3qfwgrbq34h34qeg134g3434g5340f-0f';
const csrfToken = await drupalCSRFToken(knex, req.sessionId, drupalHashSalt, 'services'));
res.json({ csrfToken });
}
FAQs
Express middleware to retrieve a user session from a drupal 7 cookie
The npm package express-drupal7-session-middleware receives a total of 0 weekly downloads. As such, express-drupal7-session-middleware popularity was classified as not popular.
We found that express-drupal7-session-middleware demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.