mcp-server-semgrep
Version:
MCP Server for Semgrep Integration - static code analysis with AI
17 lines (14 loc) • 422 B
JavaScript
const $jwt = require('jsonwebtoken');
const cert = 'hardcoded-secret';
module.exports = (app) => {
app.post('/api/login', (req, res) => {
app.login(req.body.username, req.body.password).then((out) => {
// ruleid: hardcoded-jwt-secret
out.token = $jwt.sign(out, cert, {expiresIn: '1d'});
res.send(out);
}, (err) => {
console.error(err);
res.status(400).send(err);
});
});
};