Skip to content

Commit

Permalink
Merge branch 'profiling-fleet-support' of github.com:cauemarcondes/ki…
Browse files Browse the repository at this point in the history
…bana into profiling-fleet-support
  • Loading branch information
cauemarcondes committed Apr 13, 2023
2 parents a0c4b63 + 721a365 commit 14d4035
Show file tree
Hide file tree
Showing 117 changed files with 2,360 additions and 1,426 deletions.
5 changes: 3 additions & 2 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ const uploadPipeline = (pipelineContent: string | object) => {
}

if (
(await doAnyChangesMatch([/^x-pack\/plugins\/osquery/, /^x-pack\/test\/osquery_cypress/])) ||
GITHUB_PR_LABELS.includes('ci:all-cypress-suites')
((await doAnyChangesMatch([/^x-pack\/plugins\/osquery/, /^x-pack\/test\/osquery_cypress/])) ||
GITHUB_PR_LABELS.includes('ci:all-cypress-suites')) &&
!GITHUB_PR_LABELS.includes('ci:skip-cypress-osquery')
) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/osquery_cypress.yml'));
}
Expand Down
50 changes: 0 additions & 50 deletions packages/kbn-apm-config-loader/src/utils/ensure_deep_object.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/kbn-apm-config-loader/src/utils/read_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { readFileSync } from 'fs';
import { safeLoad } from 'js-yaml';

import { set } from '@kbn/safer-lodash-set';
import { ensureDeepObject } from '@kbn/std';
import { isPlainObject } from 'lodash';
import { ensureDeepObject } from './ensure_deep_object';

const readYaml = (path: string) => {
try {
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-apm-config-loader/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@kbn/safer-lodash-set",
"@kbn/utils",
"@kbn/config-schema",
"@kbn/std",
],
"exclude": [
"target/**/*",
Expand Down
5 changes: 5 additions & 0 deletions packages/kbn-config/src/__fixtures__/forbidden_1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test: {
"aaa['__proto__.hello']": "Hello",
"aaa['__proto__.nested.there']": "There",
"aaa['__proto__.nested.here']": "This JS syntax is apparently valid for our parser"
}
3 changes: 3 additions & 0 deletions packages/kbn-config/src/__fixtures__/forbidden_2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test:
hello:
'__proto__.dolly': "Well hello there"
145 changes: 0 additions & 145 deletions packages/kbn-config/src/raw/ensure_deep_object.test.ts

This file was deleted.

50 changes: 0 additions & 50 deletions packages/kbn-config/src/raw/ensure_deep_object.ts

This file was deleted.

12 changes: 12 additions & 0 deletions packages/kbn-config/src/raw/read_config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ test('should throw an exception when referenced environment variable in a config
).toThrowErrorMatchingSnapshot();
});

test('throws parsing a config with forbidden paths', () => {
expect(() =>
getConfigFromFiles([fixtureFile('forbidden_1.yml')])
).toThrowErrorMatchingInlineSnapshot(`"Forbidden path detected: test.aaa.__proto__.hello"`);
});

test('throws parsing another config with forbidden paths', () => {
expect(() =>
getConfigFromFiles([fixtureFile('forbidden_2.yml')])
).toThrowErrorMatchingInlineSnapshot(`"Forbidden path detected: test.hello.__proto__"`);
});

describe('different cwd()', () => {
const originalCwd = process.cwd();
const tempCwd = resolve(__dirname);
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-config/src/raw/read_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { safeLoad } from 'js-yaml';

import { set } from '@kbn/safer-lodash-set';
import { isPlainObject } from 'lodash';
import { ensureDeepObject } from './ensure_deep_object';
import { ensureDeepObject } from '@kbn/std';

const readYaml = (path: string) => safeLoad(readFileSync(path, 'utf8'));

Expand Down
1 change: 1 addition & 0 deletions packages/kbn-std/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ export {
asyncForEach,
asyncForEachWithLimit,
} from './src/iteration';
export { ensureDeepObject } from './src/ensure_deep_object';
export { Semaphore } from './src/semaphore';
Loading

0 comments on commit 14d4035

Please sign in to comment.