keycloak-nodejs-middleware
Advanced tools
Comparing version 1.3.0 to 1.4.0
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
@@ -75,17 +64,2 @@ if (k2 === undefined) k2 = k; | ||
var node_fetch_commonjs_1 = __importStar(require("node-fetch-commonjs")); | ||
var https_1 = require("https"); | ||
var fs_1 = require("fs"); | ||
var path_1 = require("path"); | ||
// Path to the custom certificate bundle | ||
var customCertBundlePath = (0, path_1.join)(__dirname, "../node_modules/node_extra_ca_certs_mozilla_bundle/ca_bundle/ca_intermediate_root_bundle.pem"); | ||
// Read the custom certificate bundle | ||
var customCertBundle = (0, fs_1.readFileSync)(customCertBundlePath, "utf-8"); | ||
// Custom fetch function with the custom certificate bundle | ||
var customFetch = function (url, options) { return __awaiter(void 0, void 0, void 0, function () { | ||
var agent; | ||
return __generator(this, function (_a) { | ||
agent = new https_1.Agent({ ca: customCertBundle }); | ||
return [2 /*return*/, (0, node_fetch_commonjs_1.default)(url, __assign({ agent: agent }, options))]; | ||
}); | ||
}); }; | ||
function keycloakMiddleware(_a) { | ||
@@ -117,5 +91,6 @@ var _this = this; | ||
redirect: "follow", | ||
strictSSL: false, | ||
}; | ||
url = "".concat(host, "/realms/").concat(realm, "/protocol/openid-connect/token/introspect"); | ||
return [4 /*yield*/, customFetch(url, requestOptions)]; | ||
return [4 /*yield*/, (0, node_fetch_commonjs_1.default)(url, requestOptions)]; | ||
case 2: | ||
@@ -122,0 +97,0 @@ rawResponse = _a.sent(); |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
@@ -75,17 +64,2 @@ if (k2 === undefined) k2 = k; | ||
var node_fetch_commonjs_1 = __importStar(require("node-fetch-commonjs")); | ||
var https_1 = require("https"); | ||
var fs_1 = require("fs"); | ||
var path_1 = require("path"); | ||
// Path to the custom certificate bundle | ||
var customCertBundlePath = (0, path_1.join)(__dirname, "../node_modules/node_extra_ca_certs_mozilla_bundle/ca_bundle/ca_intermediate_root_bundle.pem"); | ||
// Read the custom certificate bundle | ||
var customCertBundle = (0, fs_1.readFileSync)(customCertBundlePath, "utf-8"); | ||
// Custom fetch function with the custom certificate bundle | ||
var customFetch = function (url, options) { return __awaiter(void 0, void 0, void 0, function () { | ||
var agent; | ||
return __generator(this, function (_a) { | ||
agent = new https_1.Agent({ ca: customCertBundle }); | ||
return [2 /*return*/, (0, node_fetch_commonjs_1.default)(url, __assign({ agent: agent }, options))]; | ||
}); | ||
}); }; | ||
function keycloakMiddleware(_a) { | ||
@@ -117,5 +91,6 @@ var _this = this; | ||
redirect: "follow", | ||
strictSSL: false, | ||
}; | ||
url = "".concat(host, "/realms/").concat(realm, "/protocol/openid-connect/token/introspect"); | ||
return [4 /*yield*/, customFetch(url, requestOptions)]; | ||
return [4 /*yield*/, (0, node_fetch_commonjs_1.default)(url, requestOptions)]; | ||
case 2: | ||
@@ -122,0 +97,0 @@ rawResponse = _a.sent(); |
{ | ||
"name": "keycloak-nodejs-middleware", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Keycloak middleware for nodejs apps", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
0
16094
270