Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
egg-passport-http-bearer
Advanced tools
$ npm i egg-passport --save
$ npm i egg-passport-http-bearer --save
Note: also need egg-passport .
// {app_root}/config/plugin.js
exports.passport = {
enable: true,
package: 'egg-passport',
};
exports.passportLocal = {
enable: true,
package: 'egg-passport-http-bearer',
};
see fixture for more detail.
// ./controller/home.js
class HomeController extends Controller {
async index() {
const ctx = this.ctx;
ctx.body = `
<div>
<h2>${ctx.path}</h2>
<a href="/admin">admin</a>
</div>
`;
}
async admin() {
const { ctx } = this;
if (ctx.isAuthenticated()) {
// show user info
} else {
// do user login
}
}
async logout() {
const ctx = this.ctx;
ctx.logout();
ctx.redirect(ctx.get('referer') || '/');
}
}
// router.js
module.exports = app => {
app.router.get('/', 'home.render');
app.router.get('/admin', 'home.admin');
const localStrategy = app.passport.authenticate('bearer', { session: false}); // without session for restful api
app.router.post('/passport/token', localStrategy);
app.router.get('/logout', 'user.logout');
};
see passport example for more detail.
FAQs
the passport-http-bearer plugin for egg
The npm package egg-passport-http-bearer receives a total of 0 weekly downloads. As such, egg-passport-http-bearer popularity was classified as not popular.
We found that egg-passport-http-bearer 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.