@aikidosec/firewall
Version:
Zen by Aikido is an embedded Application Firewall that autonomously protects Node.js apps against common and critical attacks, provides rate limiting, detects malicious traffic (including bots), and more.
18 lines (17 loc) • 866 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.wrapInstalledPackages = wrapInstalledPackages;
const isAnyPkgAlreadyRequired_1 = require("../helpers/isAnyPkgAlreadyRequired");
const applyHooks_1 = require("./applyHooks");
const Hooks_1 = require("./hooks/Hooks");
function wrapInstalledPackages(wrappers, serverless) {
const hooks = new Hooks_1.Hooks();
wrappers.forEach((wrapper) => {
wrapper.wrap(hooks);
});
if (!serverless && (0, isAnyPkgAlreadyRequired_1.isAnyPkgAlreadyRequired)(hooks.getPackages())) {
// eslint-disable-next-line no-console
console.warn("AIKIDO: Some packages can't be protected because they were imported before Zen was initialized. Please make sure to import Zen as the first module in your application.");
}
return (0, applyHooks_1.applyHooks)(hooks);
}