
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
local-authority
Advanced tools
A comprehensive user management and authorization package for Node.js applications
Eine umfassende Benutzer- und Authentifizierungsverwaltung für Node.js-Anwendungen.
npm install local-authority
import { AuthService, AuthMiddleware, RoleService } from 'local-authority';
// Initialisiere die Services
const authService = new AuthService('dein-geheimer-schlüssel');
const roleService = new RoleService();
const authMiddleware = new AuthMiddleware(authService, roleService);
import express from 'express';
const app = express();
// Authentifizierung für eine Route
app.get('/geschuetzt',
authMiddleware.authenticate,
(req, res) => {
res.json({ message: 'Geschützter Bereich' });
}
);
// Autorisierung mit Rollen
app.post('/admin',
authMiddleware.authenticate,
authMiddleware.requireRoles(['admin']),
(req, res) => {
res.json({ message: 'Admin-Bereich' });
}
);
// Feingranulare Berechtigungen
app.put('/benutzer/:id',
authMiddleware.authenticate,
authMiddleware.authorize('user', 'update'),
(req, res) => {
res.json({ message: 'Benutzer aktualisiert' });
}
);
// Benutzer registrieren
app.post('/registrieren', async (req, res) => {
try {
const { username, email, password } = req.body;
const user = await authService.register(username, email, password);
res.json(user);
} catch (error) {
res.status(400).json({ message: error.message });
}
});
// Benutzer einloggen
app.post('/login', async (req, res) => {
try {
const { email, password } = req.body;
const { user, token } = await authService.login(email, password);
res.json({ user, token });
} catch (error) {
res.status(401).json({ message: error.message });
}
});
# Repository klonen
git clone [repository-url]
# Abhängigkeiten installieren
npm install
# Tests ausführen
npm test
# Build erstellen
npm run build
MIT
FAQs
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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.