New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@eclipse-che/che-e2e

Package Overview
Dependencies
Maintainers
5
Versions
363
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eclipse-che/che-e2e - npm Package Compare versions

Comparing version 7.40.3-dev-0d6b41a to 7.40.3-dev-c00847f

33

dist/utils/requestHandlers/CheApiRequestHandler.js

@@ -32,2 +32,3 @@ "use strict";

const inversify_1 = require("inversify");
const Logger_1 = require("../Logger");
let CheApiRequestHandler = class CheApiRequestHandler {

@@ -41,11 +42,19 @@ constructor(headerHandler) {

static enableRequestInteceptor() {
console.log(`CheApiRequestHandler.enableRequestInterceptor`);
Logger_1.Logger.debug(`CheApiRequestHandler.enableRequestInterceptor`);
return axios_1.default.interceptors.request.use(request => {
try {
let request_censored = JSON.parse(JSON.stringify(request));
if (request_censored === undefined) {
Logger_1.Logger.error('JSON.parse returned an undefined object, cannot process request');
return request;
}
if (request_censored.headers === undefined) {
Logger_1.Logger.warn('Request does not contain any headers object');
return request;
}
request_censored.headers.Authorization = 'CENSORED';
console.log(`RequestHandler request:\n`, request_censored);
Logger_1.Logger.info(`RequestHandler request:\n` + request_censored);
}
catch (err) {
console.log(`RequestHandler request: Failed to deep clone AxiosRequestConfig:`, err);
Logger_1.Logger.error(`RequestHandler request: Failed to deep clone AxiosRequestConfig:` + err);
}

@@ -59,3 +68,3 @@ return request;

static enableResponseInterceptor() {
console.log(`CheApiRequestHandler.enableResponseRedirects`);
Logger_1.Logger.debug(`CheApiRequestHandler.enableResponseRedirects`);
return axios_1.default.interceptors.response.use(response => {

@@ -69,2 +78,14 @@ try {

}));
if (response_censored === undefined) {
Logger_1.Logger.error('JSON.parse returned an undefined object, cannot process response');
return response;
}
if (response_censored.config === undefined) {
Logger_1.Logger.warn('Response does not contain any config object');
return response;
}
if (response_censored.config.headers === undefined) {
Logger_1.Logger.warn('Response does not contain any config.headers object');
return response;
}
response_censored.config.headers.Authorization = 'CENSORED';

@@ -77,6 +98,6 @@ if (response_censored.data.access_token != null) {

}
console.log(`RequestHandler response:\n`, response_censored);
Logger_1.Logger.info(`RequestHandler response:\n` + response_censored);
}
catch (err) {
console.log(`RequestHandler response: Failed to deep clone AxiosResponse:`, err);
Logger_1.Logger.error(`RequestHandler response: Failed to deep clone AxiosResponse:` + err);
}

@@ -83,0 +104,0 @@ return response;

6

package.json
{
"name": "@eclipse-che/che-e2e",
"version": "7.40.3-dev-0d6b41a",
"version": "7.40.3-dev-c00847f",
"description": "",

@@ -40,3 +40,3 @@ "main": "dist/index.js",

"@types/selenium-webdriver": "3.0.16",
"axios": "0.21.2",
"axios": "^0.25.0",
"chai": "4.2.0",

@@ -53,3 +53,3 @@ "chromedriver": "95.0.0",

"dependencies": {
"@eclipse-che/api": "latest",
"@eclipse-che/api": "7.40.1",
"inversify": "5.0.1",

@@ -56,0 +56,0 @@ "reflect-metadata": "0.1.13"

@@ -16,2 +16,3 @@ /*********************************************************************

import { IAuthorizationHeaderHandler } from './headers/IAuthorizationHeaderHandler';
import { Logger } from '../Logger';

@@ -25,10 +26,18 @@ @injectable()

public static enableRequestInteceptor(): number {
console.log(`CheApiRequestHandler.enableRequestInterceptor`);
Logger.debug(`CheApiRequestHandler.enableRequestInterceptor`);
return axios.interceptors.request.use( request => {
try {
let request_censored: AxiosRequestConfig = JSON.parse(JSON.stringify(request));
if (request_censored === undefined) {
Logger.error('JSON.parse returned an undefined object, cannot process request');
return request;
}
if (request_censored.headers === undefined) {
Logger.warn('Request does not contain any headers object');
return request;
}
request_censored.headers.Authorization = 'CENSORED';
console.log(`RequestHandler request:\n`, request_censored);
Logger.info(`RequestHandler request:\n` + request_censored);
} catch (err) {
console.log(`RequestHandler request: Failed to deep clone AxiosRequestConfig:`, err);
Logger.error(`RequestHandler request: Failed to deep clone AxiosRequestConfig:` + err);
}

@@ -43,3 +52,3 @@ return request;

public static enableResponseInterceptor(): number {
console.log(`CheApiRequestHandler.enableResponseRedirects`);
Logger.debug(`CheApiRequestHandler.enableResponseRedirects`);
return axios.interceptors.response.use( response => {

@@ -53,2 +62,14 @@ try {

}));
if (response_censored === undefined) {
Logger.error('JSON.parse returned an undefined object, cannot process response');
return response;
}
if (response_censored.config === undefined) {
Logger.warn('Response does not contain any config object');
return response;
}
if (response_censored.config.headers === undefined) {
Logger.warn('Response does not contain any config.headers object');
return response;
}
response_censored.config.headers.Authorization = 'CENSORED';

@@ -61,5 +82,5 @@ if (response_censored.data.access_token != null) {

}
console.log(`RequestHandler response:\n`, response_censored);
Logger.info(`RequestHandler response:\n` + response_censored);
} catch (err) {
console.log(`RequestHandler response: Failed to deep clone AxiosResponse:`, err);
Logger.error(`RequestHandler response: Failed to deep clone AxiosResponse:` + err);
}

@@ -66,0 +87,0 @@ return response;

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