@appsensorlike/appsensorlike
Advanced tools
| import { ServerConnection } from "../../../../core/configuration/client/client_configuration.js"; | ||
| import { JSONClientConfiguration, JSONClientConfigurationReader } from "../JSONClientConfig.js"; | ||
| import { JSONConfigReadValidate } from "../../../../utils/Utils.js"; | ||
| import { Utils } from "../../../../utils/Utils.js"; | ||
| import assert from "assert"; | ||
@@ -17,3 +17,3 @@ class JSONClientConfigurationTest { | ||
| configExpected.setServerConnection(serverConnection); | ||
| const testConfigFile = JSONConfigReadValidate.resolvePath(import.meta.url, 'appsensor-client-config.json'); | ||
| const testConfigFile = Utils.resolvePath(import.meta.url, 'appsensor-client-config.json'); | ||
| const configActual = new JSONClientConfigurationReader().read(testConfigFile); | ||
@@ -20,0 +20,0 @@ assert.deepStrictEqual(configActual, configExpected); |
@@ -7,5 +7,5 @@ import { JSONServerConfiguration, JSONServerConfigurationReader } from "../JSONServerConfig.js"; | ||
| import { Clause, Expression, MonitorPoint, Rule } from "../../../../core/rule/rule.js"; | ||
| import { Utils } from "../../../../utils/Utils.js"; | ||
| import assert from "assert"; | ||
| import fs from 'fs'; | ||
| import { JSONConfigReadValidate } from "../../../../utils/Utils.js"; | ||
| class JSONServerConfigurationTest { | ||
@@ -133,3 +133,3 @@ testConfigurationReadOfAllElements() { | ||
| } | ||
| const configFilePath = JSONConfigReadValidate.resolvePath(import.meta.url, JSONServerConfigurationTest.TEST_CONFIG_LOCATION); | ||
| const configFilePath = Utils.resolvePath(import.meta.url, JSONServerConfigurationTest.TEST_CONFIG_LOCATION); | ||
| configExpected.configurationFile = fs.realpathSync(configFilePath); | ||
@@ -136,0 +136,0 @@ const configActual = new JSONServerConfigurationReader().read(configFilePath); |
@@ -1,2 +0,2 @@ | ||
| import { JSONConfigReadValidate } from '../../../utils/Utils.js'; | ||
| import { Utils } from '../../../utils/Utils.js'; | ||
| import { runTests as test } from '../../tests/tests.js'; | ||
@@ -6,3 +6,3 @@ import { AppSensorLocal } from '../appsensor_local.js'; | ||
| const configLocation = "../execution-modes/tests/analysis/appsensor-analysis-tests-server-config.json"; | ||
| const configAbsolutPath = JSONConfigReadValidate.resolvePath(import.meta.url, configLocation); | ||
| const configAbsolutPath = Utils.resolvePath(import.meta.url, configLocation); | ||
| const appSensorLocal = new AppSensorLocal(configAbsolutPath); | ||
@@ -9,0 +9,0 @@ await test(appSensorLocal.getAppSensorServer(), appSensorLocal.getAppSensorClient(), configLocation, readInf); |
@@ -46,3 +46,2 @@ import { AppSensorEvent, Attack, DetectionPoint, IPAddress, Response, IValidateInitialize } from '../core/core.js'; | ||
| protected validateConfig(config: any, validatorLocation: string, reload: boolean): boolean; | ||
| static resolvePath(relativeToFileURL: string, fileLocation: string): string; | ||
| } | ||
@@ -56,2 +55,3 @@ declare class Utils { | ||
| static responsePrototypeSample: Response; | ||
| static resolvePath(relativeToFileURL: string, fileLocation: string): string; | ||
| static sleep(timeOutInMilis: number): Promise<null>; | ||
@@ -58,0 +58,0 @@ static setPrototypeInDepth(target: Object, source: Object): void; |
@@ -86,4 +86,4 @@ import fs from 'fs'; | ||
| constructor(defaultRelativeTo, defaultConfigFile, defaultConfigSchemaFile = null, prototypeOfConfigObj) { | ||
| this.defaultConfigFile = JSONConfigReadValidate.resolvePath(defaultRelativeTo, defaultConfigFile); | ||
| this.defaultConfigSchemaFile = defaultConfigSchemaFile ? JSONConfigReadValidate.resolvePath(defaultRelativeTo, defaultConfigSchemaFile) : null; | ||
| this.defaultConfigFile = Utils.resolvePath(defaultRelativeTo, defaultConfigFile); | ||
| this.defaultConfigSchemaFile = defaultConfigSchemaFile ? Utils.resolvePath(defaultRelativeTo, defaultConfigSchemaFile) : null; | ||
| this.prototypeOfConfigObj = prototypeOfConfigObj; | ||
@@ -219,2 +219,4 @@ } | ||
| } | ||
| } | ||
| class Utils { | ||
| static resolvePath(relativeToFileURL, fileLocation) { | ||
@@ -230,4 +232,2 @@ let __dirname = process.cwd(); | ||
| } | ||
| } | ||
| class Utils { | ||
| static sleep(timeOutInMilis) { | ||
@@ -234,0 +234,0 @@ return new Promise((resolve, reject) => { |
+1
-1
| { | ||
| "name": "@appsensorlike/appsensorlike", | ||
| "version": "0.20.1", | ||
| "version": "0.20.2", | ||
| "description": "A port of OWASP AppSensor reference implementation", | ||
@@ -5,0 +5,0 @@ "main": "", |
Network access
Supply chain riskThis module accesses the network.
Found 4 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 4 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
553344
-0.02%