Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions Control/lib/services/environment/EnvironmentCache.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,21 @@
const keys = attributePath.split('.');
for (let i = 0; i < keys.length - 1; i++) {
const key = keys[i];
if (key === "__proto__" || key === "constructor") {
this._logger.warnMessage(`Attempt to modify restricted property '${key}' in environment with id ${id}.`);
return null;
}
if (!current[key]) {
current[key] = {};
}
current = current[key];
}
current[keys[keys.length - 1]] = value;
}

Check failure on line 100 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests & coverage on ubuntu-latest

Expected indentation of 8 spaces but found 7

Check failure on line 100 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests on macos-latest

Expected indentation of 8 spaces but found 7
current = current[key];

Check failure on line 101 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests & coverage on ubuntu-latest

Expected indentation of 8 spaces but found 7

Check failure on line 101 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests on macos-latest

Expected indentation of 8 spaces but found 7
}

Check failure on line 102 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests & coverage on ubuntu-latest

Expected indentation of 6 spaces but found 5

Check failure on line 102 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests on macos-latest

Expected indentation of 6 spaces but found 5
const finalKey = keys[keys.length - 1];

Check failure on line 103 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests & coverage on ubuntu-latest

Expected indentation of 6 spaces but found 5

Check failure on line 103 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests on macos-latest

Expected indentation of 6 spaces but found 5
if (finalKey === "__proto__" || finalKey === "constructor") {

Check failure on line 104 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests & coverage on ubuntu-latest

Expected indentation of 6 spaces but found 5

Check failure on line 104 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests on macos-latest

Expected indentation of 6 spaces but found 5
this._logger.warnMessage(`Attempt to modify restricted property '${finalKey}' in environment with id ${id}.`);

Check failure on line 105 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests & coverage on ubuntu-latest

Expected indentation of 8 spaces but found 7

Check failure on line 105 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests on macos-latest

Expected indentation of 8 spaces but found 7
return null;

Check failure on line 106 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests & coverage on ubuntu-latest

Expected indentation of 8 spaces but found 7

Check failure on line 106 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests on macos-latest

Expected indentation of 8 spaces but found 7
}

Check failure on line 107 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests & coverage on ubuntu-latest

Expected indentation of 6 spaces but found 5

Check failure on line 107 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests on macos-latest

Expected indentation of 6 spaces but found 5
current[finalKey] = value;

Check failure on line 108 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests & coverage on ubuntu-latest

Expected indentation of 6 spaces but found 5

Check failure on line 108 in Control/lib/services/environment/EnvironmentCache.service.js

View workflow job for this annotation

GitHub Actions / Tests on macos-latest

Expected indentation of 6 spaces but found 5

this._environments.set(id, cachedEnvironment);
return cachedEnvironment;
Expand Down
Loading