Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@itentialopensource/adapter-utils

Package Overview
Dependencies
Maintainers
6
Versions
215
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@itentialopensource/adapter-utils - npm Package Compare versions

Comparing version 5.3.9 to 5.3.10

8

CHANGELOG.md
## 5.3.10 [03-06-2024]
* Fix some security vulnerabilities
See merge request itentialopensource/adapter-utils!289
---
## 5.3.9 [03-04-2024]

@@ -3,0 +11,0 @@

43

lib/restHandler.js

@@ -145,5 +145,36 @@ /* @copyright Itential, LLC 2018 */

// copy the request so lint does not complain about update
const newReqObj = request;
// this is only something in Form data with files
if (entitySchema && entitySchema.requestDatatype && entitySchema.requestDatatype.toUpperCase() === 'FORM') {
// need to convert request.body back to JSON
let mybody = newReqObj.body;
if (typeof mybody === 'string') {
try {
mybody = JSON.parse(newReqObj.body);
} catch (ex) {
log.debug('Rest Handler can not parse Form Body');
}
}
// set the filePath into the request object
const mykeys = Object.keys(mybody);
for (let k = 0; k < mykeys.length; k += 1) {
if (mykeys[k] === 'file') {
const itemVal = mybody[mykeys[k]];
if ((typeof itemVal === 'string') && (itemVal.indexOf('@') === 0)) {
const fileVal = itemVal;
if (fileVal.indexOf('@') === 0) {
const filePart = fileVal.split(';');
newReqObj.filePath = filePart[0].substring(1);
}
}
break;
}
}
}
try {
// perform the request to get entity(ies)
return connectorInst.performRequest(request, entitySchema, callProperties, (resObj, perror) => {
return connectorInst.performRequest(newReqObj, entitySchema, callProperties, (resObj, perror) => {
if (perror) {

@@ -223,9 +254,9 @@ let retError = null;

const responseKeys = entitySchema.responseObjects;
const uriPath = request.origPath;
const method = request.method.toUpperCase();
const reqBody = request.body;
const reqPath = request.path;
const uriPath = newReqObj.origPath;
const method = newReqObj.method.toUpperCase();
const reqBody = newReqObj.body;
const reqPath = newReqObj.path;
// if there is a request body, see if there is something that matches a specific input
if (reqBody && (!entitySchema || !entitySchema.requestDatatype
if (reqBody && (typeof reqBody === 'string') && (!entitySchema || !entitySchema.requestDatatype
|| entitySchema.requestDatatype.toUpperCase() === 'JSON' || entitySchema.requestDatatype.toUpperCase() === 'URLENCODE')) {

@@ -232,0 +263,0 @@ let reqBdObj = null;

2

package.json
{
"name": "@itentialopensource/adapter-utils",
"version": "5.3.9",
"version": "5.3.10",
"description": "Itential Adapter Utility Libraries",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc