Skip to content

Commit

Permalink
[Synthetics] Only allow params to be saved against specific namespaces (
Browse files Browse the repository at this point in the history
#155948)

## Summary

We had an issue backporting some changes in a previous patch, and some
of the code from the update did not make it into 8.7. This PR introduces
a commit that did not fully merge.

Co-authored-by: shahzad31 <shahzad31comp@gmail.com>
  • Loading branch information
justinkambic and shahzad31 committed Apr 26, 2023
1 parent 167c328 commit 4054695
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ export class SyntheticsService {
async getSyntheticsParams({ spaceId }: { spaceId?: string } = {}) {
const encryptedClient = this.server.encryptedSavedObjects.getClient();

const paramsBySpace: Record<string, Record<string, string>> = {};
const paramsBySpace: Record<string, Record<string, string>> = Object.create(null);

const finder =
await encryptedClient.createPointInTimeFinderDecryptedAsInternalUser<SyntheticsParamSO>({
Expand All @@ -486,7 +486,7 @@ export class SyntheticsService {
response.saved_objects.forEach((param) => {
param.namespaces?.forEach((namespace) => {
if (!paramsBySpace[namespace]) {
paramsBySpace[namespace] = {};
paramsBySpace[namespace] = Object.create(null);
}
paramsBySpace[namespace][param.attributes.key] = param.attributes.value;
});
Expand Down

0 comments on commit 4054695

Please sign in to comment.